]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bfs: replace get_zeroed_page() with kzalloc()
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Sat, 23 May 2026 17:54:29 +0000 (20:54 +0300)
committerChristian Brauner <brauner@kernel.org>
Thu, 28 May 2026 11:58:14 +0000 (13:58 +0200)
bfs_dump_imap() allocates temporary buffer with get_zeroed_page().

kmalloc() is a better API for such use and it also provides better
scalability and more debugging possibilities.

Replace use of get_zeroed_page() with kzalloc().

Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Link: https://patch.msgid.link/20260523-b4-fs-v1-17-275e36a83f0e@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/bfs/inode.c

index 9c3e90390824c3648b93c2d2075354773fe0809e..e41efdd35db9ef167845f9b1b4839921880f2052 100644 (file)
@@ -311,7 +311,7 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
 {
 #ifdef DEBUG
        int i;
-       char *tmpbuf = (char *)get_zeroed_page(GFP_KERNEL);
+       char *tmpbuf = kzalloc(PAGE_SIZE, GFP_KERNEL);
 
        if (!tmpbuf)
                return;
@@ -323,7 +323,7 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
                        strcat(tmpbuf, "0");
        }
        printf("%s: lasti=%08lx <%s>\n", prefix, BFS_SB(s)->si_lasti, tmpbuf);
-       free_page((unsigned long)tmpbuf);
+       kfree(tmpbuf);
 #endif
 }