Skip to content

Commit 4b71e24

Browse files
xp4ns3amschuma-ntap
authored andcommitted
NFS: Convert kmap_atomic() to kmap_local_folio()
kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_folio() in nfs_readdir_folio_array_append(). kmap_atomic() disables page-faults and preemption (the latter only for !PREEMPT_RT kernels), However, the code within the mapping/un-mapping in nfs_readdir_folio_array_append() does not depend on the above-mentioned side effects. Therefore, a mere replacement of the old API with the new one is all that is required (i.e., there is no need to explicitly add any calls to pagefault_disable() and/or preempt_disable()). Tested with (x)fstests in a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with HIGHMEM64GB enabled. Cc: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Fixes: ec108d3 ("NFS: Convert readdir page array functions to use a folio") Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent f1fcbaa commit 4b71e24

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/nfs/dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static int nfs_readdir_folio_array_append(struct folio *folio,
317317

318318
name = nfs_readdir_copy_name(entry->name, entry->len);
319319

320-
array = kmap_atomic(folio_page(folio, 0));
320+
array = kmap_local_folio(folio, 0);
321321
if (!name)
322322
goto out;
323323
ret = nfs_readdir_array_can_expand(array);
@@ -340,7 +340,7 @@ static int nfs_readdir_folio_array_append(struct folio *folio,
340340
nfs_readdir_array_set_eof(array);
341341
out:
342342
*cookie = array->last_cookie;
343-
kunmap_atomic(array);
343+
kunmap_local(array);
344344
return ret;
345345
}
346346

0 commit comments

Comments
 (0)