Re: [RFC PATCH v2 4/7] jbd2: do not free buffers in jbd2_journal_try_to_free_buffers()

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

 



On Wed, Apr 14, 2021 at 09:47:34PM +0800, Zhang Yi wrote:
>  static int blkdev_releasepage(struct page *page, gfp_t wait)
>  {
>  	struct super_block *super = BDEV_I(page->mapping->host)->bdev.bd_super;
> +	int ret = 0;
>  
>  	if (super && super->s_op->bdev_try_to_free_page)
> +		ret = super->s_op->bdev_try_to_free_page(super, page, wait);
> +	if (!ret)
> +		return try_to_free_buffers(page);
> +	return 0;

This would rea much better as:

	if (super && super->s_op->bdev_try_to_free_page &&
	    super->s_op->bdev_try_to_free_page(super, page, wait)
		return 0;
	return try_to_free_buffers(page);

and I think changing ->bdev_try_to_free_page to return a bool where true
means "yes, free the buffers" and false means "don't free buffers" would
be a better calling convention.

Also please split the changes to the method signature from the ext4
internal cleanups.



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux