Re: [PATCH 12/13] nfs: add support in nfs to handle multiple writeback contexts

Christoph Hellwig
2025-06-02T14:22:41Z

On Thu, May 29, 2025 at 04:45:03PM +0530, Kundan Kumar wrote:
> if (folio && !cinfo->dreq) {
> struct inode *inode = folio->mapping->host;
> + struct bdi_writeback_ctx *bdi_wb_ctx =
> + fetch_bdi_writeback_ctx(inode);
> long nr = folio_nr_pages(folio);
>
> /* This page is really still in write-back - just that the
> * writeback is happening on the server now.
> */
> node_stat_mod_folio(folio, NR_WRITEBACK, nr);
> - wb_stat_mod(&inode_to_bdi(inode)->wb_ctx_arr[0]->wb,
> - WB_WRITEBACK, nr);
> + wb_stat_mod(&bdi_wb_ctx->wb, WB_WRITEBACK, nr);

Similar comments to fuse here as well, except that nfs also really
should be using the node stat helpers automatically counting the
numbers of pages in a folio instead of duplicating the logic.