aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-23 10:18:46 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:31:10 -0400
commitf6c0a1920e0180175bd5e8e4aff8ea5556f1895d (patch)
treee432b4e37b8f7ae6439a0644bf6e3add38dae9d8 /fs
parent38583f095c5a8138ae2a1c9173d0fd8a9f10e8aa (diff)
fs/file.c: don't open-code kvfree()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/file.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/file.c b/fs/file.c
index 8f294cfac697..66923fe3176e 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -44,15 +44,10 @@ static void *alloc_fdmem(size_t size)
44 return vmalloc(size); 44 return vmalloc(size);
45} 45}
46 46
47static void free_fdmem(void *ptr)
48{
49 is_vmalloc_addr(ptr) ? vfree(ptr) : kfree(ptr);
50}
51
52static void __free_fdtable(struct fdtable *fdt) 47static void __free_fdtable(struct fdtable *fdt)
53{ 48{
54 free_fdmem(fdt->fd); 49 kvfree(fdt->fd);
55 free_fdmem(fdt->open_fds); 50 kvfree(fdt->open_fds);
56 kfree(fdt); 51 kfree(fdt);
57} 52}
58 53
@@ -130,7 +125,7 @@ static struct fdtable * alloc_fdtable(unsigned int nr)
130 return fdt; 125 return fdt;
131 126
132out_arr: 127out_arr:
133 free_fdmem(fdt->fd); 128 kvfree(fdt->fd);
134out_fdt: 129out_fdt:
135 kfree(fdt); 130 kfree(fdt);
136out: 131out: