summaryrefslogtreecommitdiff
path: root/include/linux/writeback.h
diff options
context:
space:
mode:
authorJulian Sun <sunjunchao@bytedance.com>2025-09-29 19:13:49 +0800
committerChristian Brauner <brauner@kernel.org>2025-10-29 23:33:48 +0100
commit4952f35f0545f3b53dab8d5fd727c4827c2a2778 (patch)
tree0cc0563c7281223a21f18ebedf01adff666d775d /include/linux/writeback.h
parent891bea757c771dca47e871444faecb1ed642a311 (diff)
fs: Make wbc_to_tag() inline and use it in fs.
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. Signed-off-by: Julian Sun <sunjunchao@bytedance.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/writeback.h')
-rw-r--r--include/linux/writeback.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 49e1dd96f43e..2a81816f7507 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>