diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-11-30 19:28:18 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-02 19:27:29 -0800 |
commit | 628b3d1438fbcb1f9e79472a0872a2c3018a48be (patch) | |
tree | e75a111c4eea20a4804c97332eb660d87ad1b390 /fs/f2fs/file.c | |
parent | acbf054d537d7efddc232e6c11a15d4be0507fd6 (diff) |
f2fs: inject fault to kvmalloc
This patch supports to inject fault into kvmalloc/kvzalloc.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6db8a46b2b73..a85c9aafd7a1 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1098,11 +1098,13 @@ static int __exchange_data_block(struct inode *src_inode, while (len) { olen = min((pgoff_t)4 * ADDRS_PER_BLOCK, len); - src_blkaddr = kvzalloc(sizeof(block_t) * olen, GFP_KERNEL); + src_blkaddr = f2fs_kvzalloc(F2FS_I_SB(src_inode), + sizeof(block_t) * olen, GFP_KERNEL); if (!src_blkaddr) return -ENOMEM; - do_replace = kvzalloc(sizeof(int) * olen, GFP_KERNEL); + do_replace = f2fs_kvzalloc(F2FS_I_SB(src_inode), + sizeof(int) * olen, GFP_KERNEL); if (!do_replace) { kvfree(src_blkaddr); return -ENOMEM; |