Skip to content

Commit 9ddaf06

Browse files
rpptjankara
authored andcommitted
isofs: replace __get_free_page() with kmalloc()
isofs_readdir() allocates a temporary 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-11-275e36a83f0e@kernel.org Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 6d06b04 commit 9ddaf06

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

fs/isofs/dir.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include <linux/gfp.h>
1515
#include <linux/filelock.h>
16+
#include <linux/slab.h>
1617
#include "isofs.h"
1718

1819
int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode)
@@ -255,15 +256,15 @@ static int isofs_readdir(struct file *file, struct dir_context *ctx)
255256
struct iso_directory_record *tmpde;
256257
struct inode *inode = file_inode(file);
257258

258-
tmpname = (char *)__get_free_page(GFP_KERNEL);
259+
tmpname = kmalloc(PAGE_SIZE, GFP_KERNEL);
259260
if (tmpname == NULL)
260261
return -ENOMEM;
261262

262263
tmpde = (struct iso_directory_record *) (tmpname+1024);
263264

264265
result = do_isofs_readdir(inode, file, ctx, tmpname, tmpde);
265266

266-
free_page((unsigned long) tmpname);
267+
kfree(tmpname);
267268
return result;
268269
}
269270

0 commit comments

Comments
 (0)