Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfs-7.1-rc1.writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull vfs writeback updates from Christian Brauner:
"This introduces writeback helper APIs and converts f2fs, gfs2 and nfs
to stop accessing writeback internals directly"

* tag 'vfs-7.1-rc1.writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
nfs: stop using writeback internals for WB_WRITEBACK accounting
gfs2: stop using writeback internals for dirty_exceeded check
f2fs: stop using writeback internals for dirty_exceeded checks
writeback: prep helpers for dirty-limit and writeback accounting

+19 -7
+2 -2
fs/f2fs/node.c
··· 78 78 if (excess_cached_nats(sbi)) 79 79 res = false; 80 80 } else if (type == DIRTY_DENTS) { 81 - if (sbi->sb->s_bdi->wb.dirty_exceeded) 81 + if (bdi_wb_dirty_exceeded(sbi->sb->s_bdi)) 82 82 return false; 83 83 mem_size = get_pages(sbi, F2FS_DIRTY_DENTS); 84 84 res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1); ··· 119 119 res = false; 120 120 #endif 121 121 } else { 122 - if (!sbi->sb->s_bdi->wb.dirty_exceeded) 122 + if (!bdi_wb_dirty_exceeded(sbi->sb->s_bdi)) 123 123 return true; 124 124 } 125 125 return res;
+1 -1
fs/f2fs/segment.h
··· 992 992 */ 993 993 static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type) 994 994 { 995 - if (sbi->sb->s_bdi->wb.dirty_exceeded) 995 + if (bdi_wb_dirty_exceeded(sbi->sb->s_bdi)) 996 996 return 0; 997 997 998 998 if (type == DATA)
+1 -1
fs/gfs2/super.c
··· 449 449 gfs2_log_flush(GFS2_SB(inode), ip->i_gl, 450 450 GFS2_LOG_HEAD_FLUSH_NORMAL | 451 451 GFS2_LFC_WRITE_INODE); 452 - if (bdi->wb.dirty_exceeded) 452 + if (bdi_wb_dirty_exceeded(bdi)) 453 453 gfs2_ail1_flush(sdp, wbc); 454 454 else 455 455 filemap_fdatawrite(metamapping);
+1 -1
fs/nfs/internal.h
··· 859 859 * writeback is happening on the server now. 860 860 */ 861 861 node_stat_mod_folio(folio, NR_WRITEBACK, nr); 862 - wb_stat_mod(&inode_to_bdi(inode)->wb, WB_WRITEBACK, nr); 862 + bdi_wb_stat_mod(inode, WB_WRITEBACK, nr); 863 863 __mark_inode_dirty(inode, I_DIRTY_DATASYNC); 864 864 } 865 865 }
+1 -2
fs/nfs/write.c
··· 872 872 long nr = folio_nr_pages(folio); 873 873 874 874 node_stat_mod_folio(folio, NR_WRITEBACK, -nr); 875 - wb_stat_mod(&inode_to_bdi(folio->mapping->host)->wb, 876 - WB_WRITEBACK, -nr); 875 + bdi_wb_stat_mod(folio->mapping->host, WB_WRITEBACK, -nr); 877 876 } 878 877 } 879 878
+13
include/linux/backing-dev.h
··· 136 136 return inode_to_bdi(mapping->host)->capabilities & BDI_CAP_WRITEBACK; 137 137 } 138 138 139 + /* Must not be used by file systems that support cgroup writeback */ 140 + static inline int bdi_wb_dirty_exceeded(struct backing_dev_info *bdi) 141 + { 142 + return bdi->wb.dirty_exceeded; 143 + } 144 + 145 + /* Must not be used by file systems that support cgroup writeback */ 146 + static inline void bdi_wb_stat_mod(struct inode *inode, enum wb_stat_item item, 147 + s64 amount) 148 + { 149 + wb_stat_mod(&inode_to_bdi(inode)->wb, item, amount); 150 + } 151 + 139 152 #ifdef CONFIG_CGROUP_WRITEBACK 140 153 141 154 struct bdi_writeback *wb_get_lookup(struct backing_dev_info *bdi,