summaryrefslogtreecommitdiff
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-11-30 14:28:17 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2018-01-03 06:27:29 +0300
commitacbf054d537d7efddc232e6c11a15d4be0507fd6 (patch)
treea77c055e6a007f298a12dcbe59b6b294adc89929 /fs/f2fs/f2fs.h
parent979f492fe387e88a0c97566853ebb615f19a3221 (diff)
downloadlinux-acbf054d537d7efddc232e6c11a15d4be0507fd6.tar.xz
f2fs: inject fault to kzalloc
This patch introduces f2fs_kzalloc based on f2fs_kmalloc in order to support error injection for kzalloc(). Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index f3b46197b282..3f3d062c349e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2422,6 +2422,12 @@ static inline void *f2fs_kmalloc(struct f2fs_sb_info *sbi,
return kmalloc(size, flags);
}
+static inline void *f2fs_kzalloc(struct f2fs_sb_info *sbi,
+ size_t size, gfp_t flags)
+{
+ return f2fs_kmalloc(sbi, size, flags | __GFP_ZERO);
+}
+
static inline int get_extra_isize(struct inode *inode)
{
return F2FS_I(inode)->i_extra_isize / sizeof(__le32);