Commit 36218b81 authored by Zheng Yongjun's avatar Zheng Yongjun Committed by Jaegeuk Kim

f2fs: Replace expression with offsetof()

Use the existing offsetof() macro instead of duplicating code.
Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 632faca7
...@@ -2696,7 +2696,7 @@ int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page) ...@@ -2696,7 +2696,7 @@ int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page)
src = F2FS_INODE(page); src = F2FS_INODE(page);
dst = F2FS_INODE(ipage); dst = F2FS_INODE(ipage);
memcpy(dst, src, (unsigned long)&src->i_ext - (unsigned long)src); memcpy(dst, src, offsetof(struct f2fs_inode, i_ext));
dst->i_size = 0; dst->i_size = 0;
dst->i_blocks = cpu_to_le64(1); dst->i_blocks = cpu_to_le64(1);
dst->i_links = cpu_to_le32(1); dst->i_links = cpu_to_le32(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment