From: Christian Brauner <brauner@kernel.org>
To: Julian Sun <sunjunchao@bytedance.com>
Cc: Christian Brauner <brauner@kernel.org>,
clm@fb.com, dsterba@suse.com, xiubli@redhat.com,
idryomov@gmail.com, tytso@mit.edu, adilger.kernel@dilger.ca,
jaegeuk@kernel.org, chao@kernel.org, willy@infradead.org,
jack@suse.cz, agruenba@redhat.com, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-ext4@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] fs: Make wbc_to_tag() inline and use it in fs.
Date: Mon, 6 Oct 2025 12:30:44 +0200 [thread overview]
Message-ID: <20251006-exhumieren-staub-bbd9b043162d@brauner> (raw)
In-Reply-To: <20250929111349.448324-1-sunjunchao@bytedance.com>
On Mon, 29 Sep 2025 19:13:49 +0800, Julian Sun wrote:
> The logic in wbc_to_tag() is widely used in file systems, so modify this
> function to be inline and use it in file systems.
>
> This patch has only passed compilation tests, but it should be fine.
>
>
Folding:
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index dde77d13a200..1e60d463f226 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -196,6 +196,13 @@ static inline void wait_on_inode(struct inode *inode)
!(READ_ONCE(inode->i_state) & I_NEW));
}
+static inline xa_mark_t wbc_to_tag(struct writeback_control *wbc)
+{
+ if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages)
+ return PAGECACHE_TAG_TOWRITE;
+ return PAGECACHE_TAG_DIRTY;
+}
+
#ifdef CONFIG_CGROUP_WRITEBACK
#include <linux/cgroup.h>
@@ -240,13 +247,6 @@ static inline void inode_detach_wb(struct inode *inode)
}
}
-static inline xa_mark_t wbc_to_tag(struct writeback_control *wbc)
-{
- if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages)
- return PAGECACHE_TAG_TOWRITE;
- return PAGECACHE_TAG_DIRTY;
-}
-
void wbc_attach_fdatawrite_inode(struct writeback_control *wbc,
struct inode *inode);
since wbc_to_tag() cannot be conditional on cgroup writeback.
---
Applied to the vfs-6.19.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.19.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.19.misc
[1/1] fs: Make wbc_to_tag() inline and use it in fs.
https://git.kernel.org/vfs/vfs/c/48b6926673f7
prev parent reply other threads:[~2025-10-06 10:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 11:13 [PATCH v2] fs: Make wbc_to_tag() inline and use it in fs Julian Sun
2025-09-29 11:50 ` Jan Kara
2025-09-29 21:46 ` Qu Wenruo
2025-09-30 1:57 ` kernel test robot
2025-10-06 10:30 ` Christian Brauner [this message]
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=20251006-exhumieren-staub-bbd9b043162d@brauner \
--to=brauner@kernel.org \
--cc=adilger.kernel@dilger.ca \
--cc=agruenba@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=chao@kernel.org \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=idryomov@gmail.com \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sunjunchao@bytedance.com \
--cc=tytso@mit.edu \
--cc=willy@infradead.org \
--cc=xiubli@redhat.com \
/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