aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-04-29 15:16:42 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:33:24 +0200
commit464441f6c6aa0840ea0fa6961946ff8cb2a07242 (patch)
tree16652338c41246d949294821870c8813dde3daa3 /fs/f2fs
parente28254caa682e4537a123161433d629bb33c8f70 (diff)
f2fs: introduce f2fs_kmalloc to wrap kmalloc
This patch adds f2fs_kmalloc. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/acl.c4
-rw-r--r--fs/f2fs/dir.c2
-rw-r--r--fs/f2fs/f2fs.h5
-rw-r--r--fs/f2fs/gc.c2
-rw-r--r--fs/f2fs/inline.c2
5 files changed, 10 insertions, 5 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index 5b952c059..3fcb3f794 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -115,7 +115,7 @@ static void *f2fs_acl_to_disk(const struct posix_acl *acl, size_t *size)
struct f2fs_acl_entry *entry;
int i;
- f2fs_acl = kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count *
+ f2fs_acl = f2fs_kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count *
sizeof(struct f2fs_acl_entry), GFP_NOFS);
if (!f2fs_acl)
return ERR_PTR(-ENOMEM);
@@ -183,7 +183,7 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage);
if (retval > 0) {
- value = kmalloc(retval, GFP_F2FS_ZERO);
+ value = f2fs_kmalloc(retval, GFP_F2FS_ZERO);
if (!value)
return ERR_PTR(-ENOMEM);
retval = f2fs_getxattr(inode, name_index, "", value,
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index b1e5b5e69..05c4fded9 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -808,7 +808,7 @@ bool f2fs_fill_dentries(struct file *file, void *dirent, filldir_t filldir,
int save_len = fstr->len;
int ret;
- de_name.name = kmalloc(de_name.len, GFP_NOFS);
+ de_name.name = f2fs_kmalloc(de_name.len, GFP_NOFS);
if (!de_name.name)
return false;
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index da275f961..40492e1e5 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1682,6 +1682,11 @@ static inline bool f2fs_may_extent_tree(struct inode *inode)
return S_ISREG(mode);
}
+static inline void *f2fs_kmalloc(size_t size, gfp_t flags)
+{
+ return kmalloc(size, flags);
+}
+
static inline void *f2fs_kvmalloc(size_t size, gfp_t flags)
{
void *ret;
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 6282b1bd0..e4ba2555f 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -96,7 +96,7 @@ int start_gc_thread(struct f2fs_sb_info *sbi)
dev_t dev = sbi->sb->s_bdev->bd_dev;
int err = 0;
- gc_th = kmalloc(sizeof(struct f2fs_gc_kthread), GFP_KERNEL);
+ gc_th = f2fs_kmalloc(sizeof(struct f2fs_gc_kthread), GFP_KERNEL);
if (!gc_th) {
err = -ENOMEM;
goto out;
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index c7553dc4d..1f4917e3b 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -465,7 +465,7 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage,
struct f2fs_inline_dentry *backup_dentry;
int err;
- backup_dentry = kmalloc(sizeof(struct f2fs_inline_dentry),
+ backup_dentry = f2fs_kmalloc(sizeof(struct f2fs_inline_dentry),
GFP_F2FS_ZERO);
if (!backup_dentry)
return -ENOMEM;