summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.c
diff options
context:
space:
mode:
authorDaniel Dressler <danieru.dressler@gmail.com>2014-11-17 08:05:02 -0500
committerDavid Sterba <dsterba@suse.cz>2015-02-16 12:48:43 -0500
commita585e94895ed8ab2930bfd5186ffd20301b5c703 (patch)
tree53842375f91d00fd21ad6a4b088637a444615472 /fs/btrfs/delayed-inode.c
parentb7a0365ec7a0fb1d39113846fd34038af68ebd01 (diff)
Btrfs: delayed-inode: replace root args iff only fs_info used
This is the second independent patch of a larger project to cleanup btrfs's internal usage of btrfs_root. Many functions take btrfs_root only to grab the fs_info struct. By requiring a root these functions cause programmer overhead. That these functions can accept any valid root is not obvious until inspection. This patch reduces the specificity of such functions to accept the fs_info directly. These patches can be applied independently and thus are not being submitted as a patch series. There should be about 26 patches by the project's completion. Each patch will cleanup between 1 and 34 functions apiece. Each patch covers a single file's functions. This patch affects the following function(s): 1) btrfs_wq_run_delayed_node Signed-off-by: Daniel Dressler <danieru.dressler@gmail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r--fs/btrfs/delayed-inode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 82f0c7c95474..cde698a07d21 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1383,7 +1383,7 @@ out:
1383 1383
1384 1384
1385static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root, 1385static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root,
1386 struct btrfs_root *root, int nr) 1386 struct btrfs_fs_info *fs_info, int nr)
1387{ 1387{
1388 struct btrfs_async_delayed_work *async_work; 1388 struct btrfs_async_delayed_work *async_work;
1389 1389
@@ -1399,7 +1399,7 @@ static int btrfs_wq_run_delayed_node(struct btrfs_delayed_root *delayed_root,
1399 btrfs_async_run_delayed_root, NULL, NULL); 1399 btrfs_async_run_delayed_root, NULL, NULL);
1400 async_work->nr = nr; 1400 async_work->nr = nr;
1401 1401
1402 btrfs_queue_work(root->fs_info->delayed_workers, &async_work->work); 1402 btrfs_queue_work(fs_info->delayed_workers, &async_work->work);
1403 return 0; 1403 return 0;
1404} 1404}
1405 1405
@@ -1426,6 +1426,7 @@ static int could_end_wait(struct btrfs_delayed_root *delayed_root, int seq)
1426void btrfs_balance_delayed_items(struct btrfs_root *root) 1426void btrfs_balance_delayed_items(struct btrfs_root *root)
1427{ 1427{
1428 struct btrfs_delayed_root *delayed_root; 1428 struct btrfs_delayed_root *delayed_root;
1429 struct btrfs_fs_info *fs_info = root->fs_info;
1429 1430
1430 delayed_root = btrfs_get_delayed_root(root); 1431 delayed_root = btrfs_get_delayed_root(root);
1431 1432
@@ -1438,7 +1439,7 @@ void btrfs_balance_delayed_items(struct btrfs_root *root)
1438 1439
1439 seq = atomic_read(&delayed_root->items_seq); 1440 seq = atomic_read(&delayed_root->items_seq);
1440 1441
1441 ret = btrfs_wq_run_delayed_node(delayed_root, root, 0); 1442 ret = btrfs_wq_run_delayed_node(delayed_root, fs_info, 0);
1442 if (ret) 1443 if (ret)
1443 return; 1444 return;
1444 1445
@@ -1447,7 +1448,7 @@ void btrfs_balance_delayed_items(struct btrfs_root *root)
1447 return; 1448 return;
1448 } 1449 }
1449 1450
1450 btrfs_wq_run_delayed_node(delayed_root, root, BTRFS_DELAYED_BATCH); 1451 btrfs_wq_run_delayed_node(delayed_root, fs_info, BTRFS_DELAYED_BATCH);
1451} 1452}
1452 1453
1453/* Will return 0 or -ENOMEM */ 1454/* Will return 0 or -ENOMEM */