From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 07/10] btrfs: move btrfs_zoned_data_reloc_*lock to extent_io.c
Date: Wed, 14 Sep 2022 19:07:47 -0400 [thread overview]
Message-ID: <9ff2cb480bba029fb169a15919bf96a87b37a919.1663196746.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1663196746.git.josef@toxicpanda.com>
These functions are only used to protect io in extent_io.c, move them
from zoned.h locally in extent_io.c. These helpers use code not defined
in zoned.h, this cleans up the header file.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
fs/btrfs/extent_io.c | 16 ++++++++++++++++
fs/btrfs/zoned.h | 16 ----------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 18b60304c97a..13c8ed8cbfc8 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3301,6 +3301,22 @@ int extent_write_locked_range(struct inode *inode, u64 start, u64 end)
return ret;
}
+static inline void btrfs_zoned_data_reloc_lock(struct btrfs_inode *inode)
+{
+ struct btrfs_root *root = inode->root;
+
+ if (btrfs_is_data_reloc_root(root) && btrfs_is_zoned(root->fs_info))
+ mutex_lock(&root->fs_info->zoned_data_reloc_io_lock);
+}
+
+static inline void btrfs_zoned_data_reloc_unlock(struct btrfs_inode *inode)
+{
+ struct btrfs_root *root = inode->root;
+
+ if (btrfs_is_data_reloc_root(root) && btrfs_is_zoned(root->fs_info))
+ mutex_unlock(&root->fs_info->zoned_data_reloc_io_lock);
+}
+
int extent_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{
diff --git a/fs/btrfs/zoned.h b/fs/btrfs/zoned.h
index bd2b3fee4f2d..de1337e462be 100644
--- a/fs/btrfs/zoned.h
+++ b/fs/btrfs/zoned.h
@@ -313,22 +313,6 @@ static inline void btrfs_dev_clear_zone_empty(struct btrfs_device *device, u64 p
btrfs_dev_set_empty_zone_bit(device, pos, false);
}
-static inline void btrfs_zoned_data_reloc_lock(struct btrfs_inode *inode)
-{
- struct btrfs_root *root = inode->root;
-
- if (btrfs_is_data_reloc_root(root) && btrfs_is_zoned(root->fs_info))
- mutex_lock(&root->fs_info->zoned_data_reloc_io_lock);
-}
-
-static inline void btrfs_zoned_data_reloc_unlock(struct btrfs_inode *inode)
-{
- struct btrfs_root *root = inode->root;
-
- if (btrfs_is_data_reloc_root(root) && btrfs_is_zoned(root->fs_info))
- mutex_unlock(&root->fs_info->zoned_data_reloc_io_lock);
-}
-
static inline bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
{
ASSERT(btrfs_is_zoned(bg->fs_info));
--
2.26.3
next prev parent reply other threads:[~2022-09-14 23:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 23:07 [PATCH 00/10] btrfs: clean up zoned device helpers Josef Bacik
2022-09-14 23:07 ` [PATCH 01/10] btrfs: add a helper for opening a new device to add to the fs Josef Bacik
2022-09-15 13:54 ` Johannes Thumshirn
2022-09-21 9:39 ` Pankaj Raghav
2022-09-14 23:07 ` [PATCH 02/10] btrfs: move btrfs_check_device_zone_type into volumes.c Josef Bacik
2022-09-15 13:55 ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 03/10] btrfs: move btrfs_can_zone_reset into extent-tree.c Josef Bacik
2022-09-15 13:56 ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 04/10] btrfs: move btrfs_check_super_location into scrub.c Josef Bacik
2022-09-15 13:57 ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 05/10] btrfs: move btrfs_zoned_meta_io_*lock to extent_io.c Josef Bacik
2022-09-15 13:58 ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 06/10] btrfs: move btrfs_clear_treelog_bg to extent-tree.c Josef Bacik
2022-09-15 14:00 ` Johannes Thumshirn
2022-09-14 23:07 ` Josef Bacik [this message]
2022-09-15 14:01 ` [PATCH 07/10] btrfs: move btrfs_zoned_data_reloc_*lock to extent_io.c Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 08/10] btrfs: move btrfs_zoned_bg_is_full into block-group.c Josef Bacik
2022-09-15 14:02 ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 09/10] btrfs: make the zoned helpers take btrfs_zoned_device_info Josef Bacik
2022-09-15 14:05 ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 10/10] btrfs: delete btrfs_check_super_location helper Josef Bacik
2022-09-15 7:29 ` Naohiro Aota
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=9ff2cb480bba029fb169a15919bf96a87b37a919.1663196746.git.josef@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=kernel-team@fb.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