aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@tuxera.com>2010-10-14 09:54:33 -0400
committerChristoph Hellwig <hch@lst.de>2010-10-14 09:54:33 -0400
commit722c55d13e7296cc62ed8a38f926a915ff32e4ea (patch)
tree445dc4c1a26f9a4203facb9e5f82508588c1abd8 /fs/hfsplus
parentf6089ff87d309a8ddb7b0d4dd92a570f1b0f689b (diff)
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.c1
-rw-r--r--fs/hfsplus/hfsplus_fs.h2
-rw-r--r--fs/hfsplus/inode.c1
-rw-r--r--fs/hfsplus/ioctl.c25
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)
77 perms->rootflags |= HFSPLUS_FLG_APPEND; 77 perms->rootflags |= HFSPLUS_FLG_APPEND;
78 else 78 else
79 perms->rootflags &= ~HFSPLUS_FLG_APPEND; 79 perms->rootflags &= ~HFSPLUS_FLG_APPEND;
80 HFSPLUS_I(inode)->rootflags = perms->rootflags;
81 HFSPLUS_I(inode)->userflags = perms->userflags; 80 HFSPLUS_I(inode)->userflags = perms->userflags;
82 perms->mode = cpu_to_be16(inode->i_mode); 81 perms->mode = cpu_to_be16(inode->i_mode);
83 perms->owner = cpu_to_be32(inode->i_uid); 82 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 {
188 * Protected by i_mutex. 188 * Protected by i_mutex.
189 */ 189 */
190 sector_t fs_blocks; 190 sector_t fs_blocks;
191 u8 rootflags, userflags; /* BSD system and user file flags */ 191 u8 userflags; /* BSD user file flags */
192 struct list_head open_dir_list; 192 struct list_head open_dir_list;
193 loff_t phys_size; 193 loff_t phys_size;
194 194
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
241 mode = S_IFREG | ((S_IRUGO|S_IWUGO) & ~(sbi->umask)); 241 mode = S_IFREG | ((S_IRUGO|S_IWUGO) & ~(sbi->umask));
242 inode->i_mode = mode; 242 inode->i_mode = mode;
243 243
244 HFSPLUS_I(inode)->rootflags = perms->rootflags;
245 HFSPLUS_I(inode)->userflags = perms->userflags; 244 HFSPLUS_I(inode)->userflags = perms->userflags;
246 if (perms->rootflags & HFSPLUS_FLG_IMMUTABLE) 245 if (perms->rootflags & HFSPLUS_FLG_IMMUTABLE)
247 inode->i_flags |= S_IMMUTABLE; 246 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)
26 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 26 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
27 unsigned int flags = 0; 27 unsigned int flags = 0;
28 28
29 if (hip->rootflags & HFSPLUS_FLG_IMMUTABLE) 29 if (inode->i_flags & S_IMMUTABLE)
30 flags |= FS_IMMUTABLE_FL; 30 flags |= FS_IMMUTABLE_FL;
31 if (hip->rootflags & HFSPLUS_FLG_APPEND) 31 if (inode->i_flags |= S_APPEND)
32 flags |= FS_APPEND_FL; 32 flags |= FS_APPEND_FL;
33 if (hip->userflags & HFSPLUS_FLG_NODUMP) 33 if (hip->userflags & HFSPLUS_FLG_NODUMP)
34 flags |= FS_NODUMP_FL; 34 flags |= FS_NODUMP_FL;
@@ -59,8 +59,8 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
59 59
60 mutex_lock(&inode->i_mutex); 60 mutex_lock(&inode->i_mutex);
61 61
62 if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) || 62 if ((flags & (FS_IMMUTABLE_FL|FS_APPEND_FL)) ||
63 hip->rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) { 63 inode->i_flags & (S_IMMUTABLE|S_APPEND)) {
64 if (!capable(CAP_LINUX_IMMUTABLE)) { 64 if (!capable(CAP_LINUX_IMMUTABLE)) {
65 err = -EPERM; 65 err = -EPERM;
66 goto out_unlock_inode; 66 goto out_unlock_inode;
@@ -72,20 +72,17 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
72 err = -EOPNOTSUPP; 72 err = -EOPNOTSUPP;
73 goto out_unlock_inode; 73 goto out_unlock_inode;
74 } 74 }
75 if (flags & FS_IMMUTABLE_FL) { 75
76 if (flags & FS_IMMUTABLE_FL)
76 inode->i_flags |= S_IMMUTABLE; 77 inode->i_flags |= S_IMMUTABLE;
77 hip->rootflags |= HFSPLUS_FLG_IMMUTABLE; 78 else
78 } else {
79 inode->i_flags &= ~S_IMMUTABLE; 79 inode->i_flags &= ~S_IMMUTABLE;
80 hip->rootflags &= ~HFSPLUS_FLG_IMMUTABLE; 80
81 } 81 if (flags & FS_APPEND_FL)
82 if (flags & FS_APPEND_FL) {
83 inode->i_flags |= S_APPEND; 82 inode->i_flags |= S_APPEND;
84 hip->rootflags |= HFSPLUS_FLG_APPEND; 83 else
85 } else {
86 inode->i_flags &= ~S_APPEND; 84 inode->i_flags &= ~S_APPEND;
87 hip->rootflags &= ~HFSPLUS_FLG_APPEND; 85
88 }
89 if (flags & FS_NODUMP_FL) 86 if (flags & FS_NODUMP_FL)
90 hip->userflags |= HFSPLUS_FLG_NODUMP; 87 hip->userflags |= HFSPLUS_FLG_NODUMP;
91 else 88 else