Re: [PATCH v1 5/8] iomap: add iomap_writeback_dirty_folio()

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

 



On Fri, Jun 06, 2025 at 04:38:00PM -0700, Joanne Koong wrote:
> Add iomap_writeback_dirty_folio() for writing back a dirty folio.
> One use case of this is for folio laundering.

Where "folio laundering" means calling ->launder_folio, right?

> @@ -1675,7 +1677,8 @@ static int iomap_writepage_map(struct iomap_writepage_ctx *wpc,
>  	 * already at this point.  In that case we need to clear the writeback
>  	 * bit ourselves right after unlocking the page.
>  	 */
> -	folio_unlock(folio);
> +	if (unlock_folio)
> +		folio_unlock(folio);
>  	if (ifs) {
>  		if (atomic_dec_and_test(&ifs->write_bytes_pending))
>  			folio_end_writeback(folio);

When writing this code I was under the impression that
folio_end_writeback needs to be called after unlocking the page.

If that is not actually the case we can just move the unlocking into the
caller and make things a lot cleaner than the conditional locking
argument.

> +int iomap_writeback_dirty_folio(struct folio *folio, struct writeback_control *wbc,
> +				struct iomap_writepage_ctx *wpc,
> +				const struct iomap_writeback_ops *ops)

Please stick to the usual iomap coding style:  80 character lines,
two-tab indent for multiline function declarations.  (Also in a few
other places).





[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