summaryrefslogtreecommitdiffstats
path: root/fs/adfs/inode.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-06-04 15:50:24 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2019-06-27 02:14:14 +0200
commitb4ed8f75c82876342b3399942427392ba5f3bbb5 (patch)
tree255a51e96a772f90f358229791f06ccdcfdb6929 /fs/adfs/inode.c
parentfs/adfs: super: limit idlen according to directory type (diff)
downloadlinux-b4ed8f75c82876342b3399942427392ba5f3bbb5.tar.xz
linux-b4ed8f75c82876342b3399942427392ba5f3bbb5.zip
fs/adfs: add time stamp and file type helpers
Add some helpers to check whether the inode has a time stamp and file type, and to parse the file type from the load address. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs/inode.c')
-rw-r--r--fs/adfs/inode.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 5f5af660b02e..d61c7453a4c3 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -97,7 +97,7 @@ adfs_atts2mode(struct super_block *sb, struct inode *inode)
return S_IFDIR | S_IXUGO | mode;
}
- switch (ADFS_I(inode)->filetype) {
+ switch (adfs_filetype(ADFS_I(inode)->loadaddr)) {
case 0xfc0: /* LinkFS */
return S_IFLNK|S_IRWXUGO;
@@ -177,7 +177,7 @@ adfs_adfs2unix_time(struct timespec64 *tv, struct inode *inode)
2208988800000000000LL;
s64 nsec;
- if (ADFS_I(inode)->stamped == 0)
+ if (!adfs_inode_is_stamped(inode))
goto cur_time;
high = ADFS_I(inode)->loadaddr & 0xFF; /* top 8 bits of timestamp */
@@ -216,7 +216,7 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs)
{
unsigned int high, low;
- if (ADFS_I(inode)->stamped) {
+ if (adfs_inode_is_stamped(inode)) {
/* convert 32-bit seconds to 40-bit centi-seconds */
low = (secs & 255) * 100;
high = (secs / 256) * 100 + (low >> 8) + 0x336e996a;
@@ -266,8 +266,6 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
ADFS_I(inode)->loadaddr = obj->loadaddr;
ADFS_I(inode)->execaddr = obj->execaddr;
ADFS_I(inode)->attr = obj->attr;
- ADFS_I(inode)->filetype = obj->filetype;
- ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000);
inode->i_mode = adfs_atts2mode(sb, inode);
adfs_adfs2unix_time(&inode->i_mtime, inode);