From: jeffm@suse.com
To: linux-btrfs@vger.kernel.org
Cc: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH 3/8] btrfs: convert btrfs_inc_block_group_ro to accept fs_info
Date: Wed, 15 Feb 2017 16:28:29 -0500 [thread overview]
Message-ID: <1487194114-12786-4-git-send-email-jeffm@suse.com> (raw)
In-Reply-To: <1487194114-12786-1-git-send-email-jeffm@suse.com>
From: Jeff Mahoney <jeffm@suse.com>
btrfs_inc_block_group_ro is either passed the extent root or the dev
root, but it doesn't do anything with the dev tree. Let's convert
to passing an fs_info and using the extent root.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/extent-tree.c | 5 ++---
fs/btrfs/relocation.c | 2 +-
fs/btrfs/scrub.c | 2 +-
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 6a82371..49f520c 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2724,7 +2724,7 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
struct btrfs_block_rsv *block_rsv,
u64 num_bytes);
-int btrfs_inc_block_group_ro(struct btrfs_root *root,
+int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache *cache);
void btrfs_dec_block_group_ro(struct btrfs_block_group_cache *cache);
void btrfs_put_block_group_cache(struct btrfs_fs_info *info);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b005378..20bedc7 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -9363,17 +9363,16 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)
return ret;
}
-int btrfs_inc_block_group_ro(struct btrfs_root *root,
+int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache *cache)
{
- struct btrfs_fs_info *fs_info = root->fs_info;
struct btrfs_trans_handle *trans;
u64 alloc_flags;
int ret;
again:
- trans = btrfs_join_transaction(root);
+ trans = btrfs_join_transaction(fs_info->extent_root);
if (IS_ERR(trans))
return PTR_ERR(trans);
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 3797110..2e9deb9 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4334,7 +4334,7 @@ int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start)
rc->block_group = btrfs_lookup_block_group(fs_info, group_start);
BUG_ON(!rc->block_group);
- ret = btrfs_inc_block_group_ro(extent_root, rc->block_group);
+ ret = btrfs_inc_block_group_ro(fs_info, rc->block_group);
if (ret) {
err = ret;
goto out;
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 9a94670..3a9607dc 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3584,7 +3584,7 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
* -> btrfs_scrub_pause()
*/
scrub_pause_on(fs_info);
- ret = btrfs_inc_block_group_ro(root, cache);
+ ret = btrfs_inc_block_group_ro(fs_info, cache);
if (!ret && is_dev_replace) {
/*
* If we are doing a device replace wait for any tasks
--
2.7.1
next prev parent reply other threads:[~2017-02-15 21:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 21:28 [PATCH 0/8] btrfs: cleanup patches jeffm
2017-02-15 21:28 ` [PATCH 1/8] btrfs: pass fs_info to (more) routines that are only called with extent_root jeffm
2017-02-15 21:28 ` [PATCH 2/8] btrfs: flush_space always takes fs_info->fs_root jeffm
2017-02-15 21:28 ` jeffm [this message]
2017-02-15 21:28 ` [PATCH 4/8] btrfs: free-space-cache, clean up unnecessary root arguments jeffm
2017-02-15 22:06 ` Jeff Mahoney
2017-02-15 21:28 ` [PATCH 5/8] btrfs: btrfs_wait_cache_io_root doesn't use path argument jeffm
2017-02-15 22:04 ` Jeff Mahoney
2017-02-15 21:28 ` [PATCH 6/8] btrfs: btrfs_truncate_free_space_cache always allocates path jeffm
2017-02-15 21:28 ` [PATCH 7/8] btrfs: drop unused extent_op arg from btrfs_add_delayed_data_ref jeffm
2017-02-15 21:28 ` [PATCH 8/8] btrfs: use btrfs_debug instead of pr_debug in transaction abort jeffm
2017-02-16 16:41 ` [PATCH 0/8] btrfs: cleanup patches David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487194114-12786-4-git-send-email-jeffm@suse.com \
--to=jeffm@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).