summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-05-23 14:37:47 -0400
committerChris Mason <chris.mason@oracle.com>2011-05-23 14:37:47 -0400
commitd6c0cb379c5198487e4ac124728cbb2346d63b1f (patch)
tree167a97ac58c7a2fbf7c4e94b6abbfe1e03af014a /fs/btrfs/ioctl.c
parent8e531cdfeb75269c6c5aae33651cca39707848da (diff)
parent1f78160ce1b1b8e657e2248118c4d91f881763f0 (diff)
downloadop-kernel-dev-d6c0cb379c5198487e4ac124728cbb2346d63b1f.zip
op-kernel-dev-d6c0cb379c5198487e4ac124728cbb2346d63b1f.tar.gz
Merge branch 'cleanups_and_fixes' into inode_numbers
Conflicts: fs/btrfs/tree-log.c fs/btrfs/volumes.c Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index e0a061d..c4f17e4 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -282,8 +282,9 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- mutex_lock(&fs_info->fs_devices->device_list_mutex);
- list_for_each_entry(device, &fs_info->fs_devices->devices, dev_list) {
+ rcu_read_lock();
+ list_for_each_entry_rcu(device, &fs_info->fs_devices->devices,
+ dev_list) {
if (!device->bdev)
continue;
q = bdev_get_queue(device->bdev);
@@ -293,7 +294,7 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
minlen);
}
}
- mutex_unlock(&fs_info->fs_devices->device_list_mutex);
+ rcu_read_unlock();
if (!num_devices)
return -EOPNOTSUPP;
@@ -1279,7 +1280,6 @@ static noinline int copy_to_sk(struct btrfs_root *root,
int nritems;
int i;
int slot;
- int found = 0;
int ret = 0;
leaf = path->nodes[0];
@@ -1326,7 +1326,7 @@ static noinline int copy_to_sk(struct btrfs_root *root,
item_off, item_len);
*sk_offset += item_len;
}
- found++;
+ (*num_found)++;
if (*num_found >= sk->nr_items)
break;
@@ -1345,7 +1345,6 @@ advance_key:
} else
ret = 1;
overflow:
- *num_found += found;
return ret;
}
OpenPOWER on IntegriCloud