Merge branch 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin
* 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin: (57 commits) fs: scale mntget/mntput fs: rename vfsmount counter helpers fs: implement faster dentry memcmp fs: prefetch inode data in dcache lookup fs: improve scalability of pseudo filesystems fs: dcache per-inode inode alias locking fs: dcache per-bucket dcache hash locking bit_spinlock: add required includes kernel: add bl_list xfs: provide simple rcu-walk ACL implementation btrfs: provide simple rcu-walk ACL implementation ext2,3,4: provide simple rcu-walk ACL implementation fs: provide simple rcu-walk generic_check_acl implementation fs: provide rcu-walk aware permission i_ops fs: rcu-walk aware d_revalidate method fs: cache optimise dentry and inode for rcu-walk fs: dcache reduce branches in lookup path fs: dcache remove d_mounted fs: fs_struct use seqlock fs: rcu-walk for path lookup ...
This commit is contained in:
@@ -106,7 +106,7 @@ static struct dentry *gfs2_lookup(struct inode *dir, struct dentry *dentry,
|
||||
{
|
||||
struct inode *inode = NULL;
|
||||
|
||||
dentry->d_op = &gfs2_dops;
|
||||
d_set_d_op(dentry, &gfs2_dops);
|
||||
|
||||
inode = gfs2_lookupi(dir, &dentry->d_name, 0);
|
||||
if (inode && IS_ERR(inode))
|
||||
@@ -166,7 +166,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
|
||||
if (error)
|
||||
goto out_child;
|
||||
|
||||
error = gfs2_permission(dir, MAY_WRITE | MAY_EXEC);
|
||||
error = gfs2_permission(dir, MAY_WRITE | MAY_EXEC, 0);
|
||||
if (error)
|
||||
goto out_gunlock;
|
||||
|
||||
@@ -289,7 +289,7 @@ static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
|
||||
if (IS_APPEND(&dip->i_inode))
|
||||
return -EPERM;
|
||||
|
||||
error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC);
|
||||
error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, 0);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -822,7 +822,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
error = gfs2_permission(ndir, MAY_WRITE | MAY_EXEC);
|
||||
error = gfs2_permission(ndir, MAY_WRITE | MAY_EXEC, 0);
|
||||
if (error)
|
||||
goto out_gunlock;
|
||||
|
||||
@@ -857,7 +857,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
|
||||
/* Check out the dir to be renamed */
|
||||
|
||||
if (dir_rename) {
|
||||
error = gfs2_permission(odentry->d_inode, MAY_WRITE);
|
||||
error = gfs2_permission(odentry->d_inode, MAY_WRITE, 0);
|
||||
if (error)
|
||||
goto out_gunlock;
|
||||
}
|
||||
@@ -1041,13 +1041,17 @@ static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
|
||||
* Returns: errno
|
||||
*/
|
||||
|
||||
int gfs2_permission(struct inode *inode, int mask)
|
||||
int gfs2_permission(struct inode *inode, int mask, unsigned int flags)
|
||||
{
|
||||
struct gfs2_inode *ip = GFS2_I(inode);
|
||||
struct gfs2_inode *ip;
|
||||
struct gfs2_holder i_gh;
|
||||
int error;
|
||||
int unlock = 0;
|
||||
|
||||
if (flags & IPERM_FLAG_RCU)
|
||||
return -ECHILD;
|
||||
|
||||
ip = GFS2_I(inode);
|
||||
if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) {
|
||||
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
|
||||
if (error)
|
||||
@@ -1058,7 +1062,7 @@ int gfs2_permission(struct inode *inode, int mask)
|
||||
if ((mask & MAY_WRITE) && IS_IMMUTABLE(inode))
|
||||
error = -EACCES;
|
||||
else
|
||||
error = generic_permission(inode, mask, gfs2_check_acl);
|
||||
error = generic_permission(inode, mask, flags, gfs2_check_acl);
|
||||
if (unlock)
|
||||
gfs2_glock_dq_uninit(&i_gh);
|
||||
|
||||
|
Reference in New Issue
Block a user