parallel lookups: actual switch to rwsem

ta-da!

The main issue is the lack of down_write_killable(), so the places
like readdir.c switched to plain inode_lock(); once killable
variants of rwsem primitives appear, that'll be dealt with.

lockdep side also might need more work

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2016-04-15 15:08:36 -04:00
parent d9171b9345
commit 9902af79c0
11 changed files with 73 additions and 32 deletions

View File

@@ -837,9 +837,11 @@ static noinline int btrfs_mksubvol(struct path *parent,
struct dentry *dentry;
int error;
error = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
if (error == -EINTR)
return error;
inode_lock_nested(dir, I_MUTEX_PARENT);
// XXX: should've been
// mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
// if (error == -EINTR)
// return error;
dentry = lookup_one_len(name, parent->dentry, namelen);
error = PTR_ERR(dentry);
@@ -2366,9 +2368,11 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
goto out;
err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
if (err == -EINTR)
goto out_drop_write;
inode_lock_nested(dir, I_MUTEX_PARENT);
// XXX: should've been
// err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT);
// if (err == -EINTR)
// goto out_drop_write;
dentry = lookup_one_len(vol_args->name, parent, namelen);
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
@@ -2558,7 +2562,7 @@ out_dput:
dput(dentry);
out_unlock_dir:
inode_unlock(dir);
out_drop_write:
//out_drop_write:
mnt_drop_write_file(file);
out:
kfree(vol_args);