Skip to content

Commit f99de3d

Browse files
konisakpm00
authored andcommitted
nilfs2: convert inode file to be folio-based
Convert the page-based implementation of ifile, a metadata file that manages inodes, to folio-based. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ryusuke Konishi <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 21cf934 commit f99de3d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

fs/nilfs2/ifile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
9898
.pr_entry_nr = ino, .pr_entry_bh = NULL
9999
};
100100
struct nilfs_inode *raw_inode;
101-
void *kaddr;
101+
size_t offset;
102102
int ret;
103103

104104
ret = nilfs_palloc_prepare_free_entry(ifile, &req);
@@ -113,11 +113,11 @@ int nilfs_ifile_delete_inode(struct inode *ifile, ino_t ino)
113113
return ret;
114114
}
115115

116-
kaddr = kmap_local_page(req.pr_entry_bh->b_page);
117-
raw_inode = nilfs_palloc_block_get_entry(ifile, req.pr_entry_nr,
118-
req.pr_entry_bh, kaddr);
116+
offset = nilfs_palloc_entry_offset(ifile, req.pr_entry_nr,
117+
req.pr_entry_bh);
118+
raw_inode = kmap_local_folio(req.pr_entry_bh->b_folio, offset);
119119
raw_inode->i_flags = 0;
120-
kunmap_local(kaddr);
120+
kunmap_local(raw_inode);
121121

122122
mark_buffer_dirty(req.pr_entry_bh);
123123
brelse(req.pr_entry_bh);

fs/nilfs2/ifile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
static inline struct nilfs_inode *
2222
nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)
2323
{
24-
void *kaddr = kmap_local_page(ibh->b_page);
24+
size_t __offset_in_folio = nilfs_palloc_entry_offset(ifile, ino, ibh);
2525

26-
return nilfs_palloc_block_get_entry(ifile, ino, ibh, kaddr);
26+
return kmap_local_folio(ibh->b_folio, __offset_in_folio);
2727
}
2828

2929
static inline void nilfs_ifile_unmap_inode(struct nilfs_inode *raw_inode)

0 commit comments

Comments
 (0)