Lines Matching full:wb
39 void wb_start_background_writeback(struct bdi_writeback *wb);
41 void wb_wakeup_delayed(struct bdi_writeback *wb);
50 static inline bool wb_has_dirty_io(struct bdi_writeback *wb) in wb_has_dirty_io() argument
52 return test_bit(WB_has_dirty_io, &wb->state); in wb_has_dirty_io()
64 static inline void wb_stat_mod(struct bdi_writeback *wb, in wb_stat_mod() argument
67 percpu_counter_add_batch(&wb->stat[item], amount, WB_STAT_BATCH); in wb_stat_mod()
70 static inline void inc_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item) in inc_wb_stat() argument
72 wb_stat_mod(wb, item, 1); in inc_wb_stat()
75 static inline void dec_wb_stat(struct bdi_writeback *wb, enum wb_stat_item item) in dec_wb_stat() argument
77 wb_stat_mod(wb, item, -1); in dec_wb_stat()
80 static inline s64 wb_stat(struct bdi_writeback *wb, enum wb_stat_item item) in wb_stat() argument
82 return percpu_counter_read_positive(&wb->stat[item]); in wb_stat()
85 static inline s64 wb_stat_sum(struct bdi_writeback *wb, enum wb_stat_item item) in wb_stat_sum() argument
87 return percpu_counter_sum_positive(&wb->stat[item]); in wb_stat_sum()
90 extern void wb_writeout_inc(struct bdi_writeback *wb);
135 * @wb: bdi_writeback of interest
140 static inline bool writeback_in_progress(struct bdi_writeback *wb) in writeback_in_progress() argument
142 return test_bit(WB_writeback_running, &wb->state); in writeback_in_progress()
184 * wb_find_current - find wb for %current on a bdi
187 * Find the wb of @bdi which matches both the memcg and blkcg of %current.
188 * Must be called under rcu_read_lock() which protects the returend wb.
194 struct bdi_writeback *wb; in wb_find_current() local
198 return &bdi->wb; in wb_find_current()
200 wb = radix_tree_lookup(&bdi->cgwb_tree, memcg_css->id); in wb_find_current()
206 if (likely(wb && wb->blkcg_css == task_css(current, io_cgrp_id))) in wb_find_current()
207 return wb; in wb_find_current()
212 * wb_get_create_current - get or create wb for %current on a bdi
223 struct bdi_writeback *wb; in wb_get_create_current() local
226 wb = wb_find_current(bdi); in wb_get_create_current()
227 if (wb && unlikely(!wb_tryget(wb))) in wb_get_create_current()
228 wb = NULL; in wb_get_create_current()
231 if (unlikely(!wb)) { in wb_get_create_current()
235 wb = wb_get_create(bdi, memcg_css, gfp); in wb_get_create_current()
238 return wb; in wb_get_create_current()
242 * inode_to_wb - determine the wb of an inode
245 * Returns the wb @inode is currently associated with. The caller must be
247 * associated wb's list_lock.
266 * disabled when wbc started. Just use the default wb in that case. in inode_to_wb_wbc()
268 return wbc->wb ? wbc->wb : &inode_to_bdi(inode)->wb; in inode_to_wb_wbc()
272 * unlocked_inode_to_wb_begin - begin unlocked inode wb access transaction
276 * The caller wants to access the wb associated with @inode but isn't
277 * holding inode->i_lock, the i_pages lock or wb->list_lock. This
278 * function determines the wb associated with @inode and ensures that the
293 * ensures that we see the new wb if we see cleared I_WB_SWITCH. in unlocked_inode_to_wb_begin()
308 * unlocked_inode_to_wb_end - end inode wb access transaction
330 return &bdi->wb; in wb_find_current()
336 return &bdi->wb; in wb_get_create_current()
341 return &inode_to_bdi(inode)->wb; in inode_to_wb()