mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-05 22:19:09 +08:00
f2fs: Pass a folio to get_dnode_addr()
All callers except __get_inode_rdev() and __set_inode_rdev() now have a folio, but the only callers of those two functions do have a folio, so pass the folio to them and then into get_dnode_addr(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
committed by
Jaegeuk Kim
parent
6f7ec66180
commit
7d28f13c58
@@ -1116,7 +1116,7 @@ static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
|
||||
|
||||
static void __set_data_blkaddr(struct dnode_of_data *dn, block_t blkaddr)
|
||||
{
|
||||
__le32 *addr = get_dnode_addr(dn->inode, &dn->node_folio->page);
|
||||
__le32 *addr = get_dnode_addr(dn->inode, dn->node_folio);
|
||||
|
||||
dn->data_blkaddr = blkaddr;
|
||||
addr[dn->ofs_in_node] = cpu_to_le32(dn->data_blkaddr);
|
||||
|
||||
@@ -3033,16 +3033,16 @@ static inline unsigned int get_dnode_base(struct inode *inode,
|
||||
}
|
||||
|
||||
static inline __le32 *get_dnode_addr(struct inode *inode,
|
||||
struct page *node_page)
|
||||
struct folio *node_folio)
|
||||
{
|
||||
return blkaddr_in_node(F2FS_NODE(node_page)) +
|
||||
get_dnode_base(inode, node_page);
|
||||
return blkaddr_in_node(F2FS_NODE(&node_folio->page)) +
|
||||
get_dnode_base(inode, &node_folio->page);
|
||||
}
|
||||
|
||||
static inline block_t data_blkaddr(struct inode *inode,
|
||||
struct folio *node_folio, unsigned int offset)
|
||||
{
|
||||
return le32_to_cpu(*(get_dnode_addr(inode, &node_folio->page) + offset));
|
||||
return le32_to_cpu(*(get_dnode_addr(inode, node_folio) + offset));
|
||||
}
|
||||
|
||||
static inline block_t f2fs_data_blkaddr(struct dnode_of_data *dn)
|
||||
@@ -3409,7 +3409,7 @@ static inline bool f2fs_is_cow_file(struct inode *inode)
|
||||
|
||||
static inline void *inline_data_addr(struct inode *inode, struct folio *folio)
|
||||
{
|
||||
__le32 *addr = get_dnode_addr(inode, &folio->page);
|
||||
__le32 *addr = get_dnode_addr(inode, folio);
|
||||
|
||||
return (void *)(addr + DEF_INLINE_RESERVED_SIZE);
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count)
|
||||
block_t blkstart;
|
||||
int blklen = 0;
|
||||
|
||||
addr = get_dnode_addr(dn->inode, &dn->node_folio->page) + ofs;
|
||||
addr = get_dnode_addr(dn->inode, dn->node_folio) + ofs;
|
||||
blkstart = le32_to_cpu(*addr);
|
||||
|
||||
/* Assumption: truncation starts with cluster */
|
||||
|
||||
@@ -68,9 +68,9 @@ void f2fs_set_inode_flags(struct inode *inode)
|
||||
S_ENCRYPTED|S_VERITY|S_CASEFOLD);
|
||||
}
|
||||
|
||||
static void __get_inode_rdev(struct inode *inode, struct page *node_page)
|
||||
static void __get_inode_rdev(struct inode *inode, struct folio *node_folio)
|
||||
{
|
||||
__le32 *addr = get_dnode_addr(inode, node_page);
|
||||
__le32 *addr = get_dnode_addr(inode, node_folio);
|
||||
|
||||
if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode) ||
|
||||
S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
|
||||
@@ -81,9 +81,9 @@ static void __get_inode_rdev(struct inode *inode, struct page *node_page)
|
||||
}
|
||||
}
|
||||
|
||||
static void __set_inode_rdev(struct inode *inode, struct page *node_page)
|
||||
static void __set_inode_rdev(struct inode *inode, struct folio *node_folio)
|
||||
{
|
||||
__le32 *addr = get_dnode_addr(inode, node_page);
|
||||
__le32 *addr = get_dnode_addr(inode, node_folio);
|
||||
|
||||
if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) {
|
||||
if (old_valid_dev(inode->i_rdev)) {
|
||||
@@ -489,7 +489,7 @@ static int do_read_inode(struct inode *inode)
|
||||
}
|
||||
|
||||
/* get rdev by using inline_info */
|
||||
__get_inode_rdev(inode, &node_folio->page);
|
||||
__get_inode_rdev(inode, node_folio);
|
||||
|
||||
if (!f2fs_need_inode_block_update(sbi, inode->i_ino))
|
||||
fi->last_disk_size = inode->i_size;
|
||||
@@ -745,7 +745,7 @@ void f2fs_update_inode(struct inode *inode, struct folio *node_folio)
|
||||
}
|
||||
}
|
||||
|
||||
__set_inode_rdev(inode, &node_folio->page);
|
||||
__set_inode_rdev(inode, node_folio);
|
||||
|
||||
/* deleted inode */
|
||||
if (inode->i_nlink == 0)
|
||||
|
||||
Reference in New Issue
Block a user