From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: josef@toxicpanda.com
Subject: [PATCH 1/5] btrfs: make btrfs_extent_readonly() static
Date: Wed, 10 Feb 2021 21:25:15 -0800 [thread overview]
Message-ID: <91acc559ac0f1deee28410bb379b2a248c2b5204.1613019838.git.anand.jain@oracle.com> (raw)
In-Reply-To: <cover.1613019838.git.anand.jain@oracle.com>
btrfs_extent_readonly() is used by can_nocow_extent() in inode.c. So move
btrfs_extent_readonly() from extent-tree.c to inode.c and declare it as
static.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/ctree.h | 1 -
fs/btrfs/extent-tree.c | 13 -------------
fs/btrfs/inode.c | 13 +++++++++++++
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 40ec3393d2a1..df9dfb322ab4 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2691,7 +2691,6 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans);
int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
struct btrfs_ref *generic_ref);
-int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr);
void btrfs_clear_space_info_full(struct btrfs_fs_info *info);
/*
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 78ad31a59e59..5e228d6ad63f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2490,19 +2490,6 @@ int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
return __btrfs_mod_ref(trans, root, buf, full_backref, 0);
}
-int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
-{
- struct btrfs_block_group *block_group;
- int readonly = 0;
-
- block_group = btrfs_lookup_block_group(fs_info, bytenr);
- if (!block_group || block_group->ro)
- readonly = 1;
- if (block_group)
- btrfs_put_block_group(block_group);
- return readonly;
-}
-
static u64 get_alloc_profile_by_root(struct btrfs_root *root, int data)
{
struct btrfs_fs_info *fs_info = root->fs_info;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 6303034a7e7b..2ed7d736e39a 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7256,6 +7256,19 @@ static struct extent_map *btrfs_new_extent_direct(struct btrfs_inode *inode,
return em;
}
+static int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
+{
+ struct btrfs_block_group *block_group;
+ int readonly = 0;
+
+ block_group = btrfs_lookup_block_group(fs_info, bytenr);
+ if (!block_group || block_group->ro)
+ readonly = 1;
+ if (block_group)
+ btrfs_put_block_group(block_group);
+ return readonly;
+}
+
/*
* Check if we can do nocow write into the range [@offset, @offset + @len)
*
--
2.27.0
next prev parent reply other threads:[~2021-02-11 5:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 5:25 [PATCH 0/5] cleanups btrfs_extent_readonly() and scrub, part1 Anand Jain
2021-02-11 5:25 ` Anand Jain [this message]
2021-02-11 5:25 ` [PATCH 2/5] btrfs: btrfs_extent_readonly() change return type to bool Anand Jain
2021-02-11 13:00 ` Johannes Thumshirn
2021-02-11 5:25 ` [PATCH 3/5] btrfs: scrub drop few function declarations Anand Jain
2021-02-11 13:27 ` Johannes Thumshirn
2021-02-11 5:25 ` [PATCH 4/5] btrfs: scrub_checksum_tree_block() drop its function declaration Anand Jain
2021-02-11 13:28 ` Johannes Thumshirn
2021-02-12 14:36 ` David Sterba
2021-02-25 1:21 ` Anand Jain
2021-02-25 16:16 ` David Sterba
2021-02-11 5:25 ` [PATCH 5/5] btrfs: scrub_checksum_data() " Anand Jain
2021-02-11 13:30 ` Johannes Thumshirn
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=91acc559ac0f1deee28410bb379b2a248c2b5204.1613019838.git.anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=josef@toxicpanda.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).