2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 02:04:05 +08:00

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 <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
Chao Yu 2014-02-27 19:52:21 +08:00 committed by Jaegeuk Kim
parent 81c1a0f13e
commit 695fd1ed3b
2 changed files with 3 additions and 5 deletions

View File

@ -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) static inline void *inline_xattr_addr(struct page *page)
{ {
struct f2fs_inode *ri; struct f2fs_inode *ri = F2FS_INODE(page);
ri = (struct f2fs_inode *)page_address(page);
return (void *)&(ri->i_addr[DEF_ADDRS_PER_INODE - return (void *)&(ri->i_addr[DEF_ADDRS_PER_INODE -
F2FS_INLINE_XATTR_ADDRS]); 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) static inline void *inline_data_addr(struct page *page)
{ {
struct f2fs_inode *ri; struct f2fs_inode *ri = F2FS_INODE(page);
ri = (struct f2fs_inode *)page_address(page);
return (void *)&(ri->i_addr[1]); return (void *)&(ri->i_addr[1]);
} }

View File

@ -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 */ /* get node pages in the current segment */
curseg = CURSEG_I(sbi, CURSEG_WARM_NODE); 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 */ /* read node page */
page = alloc_page(GFP_F2FS_ZERO); page = alloc_page(GFP_F2FS_ZERO);