Re: [PATCH 10/31] ext4: Convert ext4_convert_inline_data_to_extent() to use a folio

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

 



On Thu, Jan 26, 2023 at 08:23:54PM +0000, Matthew Wilcox (Oracle) wrote:
> Saves a number of calls to compound_head().

Is this left over from an earlier version of this patch series?  There
are no changes to calls to compound_head() that I can find in this
patch.

> @@ -565,10 +564,9 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping,
>  
>  	/* We cannot recurse into the filesystem as the transaction is already
>  	 * started */
> -	flags = memalloc_nofs_save();
> -	page = grab_cache_page_write_begin(mapping, 0);
> -	memalloc_nofs_restore(flags);
> -	if (!page) {
> +	folio = __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN | FGP_NOFS,
> +			mapping_gfp_mask(mapping));
> +	if (!folio) {
>  		ret = -ENOMEM;
>  		goto out;
>  	}

Is there a reason why to use FGP_NOFS as opposed to using
memalloc_nofs_{save,restore}()?

I thought using memalloc_nofs_save() is considered the perferred
approach by mm-folks.

						- Ted



[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