diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-11-30 14:28:17 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-03 06:27:29 +0300 |
commit | acbf054d537d7efddc232e6c11a15d4be0507fd6 (patch) | |
tree | a77c055e6a007f298a12dcbe59b6b294adc89929 /fs/f2fs/node.c | |
parent | 979f492fe387e88a0c97566853ebb615f19a3221 (diff) | |
download | linux-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/node.c')
-rw-r--r-- | fs/f2fs/node.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index fe99723bb5b6..f3ab3a917d13 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2581,8 +2581,8 @@ static int __get_nat_bitmaps(struct f2fs_sb_info *sbi) nm_i->nat_bits_blocks = F2FS_BYTES_TO_BLK((nat_bits_bytes << 1) + 8 + F2FS_BLKSIZE - 1); - nm_i->nat_bits = kzalloc(nm_i->nat_bits_blocks << F2FS_BLKSIZE_BITS, - GFP_KERNEL); + nm_i->nat_bits = f2fs_kzalloc(sbi, + nm_i->nat_bits_blocks << F2FS_BLKSIZE_BITS, GFP_KERNEL); if (!nm_i->nat_bits) return -ENOMEM; @@ -2728,7 +2728,8 @@ int build_node_manager(struct f2fs_sb_info *sbi) { int err; - sbi->nm_info = kzalloc(sizeof(struct f2fs_nm_info), GFP_KERNEL); + sbi->nm_info = f2fs_kzalloc(sbi, sizeof(struct f2fs_nm_info), + GFP_KERNEL); if (!sbi->nm_info) return -ENOMEM; |