aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/inode.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-04-16 15:48:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:04:08 -0400
commit79bda4d510f80e403ef66fee852f8ccb17308581 (patch)
tree74c292beca04f1469623cdd7141c074c2ac5a67a /fs/affs/inode.c
parent34f24835383092098cb4ce5c4eb6e719a9973d68 (diff)
fs/affs: use affs_test_opt()
Replace mount option test by affs_test_opt(). Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/affs/inode.c')
-rw-r--r--fs/affs/inode.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 53af66b01566..9628003ccd2f 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -66,23 +66,23 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
66 AFFS_I(inode)->i_lastalloc = 0; 66 AFFS_I(inode)->i_lastalloc = 0;
67 AFFS_I(inode)->i_pa_cnt = 0; 67 AFFS_I(inode)->i_pa_cnt = 0;
68 68
69 if (sbi->s_flags & AFFS_MOUNT_SF_SETMODE) 69 if (affs_test_opt(sbi->s_flags, SF_SETMODE))
70 inode->i_mode = sbi->s_mode; 70 inode->i_mode = sbi->s_mode;
71 else 71 else
72 inode->i_mode = prot_to_mode(prot); 72 inode->i_mode = prot_to_mode(prot);
73 73
74 id = be16_to_cpu(tail->uid); 74 id = be16_to_cpu(tail->uid);
75 if (id == 0 || sbi->s_flags & AFFS_MOUNT_SF_SETUID) 75 if (id == 0 || affs_test_opt(sbi->s_flags, SF_SETUID))
76 inode->i_uid = sbi->s_uid; 76 inode->i_uid = sbi->s_uid;
77 else if (id == 0xFFFF && sbi->s_flags & AFFS_MOUNT_SF_MUFS) 77 else if (id == 0xFFFF && affs_test_opt(sbi->s_flags, SF_MUFS))
78 i_uid_write(inode, 0); 78 i_uid_write(inode, 0);
79 else 79 else
80 i_uid_write(inode, id); 80 i_uid_write(inode, id);
81 81
82 id = be16_to_cpu(tail->gid); 82 id = be16_to_cpu(tail->gid);
83 if (id == 0 || sbi->s_flags & AFFS_MOUNT_SF_SETGID) 83 if (id == 0 || affs_test_opt(sbi->s_flags, SF_SETGID))
84 inode->i_gid = sbi->s_gid; 84 inode->i_gid = sbi->s_gid;
85 else if (id == 0xFFFF && sbi->s_flags & AFFS_MOUNT_SF_MUFS) 85 else if (id == 0xFFFF && affs_test_opt(sbi->s_flags, SF_MUFS))
86 i_gid_write(inode, 0); 86 i_gid_write(inode, 0);
87 else 87 else
88 i_gid_write(inode, id); 88 i_gid_write(inode, id);
@@ -94,7 +94,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
94 /* fall through */ 94 /* fall through */
95 case ST_USERDIR: 95 case ST_USERDIR:
96 if (be32_to_cpu(tail->stype) == ST_USERDIR || 96 if (be32_to_cpu(tail->stype) == ST_USERDIR ||
97 sbi->s_flags & AFFS_MOUNT_SF_SETMODE) { 97 affs_test_opt(sbi->s_flags, SF_SETMODE)) {
98 if (inode->i_mode & S_IRUSR) 98 if (inode->i_mode & S_IRUSR)
99 inode->i_mode |= S_IXUSR; 99 inode->i_mode |= S_IXUSR;
100 if (inode->i_mode & S_IRGRP) 100 if (inode->i_mode & S_IRGRP)
@@ -133,7 +133,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
133 } 133 }
134 if (tail->link_chain) 134 if (tail->link_chain)
135 set_nlink(inode, 2); 135 set_nlink(inode, 2);
136 inode->i_mapping->a_ops = (sbi->s_flags & AFFS_MOUNT_SF_OFS) ? 136 inode->i_mapping->a_ops = affs_test_opt(sbi->s_flags, SF_OFS) ?
137 &affs_aops_ofs : &affs_aops; 137 &affs_aops_ofs : &affs_aops;
138 inode->i_op = &affs_file_inode_operations; 138 inode->i_op = &affs_file_inode_operations;
139 inode->i_fop = &affs_file_operations; 139 inode->i_fop = &affs_file_operations;
@@ -191,15 +191,15 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc)
191 if (!(inode->i_ino == AFFS_SB(sb)->s_root_block)) { 191 if (!(inode->i_ino == AFFS_SB(sb)->s_root_block)) {
192 uid = i_uid_read(inode); 192 uid = i_uid_read(inode);
193 gid = i_gid_read(inode); 193 gid = i_gid_read(inode);
194 if (AFFS_SB(sb)->s_flags & AFFS_MOUNT_SF_MUFS) { 194 if (affs_test_opt(AFFS_SB(sb)->s_flags, SF_MUFS)) {
195 if (uid == 0 || uid == 0xFFFF) 195 if (uid == 0 || uid == 0xFFFF)
196 uid = uid ^ ~0; 196 uid = uid ^ ~0;
197 if (gid == 0 || gid == 0xFFFF) 197 if (gid == 0 || gid == 0xFFFF)
198 gid = gid ^ ~0; 198 gid = gid ^ ~0;
199 } 199 }
200 if (!(AFFS_SB(sb)->s_flags & AFFS_MOUNT_SF_SETUID)) 200 if (!affs_test_opt(AFFS_SB(sb)->s_flags, SF_SETUID))
201 tail->uid = cpu_to_be16(uid); 201 tail->uid = cpu_to_be16(uid);
202 if (!(AFFS_SB(sb)->s_flags & AFFS_MOUNT_SF_SETGID)) 202 if (!affs_test_opt(AFFS_SB(sb)->s_flags, SF_SETGID))
203 tail->gid = cpu_to_be16(gid); 203 tail->gid = cpu_to_be16(gid);
204 } 204 }
205 } 205 }
@@ -223,13 +223,13 @@ affs_notify_change(struct dentry *dentry, struct iattr *attr)
223 goto out; 223 goto out;
224 224
225 if (((attr->ia_valid & ATTR_UID) && 225 if (((attr->ia_valid & ATTR_UID) &&
226 (AFFS_SB(inode->i_sb)->s_flags & AFFS_MOUNT_SF_SETUID)) || 226 affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_SETUID)) ||
227 ((attr->ia_valid & ATTR_GID) && 227 ((attr->ia_valid & ATTR_GID) &&
228 (AFFS_SB(inode->i_sb)->s_flags & AFFS_MOUNT_SF_SETGID)) || 228 affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_SETGID)) ||
229 ((attr->ia_valid & ATTR_MODE) && 229 ((attr->ia_valid & ATTR_MODE) &&
230 (AFFS_SB(inode->i_sb)->s_flags & 230 (AFFS_SB(inode->i_sb)->s_flags &
231 (AFFS_MOUNT_SF_SETMODE | AFFS_MOUNT_SF_IMMUTABLE)))) { 231 (AFFS_MOUNT_SF_SETMODE | AFFS_MOUNT_SF_IMMUTABLE)))) {
232 if (!(AFFS_SB(inode->i_sb)->s_flags & AFFS_MOUNT_SF_QUIET)) 232 if (!affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_QUIET))
233 error = -EPERM; 233 error = -EPERM;
234 goto out; 234 goto out;
235 } 235 }