Skip to content

Commit

Permalink
xfs: change kmem_free to use generic kvfree()
Browse files Browse the repository at this point in the history
Change kmem_free to use kvfree() generic function, remove the
duplicated code.

Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
  • Loading branch information
Wang, Yalin authored and Dave Chinner committed Feb 1, 2015
1 parent 8add71c commit f3d2155
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
10 changes: 0 additions & 10 deletions fs/xfs/kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
return ptr;
}

void
kmem_free(const void *ptr)
{
if (!is_vmalloc_addr(ptr)) {
kfree(ptr);
} else {
vfree(ptr);
}
}

void *
kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
xfs_km_flags_t flags)
Expand Down
5 changes: 4 additions & 1 deletion fs/xfs/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ kmem_flags_convert(xfs_km_flags_t flags)
extern void *kmem_alloc(size_t, xfs_km_flags_t);
extern void *kmem_zalloc_large(size_t size, xfs_km_flags_t);
extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t);
extern void kmem_free(const void *);
static inline void kmem_free(const void *ptr)
{
kvfree(ptr);
}


extern void *kmem_zalloc_greedy(size_t *, size_t, size_t);
Expand Down

0 comments on commit f3d2155

Please sign in to comment.