mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
NFSD: replace __get_free_page() with kmalloc() in nfsd_buffered_readdir()
nfsd_buffered_readdir() allocates a staging buffer with __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Link: https://patch.msgid.link/20260523-b4-fs-v1-7-275e36a83f0e@kernel.org Acked-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
+2
-2
@@ -2407,7 +2407,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, struct svc_fh *fhp,
|
||||
loff_t offset;
|
||||
struct readdir_data buf = {
|
||||
.ctx.actor = nfsd_buffered_filldir,
|
||||
.dirent = (void *)__get_free_page(GFP_KERNEL)
|
||||
.dirent = kmalloc(PAGE_SIZE, GFP_KERNEL)
|
||||
};
|
||||
|
||||
if (!buf.dirent)
|
||||
@@ -2458,7 +2458,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, struct svc_fh *fhp,
|
||||
offset = vfs_llseek(file, 0, SEEK_CUR);
|
||||
}
|
||||
|
||||
free_page((unsigned long)(buf.dirent));
|
||||
kfree((buf.dirent));
|
||||
|
||||
if (host_err)
|
||||
return nfserrno(host_err);
|
||||
|
||||
Reference in New Issue
Block a user