mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 12:11:59 +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:
parent
7c031f1d47
commit
06040e7520
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user