From: Chao Yu Date: Thu, 27 Feb 2014 11:52:21 +0000 (+0800) Subject: f2fs: use existing macro to clean up some codes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=695fd1ed3bcaae9fc032cbe47f0fe9a934bf1717;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git f2fs: use existing macro to clean up some codes This patch use existing macro F2FS_INODE/NEXT_FREE_BLKADDR to clean up some codes. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index bd6666e1bf2f..8b2cb82f852b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1000,8 +1000,7 @@ static inline unsigned int addrs_per_inode(struct f2fs_inode_info *fi) static inline void *inline_xattr_addr(struct page *page) { - struct f2fs_inode *ri; - ri = (struct f2fs_inode *)page_address(page); + struct f2fs_inode *ri = F2FS_INODE(page); return (void *)&(ri->i_addr[DEF_ADDRS_PER_INODE - F2FS_INLINE_XATTR_ADDRS]); } @@ -1021,8 +1020,7 @@ static inline int f2fs_has_inline_data(struct inode *inode) static inline void *inline_data_addr(struct page *page) { - struct f2fs_inode *ri; - ri = (struct f2fs_inode *)page_address(page); + struct f2fs_inode *ri = F2FS_INODE(page); return (void *)&(ri->i_addr[1]); } diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 72adbbfdb3e5..aef77681e10b 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -136,7 +136,7 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head) /* get node pages in the current segment */ curseg = CURSEG_I(sbi, CURSEG_WARM_NODE); - blkaddr = START_BLOCK(sbi, curseg->segno) + curseg->next_blkoff; + blkaddr = NEXT_FREE_BLKADDR(sbi, curseg); /* read node page */ page = alloc_page(GFP_F2FS_ZERO);