From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 2/2] btrfs: sink write flags to cow_file_range_async
Date: Tue, 29 Oct 2019 18:28:57 +0100 [thread overview]
Message-ID: <8bfe15d0c80d0011c5fc48893345e7870e0f4e49.1572369984.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1572369984.git.dsterba@suse.com>
In commit "Btrfs: use REQ_CGROUP_PUNT for worker thread submitted bios",
cow_file_range_async gained wbc as a parameter and this makes passing
write flags redundant. Set it inside the function and remove the
parameter.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/inode.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 09118a0f82d1..e7ea139a8e63 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1201,8 +1201,7 @@ static int cow_file_range_async(struct inode *inode,
struct writeback_control *wbc,
struct page *locked_page,
u64 start, u64 end, int *page_started,
- unsigned long *nr_written,
- unsigned int write_flags)
+ unsigned long *nr_written)
{
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
struct cgroup_subsys_state *blkcg_css = wbc_blkcg_css(wbc);
@@ -1214,6 +1213,7 @@ static int cow_file_range_async(struct inode *inode,
int i;
bool should_compress;
unsigned nofs_flag;
+ const unsigned int write_flags = wbc_to_write_flags(wbc);
unlock_extent(&BTRFS_I(inode)->io_tree, start, end);
@@ -1724,7 +1724,6 @@ int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page,
{
int ret;
int force_cow = need_force_cow(inode, start, end);
- unsigned int write_flags = wbc_to_write_flags(wbc);
if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW && !force_cow) {
ret = run_delalloc_nocow(inode, locked_page, start, end,
@@ -1740,8 +1739,7 @@ int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page,
set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
&BTRFS_I(inode)->runtime_flags);
ret = cow_file_range_async(inode, wbc, locked_page, start, end,
- page_started, nr_written,
- write_flags);
+ page_started, nr_written);
}
if (ret)
btrfs_cleanup_ordered_extents(inode, locked_page, start,
--
2.23.0
next prev parent reply other threads:[~2019-10-29 17:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 17:28 [PATCH 0/2] Minor parameter cleanups David Sterba
2019-10-29 17:28 ` [PATCH 1/2] btrfs: sink write_flags to __extent_writepage_io David Sterba
2019-10-30 11:25 ` Johannes Thumshirn
2019-10-29 17:28 ` David Sterba [this message]
2019-10-30 11:27 ` [PATCH 2/2] btrfs: sink write flags to cow_file_range_async Johannes Thumshirn
2019-10-30 11:39 ` [PATCH 0/2] Minor parameter cleanups Nikolay Borisov
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=8bfe15d0c80d0011c5fc48893345e7870e0f4e49.1572369984.git.dsterba@suse.com \
--to=dsterba@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).