diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-10-14 17:54:33 +0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-10-14 17:54:33 +0400 |
commit | 722c55d13e7296cc62ed8a38f926a915ff32e4ea (patch) | |
tree | 445dc4c1a26f9a4203facb9e5f82508588c1abd8 /fs/hfsplus | |
parent | f6089ff87d309a8ddb7b0d4dd92a570f1b0f689b (diff) | |
download | linux-722c55d13e7296cc62ed8a38f926a915ff32e4ea.tar.xz |
hfsplus: remove superflous rootflags field in hfsplus_inode_info
The rootflags field in hfsplus_inode_info only caches the immutable and
append-only flags in the VFS inode, so we can easily get rid of it.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/catalog.c | 1 | ||||
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 2 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 1 | ||||
-rw-r--r-- | fs/hfsplus/ioctl.c | 25 |
4 files changed, 12 insertions, 17 deletions
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index 9d1594b0a07a..bbcf5a27b5d3 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c @@ -77,7 +77,6 @@ static void hfsplus_set_perms(struct inode *inode, struct hfsplus_perm *perms) perms->rootflags |= HFSPLUS_FLG_APPEND; else perms->rootflags &= ~HFSPLUS_FLG_APPEND; - HFSPLUS_I(inode)->rootflags = perms->rootflags; HFSPLUS_I(inode)->userflags = perms->userflags; perms->mode = cpu_to_be16(inode->i_mode); perms->owner = cpu_to_be32(inode->i_uid); diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index d92f590d6633..0d77844a00e8 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -188,7 +188,7 @@ struct hfsplus_inode_info { * Protected by i_mutex. */ sector_t fs_blocks; - u8 rootflags, userflags; /* BSD system and user file flags */ + u8 userflags; /* BSD user file flags */ struct list_head open_dir_list; loff_t phys_size; diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 746e0ee20717..df57ea1f3a71 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -241,7 +241,6 @@ static void hfsplus_get_perms(struct inode *inode, struct hfsplus_perm *perms, i mode = S_IFREG | ((S_IRUGO|S_IWUGO) & ~(sbi->umask)); inode->i_mode = mode; - HFSPLUS_I(inode)->rootflags = perms->rootflags; HFSPLUS_I(inode)->userflags = perms->userflags; if (perms->rootflags & HFSPLUS_FLG_IMMUTABLE) inode->i_flags |= S_IMMUTABLE; diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index c9ac443d202a..80eb5b3a5edd 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c @@ -26,9 +26,9 @@ static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) struct hfsplus_inode_info *hip = HFSPLUS_I(inode); unsigned int flags = 0; - if (hip->rootflags & HFSPLUS_FLG_IMMUTABLE) + if (inode->i_flags & S_IMMUTABLE) flags |= FS_IMMUTABLE_FL; - if (hip->rootflags & HFSPLUS_FLG_APPEND) + if (inode->i_flags |= S_APPEND) flags |= FS_APPEND_FL; if (hip->userflags & HFSPLUS_FLG_NODUMP) flags |= FS_NODUMP_FL; @@ -59,8 +59,8 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) mutex_lock(&inode->i_mutex); - if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) || - hip->rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) { + if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) || + inode->i_flags & (S_IMMUTABLE|S_APPEND)) { if (!capable(CAP_LINUX_IMMUTABLE)) { err = -EPERM; goto out_unlock_inode; @@ -72,20 +72,17 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) err = -EOPNOTSUPP; goto out_unlock_inode; } - if (flags & FS_IMMUTABLE_FL) { + + if (flags & FS_IMMUTABLE_FL) inode->i_flags |= S_IMMUTABLE; - hip->rootflags |= HFSPLUS_FLG_IMMUTABLE; - } else { + else inode->i_flags &= ~S_IMMUTABLE; - hip->rootflags &= ~HFSPLUS_FLG_IMMUTABLE; - } - if (flags & FS_APPEND_FL) { + + if (flags & FS_APPEND_FL) inode->i_flags |= S_APPEND; - hip->rootflags |= HFSPLUS_FLG_APPEND; - } else { + else inode->i_flags &= ~S_APPEND; - hip->rootflags &= ~HFSPLUS_FLG_APPEND; - } + if (flags & FS_NODUMP_FL) hip->userflags |= HFSPLUS_FLG_NODUMP; else |