Re: [PATCH 03/12] writeback: Factor should_writeback_folio() out of write_cache_pages()

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

 



> +	if (folio_test_writeback(folio)) {
> +		if (wbc->sync_mode != WB_SYNC_NONE)
> +			folio_wait_writeback(folio);
> +		else
> +			return false;
> +	}

Please reorder this to avoid the else and return earlier while you're
at it:

	if (folio_test_writeback(folio)) {
		if (wbc->sync_mode == WB_SYNC_NONE)
			return false;
		folio_wait_writeback(folio);
	}

(that's what actually got me started on my little cleanup spree while
checking some details of the writeback waiting..)

> +	BUG_ON(folio_test_writeback(folio));
> +	if (!folio_clear_dirty_for_io(folio))
> +		return false;
> +
> +	return true;

..

	return folio_clear_dirty_for_io(folio);

?




[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