aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/ioctl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@tuxera.com>2010-09-30 23:43:31 -0400
committerChristoph Hellwig <hch@lst.de>2010-09-30 23:43:31 -0400
commit6af502de224c3742936d54eee7e3690c09822934 (patch)
tree9988331693952348503d64764ff81dc3b5d801ab /fs/hfsplus/ioctl.c
parentdd73a01a30d729e8fa6f829c4582650e258e36f9 (diff)
hfsplus: fix HFSPLUS_I calling convention
HFSPLUS_I doesn't return a pointer to the hfsplus-specific inode information like all other FOO_I macros, but dereference the pointer in a way that made it look like a direct struct derefence. This only works as long as the HFSPLUS_I macro is used directly and prevents us from keepig a local hfsplus_inode_info pointer. Fix the calling convention and introduce a local hip variable in all functions that use it constantly. Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/ioctl.c')
-rw-r--r--fs/hfsplus/ioctl.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
index 66dd64b88b2e..c9ac443d202a 100644
--- a/fs/hfsplus/ioctl.c
+++ b/fs/hfsplus/ioctl.c
@@ -23,13 +23,14 @@
23static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) 23static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags)
24{ 24{
25 struct inode *inode = file->f_path.dentry->d_inode; 25 struct inode *inode = file->f_path.dentry->d_inode;
26 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
26 unsigned int flags = 0; 27 unsigned int flags = 0;
27 28
28 if (HFSPLUS_I(inode).rootflags & HFSPLUS_FLG_IMMUTABLE) 29 if (hip->rootflags & HFSPLUS_FLG_IMMUTABLE)
29 flags |= FS_IMMUTABLE_FL; 30 flags |= FS_IMMUTABLE_FL;
30 if (HFSPLUS_I(inode).rootflags & HFSPLUS_FLG_APPEND) 31 if (hip->rootflags & HFSPLUS_FLG_APPEND)
31 flags |= FS_APPEND_FL; 32 flags |= FS_APPEND_FL;
32 if (HFSPLUS_I(inode).userflags & HFSPLUS_FLG_NODUMP) 33 if (hip->userflags & HFSPLUS_FLG_NODUMP)
33 flags |= FS_NODUMP_FL; 34 flags |= FS_NODUMP_FL;
34 35
35 return put_user(flags, user_flags); 36 return put_user(flags, user_flags);
@@ -38,6 +39,7 @@ static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags)
38static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) 39static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
39{ 40{
40 struct inode *inode = file->f_path.dentry->d_inode; 41 struct inode *inode = file->f_path.dentry->d_inode;
42 struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
41 unsigned int flags; 43 unsigned int flags;
42 int err = 0; 44 int err = 0;
43 45
@@ -58,7 +60,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
58 mutex_lock(&inode->i_mutex); 60 mutex_lock(&inode->i_mutex);
59 61
60 if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) || 62 if (flags & (FS_IMMUTABLE_FL|FS_APPEND_FL) ||
61 HFSPLUS_I(inode).rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) { 63 hip->rootflags & (HFSPLUS_FLG_IMMUTABLE|HFSPLUS_FLG_APPEND)) {
62 if (!capable(CAP_LINUX_IMMUTABLE)) { 64 if (!capable(CAP_LINUX_IMMUTABLE)) {
63 err = -EPERM; 65 err = -EPERM;
64 goto out_unlock_inode; 66 goto out_unlock_inode;
@@ -72,22 +74,22 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)
72 } 74 }
73 if (flags & FS_IMMUTABLE_FL) { 75 if (flags & FS_IMMUTABLE_FL) {
74 inode->i_flags |= S_IMMUTABLE; 76 inode->i_flags |= S_IMMUTABLE;
75 HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_IMMUTABLE; 77 hip->rootflags |= HFSPLUS_FLG_IMMUTABLE;
76 } else { 78 } else {
77 inode->i_flags &= ~S_IMMUTABLE; 79 inode->i_flags &= ~S_IMMUTABLE;
78 HFSPLUS_I(inode).rootflags &= ~HFSPLUS_FLG_IMMUTABLE; 80 hip->rootflags &= ~HFSPLUS_FLG_IMMUTABLE;
79 } 81 }
80 if (flags & FS_APPEND_FL) { 82 if (flags & FS_APPEND_FL) {
81 inode->i_flags |= S_APPEND; 83 inode->i_flags |= S_APPEND;
82 HFSPLUS_I(inode).rootflags |= HFSPLUS_FLG_APPEND; 84 hip->rootflags |= HFSPLUS_FLG_APPEND;
83 } else { 85 } else {
84 inode->i_flags &= ~S_APPEND; 86 inode->i_flags &= ~S_APPEND;
85 HFSPLUS_I(inode).rootflags &= ~HFSPLUS_FLG_APPEND; 87 hip->rootflags &= ~HFSPLUS_FLG_APPEND;
86 } 88 }
87 if (flags & FS_NODUMP_FL) 89 if (flags & FS_NODUMP_FL)
88 HFSPLUS_I(inode).userflags |= HFSPLUS_FLG_NODUMP; 90 hip->userflags |= HFSPLUS_FLG_NODUMP;
89 else 91 else
90 HFSPLUS_I(inode).userflags &= ~HFSPLUS_FLG_NODUMP; 92 hip->userflags &= ~HFSPLUS_FLG_NODUMP;
91 93
92 inode->i_ctime = CURRENT_TIME_SEC; 94 inode->i_ctime = CURRENT_TIME_SEC;
93 mark_inode_dirty(inode); 95 mark_inode_dirty(inode);