mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
f2fs: Convert get_next_sit_page() to get_next_sit_folio()
Grab a folio instead of a page. Also convert seg_info_to_sit_page() to seg_info_to_sit_folio() and use a folio in f2fs_flush_sit_entries(). Saves a couple of calls to compound_head(). 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:
parent
5df510c8df
commit
9c6b0f120e
|
|
@ -4503,23 +4503,23 @@ static struct page *get_current_sit_page(struct f2fs_sb_info *sbi,
|
|||
return f2fs_get_meta_page(sbi, current_sit_addr(sbi, segno));
|
||||
}
|
||||
|
||||
static struct page *get_next_sit_page(struct f2fs_sb_info *sbi,
|
||||
static struct folio *get_next_sit_folio(struct f2fs_sb_info *sbi,
|
||||
unsigned int start)
|
||||
{
|
||||
struct sit_info *sit_i = SIT_I(sbi);
|
||||
struct page *page;
|
||||
struct folio *folio;
|
||||
pgoff_t src_off, dst_off;
|
||||
|
||||
src_off = current_sit_addr(sbi, start);
|
||||
dst_off = next_sit_addr(sbi, src_off);
|
||||
|
||||
page = f2fs_grab_meta_page(sbi, dst_off);
|
||||
seg_info_to_sit_page(sbi, page, start);
|
||||
folio = f2fs_grab_meta_folio(sbi, dst_off);
|
||||
seg_info_to_sit_folio(sbi, folio, start);
|
||||
|
||||
set_page_dirty(page);
|
||||
folio_mark_dirty(folio);
|
||||
set_to_next_sit(sit_i, start);
|
||||
|
||||
return page;
|
||||
return folio;
|
||||
}
|
||||
|
||||
static struct sit_entry_set *grab_sit_entry_set(void)
|
||||
|
|
@ -4649,7 +4649,7 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
* #2, flush sit entries to sit page.
|
||||
*/
|
||||
list_for_each_entry_safe(ses, tmp, head, set_list) {
|
||||
struct page *page = NULL;
|
||||
struct folio *folio = NULL;
|
||||
struct f2fs_sit_block *raw_sit = NULL;
|
||||
unsigned int start_segno = ses->start_segno;
|
||||
unsigned int end = min(start_segno + SIT_ENTRY_PER_BLOCK,
|
||||
|
|
@ -4663,8 +4663,8 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
if (to_journal) {
|
||||
down_write(&curseg->journal_rwsem);
|
||||
} else {
|
||||
page = get_next_sit_page(sbi, start_segno);
|
||||
raw_sit = page_address(page);
|
||||
folio = get_next_sit_folio(sbi, start_segno);
|
||||
raw_sit = folio_address(folio);
|
||||
}
|
||||
|
||||
/* flush dirty sit entries in region of current sit set */
|
||||
|
|
@ -4710,7 +4710,7 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
if (to_journal)
|
||||
up_write(&curseg->journal_rwsem);
|
||||
else
|
||||
f2fs_put_page(page, 1);
|
||||
f2fs_folio_put(folio, true);
|
||||
|
||||
f2fs_bug_on(sbi, ses->entry_cnt);
|
||||
release_sit_entry_set(ses);
|
||||
|
|
|
|||
|
|
@ -385,8 +385,8 @@ static inline void __seg_info_to_raw_sit(struct seg_entry *se,
|
|||
rs->mtime = cpu_to_le64(se->mtime);
|
||||
}
|
||||
|
||||
static inline void seg_info_to_sit_page(struct f2fs_sb_info *sbi,
|
||||
struct page *page, unsigned int start)
|
||||
static inline void seg_info_to_sit_folio(struct f2fs_sb_info *sbi,
|
||||
struct folio *folio, unsigned int start)
|
||||
{
|
||||
struct f2fs_sit_block *raw_sit;
|
||||
struct seg_entry *se;
|
||||
|
|
@ -395,7 +395,7 @@ static inline void seg_info_to_sit_page(struct f2fs_sb_info *sbi,
|
|||
(unsigned long)MAIN_SEGS(sbi));
|
||||
int i;
|
||||
|
||||
raw_sit = (struct f2fs_sit_block *)page_address(page);
|
||||
raw_sit = folio_address(folio);
|
||||
memset(raw_sit, 0, PAGE_SIZE);
|
||||
for (i = 0; i < end - start; i++) {
|
||||
rs = &raw_sit->entries[i];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user