summaryrefslogtreecommitdiff
path: root/volumes.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2018-01-03 15:13:04 +0800
committerDavid Sterba <dsterba@suse.com>2018-01-31 15:14:02 +0100
commita784003783eb836dba66ac74785012a6c633daef (patch)
tree47dc2ae5c9c15141fca153fd28cfd9e6b1b69cba /volumes.c
parent1c9b58256aeda3dcdbaa7003f370ddffeecbf132 (diff)
btrfs-progs: volumes: Remove unnecessary trans parameter
Remove @trans parameter for find_free_dev_extent_start() and its callers. The function itself is doing read-only tree search, no use of transaction. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/volumes.c b/volumes.c
index 1fda594..a9ce0bf 100644
--- a/volumes.c
+++ b/volumes.c
@@ -309,9 +309,9 @@ int btrfs_scan_one_device(int fd, const char *path,
* But if we don't find suitable free space, it is used to store the size of
* the max free space.
*/
-static int find_free_dev_extent_start(struct btrfs_trans_handle *trans,
- struct btrfs_device *device, u64 num_bytes,
- u64 search_start, u64 *start, u64 *len)
+static int find_free_dev_extent_start(struct btrfs_device *device,
+ u64 num_bytes, u64 search_start,
+ u64 *start, u64 *len)
{
struct btrfs_key key;
struct btrfs_root *root = device->dev_root;
@@ -450,13 +450,11 @@ out:
return ret;
}
-static int find_free_dev_extent(struct btrfs_trans_handle *trans,
- struct btrfs_device *device, u64 num_bytes,
- u64 *start)
+static int find_free_dev_extent(struct btrfs_device *device, u64 num_bytes,
+ u64 *start)
{
/* FIXME use last free of some kind */
- return find_free_dev_extent_start(trans, device,
- num_bytes, 0, start, NULL);
+ return find_free_dev_extent_start(device, num_bytes, 0, start, NULL);
}
static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
@@ -481,8 +479,7 @@ static int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
* is responsible to make sure it's free.
*/
if (!convert) {
- ret = find_free_dev_extent(trans, device, num_bytes,
- start);
+ ret = find_free_dev_extent(device, num_bytes, start);
if (ret)
goto err;
}