Re: [PATCH 2/3] bcachefs: stop using write_cache_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 18, 2025 at 07:17:15AM -0400, Kent Overstreet wrote:
> On Mon, Aug 18, 2025 at 08:10:09AM +0200, Christoph Hellwig wrote:
> > Stop using the obsolete write_cache_pages and use writeback_iter
> > directly.  This basically just open codes write_cache_pages
> > without the indirect call, but there's probably ways to structure
> > the code even nicer as a follow on.
> 
> Wouldn't inlining write_cache_pages() achieve the same thing?

It might eliminate the indirect calls with the right compiler or
options, but not archieve any of the other goals, and leave us
with a helper implementing a pointless callback pattern for 1 user.

> > +
> > +	while ((folio = writeback_iter(mapping, wbc, folio, &error)))
> > +		error = __bch2_writepage(folio, wbc, data);
> > +	return error;
> > +}
> > +
> >  int bch2_writepages(struct address_space *mapping, struct writeback_control *wbc)
> >  {
> >  	struct bch_fs *c = mapping->host->i_sb->s_fs_info;
> > @@ -663,7 +674,7 @@ int bch2_writepages(struct address_space *mapping, struct writeback_control *wbc
> >  	bch2_inode_opts_get(&w->opts, c, &to_bch_ei(mapping->host)->ei_inode);
> >  
> >  	blk_start_plug(&w->plug);
> > -	int ret = write_cache_pages(mapping, wbc, __bch2_writepage, w);
> > +	int ret = bch2_write_cache_pages(mapping, wbc, w);
> >  	if (w->io)
> >  		bch2_writepage_do_io(w);
> >  	blk_finish_plug(&w->plug);
> > -- 
> > 2.47.2
> > 
---end quoted text---




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux