From 55cf94258af72fd493779ab2b7a4278d5c8d1d21 Mon Sep 17 00:00:00 2001 From: Bo Lan Date: Thu, 6 Mar 2025 14:38:24 +0800 Subject: [PATCH] ANDROID: writeback: export symbols to do a hierarchical writeback control For short-life or high-IO-freq files we marked, the writeback tasks will act on an additional writeback dispatching list, achieving hierarchical control of dirty writeback without affecting other original writeback tasks. Bug: 400883625 Change-Id: Id2906b0ad87cad1217b47249f39bd2b196dfa9ee Signed-off-by: Bo Lan --- fs/fs-writeback.c | 6 ++++-- mm/backing-dev.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 240878bfbc28..4a1c588aaac8 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -135,13 +135,14 @@ static bool inode_io_list_move_locked(struct inode *inode, return false; } -static void wb_wakeup(struct bdi_writeback *wb) +void wb_wakeup(struct bdi_writeback *wb) { spin_lock_irq(&wb->work_lock); if (test_bit(WB_registered, &wb->state)) mod_delayed_work(bdi_wq, &wb->dwork, 0); spin_unlock_irq(&wb->work_lock); } +EXPORT_SYMBOL_GPL(wb_wakeup); /* * This function is used when the first inode for this wb is marked dirty. It @@ -1345,7 +1346,7 @@ void sb_clear_inode_writeback(struct inode *inode) * the case then the inode must have been redirtied while it was being written * out and we don't reset its dirtied_when. */ -static void redirty_tail_locked(struct inode *inode, struct bdi_writeback *wb) +void redirty_tail_locked(struct inode *inode, struct bdi_writeback *wb) { struct list_head *target_list = &wb->b_dirty; assert_spin_locked(&inode->i_lock); @@ -1371,6 +1372,7 @@ static void redirty_tail_locked(struct inode *inode, struct bdi_writeback *wb) } inode_io_list_move_locked(inode, wb, target_list); } +EXPORT_SYMBOL_GPL(redirty_tail_locked); static void redirty_tail(struct inode *inode, struct bdi_writeback *wb) { diff --git a/mm/backing-dev.c b/mm/backing-dev.c index e61bbb1bd622..f913e673e716 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -31,6 +31,7 @@ DEFINE_SPINLOCK(bdi_lock); static u64 bdi_id_cursor; static struct rb_root bdi_tree = RB_ROOT; LIST_HEAD(bdi_list); +EXPORT_SYMBOL_GPL(bdi_list); /* bdi_wq serves all asynchronous writeback tasks */ struct workqueue_struct *bdi_wq;