aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/acl.c4
-rw-r--r--fs/gfs2/inode.c11
-rw-r--r--fs/gfs2/inode.h2
-rw-r--r--fs/gfs2/ops_file.c2
-rw-r--r--fs/gfs2/ops_inode.c10
5 files changed, 9 insertions, 20 deletions
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 9ef4cf2c03db..399317841501 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -179,9 +179,7 @@ int gfs2_check_acl(struct inode *inode, int mask)
179 struct gfs2_holder i_gh; 179 struct gfs2_holder i_gh;
180 int error; 180 int error;
181 181
182 error = gfs2_glock_nq_init(ip->i_gl, 182 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
183 LM_ST_SHARED, LM_FLAG_ANY,
184 &i_gh);
185 if (!error) { 183 if (!error) {
186 error = gfs2_check_acl_locked(inode, mask); 184 error = gfs2_check_acl_locked(inode, mask);
187 gfs2_glock_dq_uninit(&i_gh); 185 gfs2_glock_dq_uninit(&i_gh);
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 4e9c42119aed..c19feb9697b0 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -420,7 +420,7 @@ struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name,
420 return ERR_PTR(error); 420 return ERR_PTR(error);
421 421
422 if (!is_root) { 422 if (!is_root) {
423 error = gfs2_repermission(dir, MAY_EXEC, NULL); 423 error = permission(dir, MAY_EXEC, NULL);
424 if (error) 424 if (error)
425 goto out; 425 goto out;
426 } 426 }
@@ -571,7 +571,7 @@ static int create_ok(struct gfs2_inode *dip, const struct qstr *name,
571{ 571{
572 int error; 572 int error;
573 573
574 error = gfs2_repermission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL); 574 error = permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL);
575 if (error) 575 if (error)
576 return error; 576 return error;
577 577
@@ -1003,7 +1003,7 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
1003 if (IS_APPEND(&dip->i_inode)) 1003 if (IS_APPEND(&dip->i_inode))
1004 return -EPERM; 1004 return -EPERM;
1005 1005
1006 error = gfs2_repermission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL); 1006 error = permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL);
1007 if (error) 1007 if (error)
1008 return error; 1008 return error;
1009 1009
@@ -1356,8 +1356,3 @@ int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
1356 return error; 1356 return error;
1357} 1357}
1358 1358
1359int gfs2_repermission(struct inode *inode, int mask, struct nameidata *nd)
1360{
1361 return permission(inode, mask, nd);
1362}
1363
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h
index 30cfcc10beb2..8bb8b559bcea 100644
--- a/fs/gfs2/inode.h
+++ b/fs/gfs2/inode.h
@@ -50,8 +50,6 @@ int gfs2_glock_nq_m_atime(unsigned int num_gh, struct gfs2_holder *ghs);
50 50
51int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr); 51int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr);
52 52
53int gfs2_repermission(struct inode *inode, int mask, struct nameidata *nd);
54
55struct inode *gfs2_lookup_simple(struct inode *dip, const char *name); 53struct inode *gfs2_lookup_simple(struct inode *dip, const char *name);
56 54
57#endif /* __INODE_DOT_H__ */ 55#endif /* __INODE_DOT_H__ */
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 222f3be3e06e..5e754198f5bb 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -640,7 +640,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
640 !capable(CAP_LINUX_IMMUTABLE)) 640 !capable(CAP_LINUX_IMMUTABLE))
641 goto out; 641 goto out;
642 if (!IS_IMMUTABLE(inode)) { 642 if (!IS_IMMUTABLE(inode)) {
643 error = gfs2_repermission(inode, MAY_WRITE, NULL); 643 error = permission(inode, MAY_WRITE, NULL);
644 if (error) 644 if (error)
645 goto out; 645 goto out;
646 } 646 }
diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c
index 3a2769ebfe4a..5d5ebbcba534 100644
--- a/fs/gfs2/ops_inode.c
+++ b/fs/gfs2/ops_inode.c
@@ -155,7 +155,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
155 if (error) 155 if (error)
156 goto out; 156 goto out;
157 157
158 error = gfs2_repermission(dir, MAY_WRITE | MAY_EXEC, NULL); 158 error = permission(dir, MAY_WRITE | MAY_EXEC, NULL);
159 if (error) 159 if (error)
160 goto out_gunlock; 160 goto out_gunlock;
161 161
@@ -659,7 +659,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
659 } 659 }
660 } 660 }
661 } else { 661 } else {
662 error = gfs2_repermission(ndir, MAY_WRITE | MAY_EXEC, NULL); 662 error = permission(ndir, MAY_WRITE | MAY_EXEC, NULL);
663 if (error) 663 if (error)
664 goto out_gunlock; 664 goto out_gunlock;
665 665
@@ -694,7 +694,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
694 /* Check out the dir to be renamed */ 694 /* Check out the dir to be renamed */
695 695
696 if (dir_rename) { 696 if (dir_rename) {
697 error = gfs2_repermission(odentry->d_inode, MAY_WRITE, NULL); 697 error = permission(odentry->d_inode, MAY_WRITE, NULL);
698 if (error) 698 if (error)
699 goto out_gunlock; 699 goto out_gunlock;
700 } 700 }
@@ -888,9 +888,7 @@ static int gfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
888 if (ip->i_vn == ip->i_gl->gl_vn) 888 if (ip->i_vn == ip->i_gl->gl_vn)
889 return generic_permission(inode, mask, gfs2_check_acl); 889 return generic_permission(inode, mask, gfs2_check_acl);
890 890
891 error = gfs2_glock_nq_init(ip->i_gl, 891 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
892 LM_ST_SHARED, LM_FLAG_ANY,
893 &i_gh);
894 if (!error) { 892 if (!error) {
895 error = generic_permission(inode, mask, gfs2_check_acl_locked); 893 error = generic_permission(inode, mask, gfs2_check_acl_locked);
896 gfs2_glock_dq_uninit(&i_gh); 894 gfs2_glock_dq_uninit(&i_gh);