[GFS2] Remove gfs2_repermission
gfs2_repermission is just a wrapper for permission, so remove it and call permission directly where required. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
parent
d9d1ca3050
commit
faf450ef4a
|
@ -179,9 +179,7 @@ int gfs2_check_acl(struct inode *inode, int mask)
|
||||||
struct gfs2_holder i_gh;
|
struct gfs2_holder i_gh;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = gfs2_glock_nq_init(ip->i_gl,
|
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
|
||||||
LM_ST_SHARED, LM_FLAG_ANY,
|
|
||||||
&i_gh);
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = gfs2_check_acl_locked(inode, mask);
|
error = gfs2_check_acl_locked(inode, mask);
|
||||||
gfs2_glock_dq_uninit(&i_gh);
|
gfs2_glock_dq_uninit(&i_gh);
|
||||||
|
|
|
@ -420,7 +420,7 @@ struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name,
|
||||||
return ERR_PTR(error);
|
return ERR_PTR(error);
|
||||||
|
|
||||||
if (!is_root) {
|
if (!is_root) {
|
||||||
error = gfs2_repermission(dir, MAY_EXEC, NULL);
|
error = permission(dir, MAY_EXEC, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -571,7 +571,7 @@ static int create_ok(struct gfs2_inode *dip, const struct qstr *name,
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = gfs2_repermission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL);
|
error = permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -1003,7 +1003,7 @@ int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
|
||||||
if (IS_APPEND(&dip->i_inode))
|
if (IS_APPEND(&dip->i_inode))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
error = gfs2_repermission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL);
|
error = permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -1356,8 +1356,3 @@ int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gfs2_repermission(struct inode *inode, int mask, struct nameidata *nd)
|
|
||||||
{
|
|
||||||
return permission(inode, mask, nd);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,6 @@ int gfs2_glock_nq_m_atime(unsigned int num_gh, struct gfs2_holder *ghs);
|
||||||
|
|
||||||
int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr);
|
int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr);
|
||||||
|
|
||||||
int gfs2_repermission(struct inode *inode, int mask, struct nameidata *nd);
|
|
||||||
|
|
||||||
struct inode *gfs2_lookup_simple(struct inode *dip, const char *name);
|
struct inode *gfs2_lookup_simple(struct inode *dip, const char *name);
|
||||||
|
|
||||||
#endif /* __INODE_DOT_H__ */
|
#endif /* __INODE_DOT_H__ */
|
||||||
|
|
|
@ -640,7 +640,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
|
||||||
!capable(CAP_LINUX_IMMUTABLE))
|
!capable(CAP_LINUX_IMMUTABLE))
|
||||||
goto out;
|
goto out;
|
||||||
if (!IS_IMMUTABLE(inode)) {
|
if (!IS_IMMUTABLE(inode)) {
|
||||||
error = gfs2_repermission(inode, MAY_WRITE, NULL);
|
error = permission(inode, MAY_WRITE, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
error = gfs2_repermission(dir, MAY_WRITE | MAY_EXEC, NULL);
|
error = permission(dir, MAY_WRITE | MAY_EXEC, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_gunlock;
|
goto out_gunlock;
|
||||||
|
|
||||||
|
@ -659,7 +659,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error = gfs2_repermission(ndir, MAY_WRITE | MAY_EXEC, NULL);
|
error = permission(ndir, MAY_WRITE | MAY_EXEC, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_gunlock;
|
goto out_gunlock;
|
||||||
|
|
||||||
|
@ -694,7 +694,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
|
||||||
/* Check out the dir to be renamed */
|
/* Check out the dir to be renamed */
|
||||||
|
|
||||||
if (dir_rename) {
|
if (dir_rename) {
|
||||||
error = gfs2_repermission(odentry->d_inode, MAY_WRITE, NULL);
|
error = permission(odentry->d_inode, MAY_WRITE, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_gunlock;
|
goto out_gunlock;
|
||||||
}
|
}
|
||||||
|
@ -888,9 +888,7 @@ static int gfs2_permission(struct inode *inode, int mask, struct nameidata *nd)
|
||||||
if (ip->i_vn == ip->i_gl->gl_vn)
|
if (ip->i_vn == ip->i_gl->gl_vn)
|
||||||
return generic_permission(inode, mask, gfs2_check_acl);
|
return generic_permission(inode, mask, gfs2_check_acl);
|
||||||
|
|
||||||
error = gfs2_glock_nq_init(ip->i_gl,
|
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
|
||||||
LM_ST_SHARED, LM_FLAG_ANY,
|
|
||||||
&i_gh);
|
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = generic_permission(inode, mask, gfs2_check_acl_locked);
|
error = generic_permission(inode, mask, gfs2_check_acl_locked);
|
||||||
gfs2_glock_dq_uninit(&i_gh);
|
gfs2_glock_dq_uninit(&i_gh);
|
||||||
|
|
Loading…
Reference in New Issue