[rh7,01/30] fs/file.c: don't open-code kvfree()

Submitted by Kirill Tkhai on May 20, 2020, 4:02 p.m.

Details

Message ID 158999057141.2234365.3278295873704523001.stgit@localhost.localdomain
State New
Series "fs, direct_IO: Switch to iov_iter and allow bio_vec for ext4"
Headers show

Commit Message

Kirill Tkhai May 20, 2020, 4:02 p.m.
From: Al Viro <viro@zeniv.linux.org.uk>

ms commit f6c0a1920e01

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/file.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/file.c b/fs/file.c
index 84c8d695c0d3..d1a54c9a8ecf 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -45,15 +45,10 @@  static void *alloc_fdmem(size_t size)
 	return __vmalloc(size, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM, PAGE_KERNEL);
 }
 
-static void free_fdmem(void *ptr)
-{
-	is_vmalloc_addr(ptr) ? vfree(ptr) : kfree(ptr);
-}
-
 static void __free_fdtable(struct fdtable *fdt)
 {
-	free_fdmem(fdt->fd);
-	free_fdmem(fdt->open_fds);
+	kvfree(fdt->fd);
+	kvfree(fdt->open_fds);
 	kfree(fdt);
 }
 
@@ -166,7 +161,7 @@  static struct fdtable * alloc_fdtable(unsigned int nr)
 	return fdt;
 
 out_arr:
-	free_fdmem(fdt->fd);
+	kvfree(fdt->fd);
 out_fdt:
 	kfree(fdt);
 out: