diff options
author | Alexandru Gheorghiu <gheorghiuandru@gmail.com> | 2013-03-27 20:24:53 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-03-30 20:12:18 -0400 |
commit | 79b5793be44d97c0a0e905c221858af08e5ebd85 (patch) | |
tree | 055039157ea7aee50eaed019d4be820335c7e5f7 /fs/f2fs/segment.c | |
parent | 953a3e27e10fc6acb480801ea47197d0270d735e (diff) |
f2fs: use kmemdup
Use kmemdup instead of kzalloc and memcpy.
Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Acked-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 777f17e496e6..17581495bafb 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -1403,10 +1403,9 @@ static int build_sit_info(struct f2fs_sb_info *sbi) | |||
1403 | bitmap_size = __bitmap_size(sbi, SIT_BITMAP); | 1403 | bitmap_size = __bitmap_size(sbi, SIT_BITMAP); |
1404 | src_bitmap = __bitmap_ptr(sbi, SIT_BITMAP); | 1404 | src_bitmap = __bitmap_ptr(sbi, SIT_BITMAP); |
1405 | 1405 | ||
1406 | dst_bitmap = kzalloc(bitmap_size, GFP_KERNEL); | 1406 | dst_bitmap = kmemdup(src_bitmap, bitmap_size, GFP_KERNEL); |
1407 | if (!dst_bitmap) | 1407 | if (!dst_bitmap) |
1408 | return -ENOMEM; | 1408 | return -ENOMEM; |
1409 | memcpy(dst_bitmap, src_bitmap, bitmap_size); | ||
1410 | 1409 | ||
1411 | /* init SIT information */ | 1410 | /* init SIT information */ |
1412 | sit_i->s_ops = &default_salloc_ops; | 1411 | sit_i->s_ops = &default_salloc_ops; |