diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-15 15:08:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-02 19:49:28 -0400 |
commit | 9902af79c01a8e39bb99b922fa3eef6d4ea23d69 (patch) | |
tree | b04cc75b5e4a028bfdb619e0a0a0f8cd71113ff2 /fs/btrfs/ioctl.c | |
parent | d9171b9345261e0d941d92fdda5672b5db67f968 (diff) |
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>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5a23806ae418..0b8ba717175b 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -837,9 +837,11 @@ static noinline int btrfs_mksubvol(struct path *parent, | |||
837 | struct dentry *dentry; | 837 | struct dentry *dentry; |
838 | int error; | 838 | int error; |
839 | 839 | ||
840 | error = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT); | 840 | inode_lock_nested(dir, I_MUTEX_PARENT); |
841 | if (error == -EINTR) | 841 | // XXX: should've been |
842 | return error; | 842 | // mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT); |
843 | // if (error == -EINTR) | ||
844 | // return error; | ||
843 | 845 | ||
844 | dentry = lookup_one_len(name, parent->dentry, namelen); | 846 | dentry = lookup_one_len(name, parent->dentry, namelen); |
845 | error = PTR_ERR(dentry); | 847 | error = PTR_ERR(dentry); |
@@ -2366,9 +2368,11 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, | |||
2366 | goto out; | 2368 | goto out; |
2367 | 2369 | ||
2368 | 2370 | ||
2369 | err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT); | 2371 | inode_lock_nested(dir, I_MUTEX_PARENT); |
2370 | if (err == -EINTR) | 2372 | // XXX: should've been |
2371 | goto out_drop_write; | 2373 | // err = mutex_lock_killable_nested(&dir->i_mutex, I_MUTEX_PARENT); |
2374 | // if (err == -EINTR) | ||
2375 | // goto out_drop_write; | ||
2372 | dentry = lookup_one_len(vol_args->name, parent, namelen); | 2376 | dentry = lookup_one_len(vol_args->name, parent, namelen); |
2373 | if (IS_ERR(dentry)) { | 2377 | if (IS_ERR(dentry)) { |
2374 | err = PTR_ERR(dentry); | 2378 | err = PTR_ERR(dentry); |
@@ -2558,7 +2562,7 @@ out_dput: | |||
2558 | dput(dentry); | 2562 | dput(dentry); |
2559 | out_unlock_dir: | 2563 | out_unlock_dir: |
2560 | inode_unlock(dir); | 2564 | inode_unlock(dir); |
2561 | out_drop_write: | 2565 | //out_drop_write: |
2562 | mnt_drop_write_file(file); | 2566 | mnt_drop_write_file(file); |
2563 | out: | 2567 | out: |
2564 | kfree(vol_args); | 2568 | kfree(vol_args); |