Re: [PATCH v6 01/11] fuse: support copying large folios

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

 



On Mon, May 12, 2025 at 03:58:30PM -0700, Joanne Koong wrote:
> @@ -1126,22 +1127,22 @@ static int fuse_copy_page(struct fuse_copy_state *cs, struct page **pagep,
>  					return err;
>  			}
>  		}
> -		if (page) {
> -			void *mapaddr = kmap_local_page(page);
> -			void *buf = mapaddr + offset;
> +		if (folio) {
> +			void *mapaddr = kmap_local_folio(folio, offset);
> +			void *buf = mapaddr;
>  			offset += fuse_copy_do(cs, &buf, &count);
>  			kunmap_local(mapaddr);

kmap_local_folio() only maps the page which contains 'offset'.
following what the functions in highmem.h do, i'd suggest something
like:

		if (folio) {
			void *mapaddr = kmap_local_folio(folio, offset);
			void *buf = mapaddr;

			if (folio_test_highmem(folio) &&
			    size > PAGE_SIZE - offset_in_page(offset))
				size = PAGE_SIZE - offset_in_page(offset);
			offset += fuse_copy_do(cs, &buf, &count);
			kunmap_local(mapaddr);





[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