Skip to content

Commit c1d73eb

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
nilfs2: convert nilfs_page_count_clean_buffers() to take a folio
Both callers have a folio, so pass it in and use it directly. [[email protected]: fixed a checkpatch warning about function declaration] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Ryusuke Konishi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 3102932 commit c1d73eb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

fs/nilfs2/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void nilfs_commit_chunk(struct folio *folio,
9595
unsigned int nr_dirty;
9696
int err;
9797

98-
nr_dirty = nilfs_page_count_clean_buffers(&folio->page, from, to);
98+
nr_dirty = nilfs_page_count_clean_buffers(folio, from, to);
9999
copied = block_write_end(NULL, mapping, pos, len, len, folio, NULL);
100100
if (pos + copied > dir->i_size)
101101
i_size_write(dir, pos + copied);

fs/nilfs2/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int nilfs_write_end(struct file *file, struct address_space *mapping,
242242
unsigned int nr_dirty;
243243
int err;
244244

245-
nr_dirty = nilfs_page_count_clean_buffers(&folio->page, start,
245+
nr_dirty = nilfs_page_count_clean_buffers(folio, start,
246246
start + copied);
247247
copied = generic_write_end(file, mapping, pos, len, copied, folio,
248248
fsdata);

fs/nilfs2/page.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,14 @@ void nilfs_clear_folio_dirty(struct folio *folio)
422422
__nilfs_clear_folio_dirty(folio);
423423
}
424424

425-
unsigned int nilfs_page_count_clean_buffers(struct page *page,
425+
unsigned int nilfs_page_count_clean_buffers(struct folio *folio,
426426
unsigned int from, unsigned int to)
427427
{
428428
unsigned int block_start, block_end;
429429
struct buffer_head *bh, *head;
430430
unsigned int nc = 0;
431431

432-
for (bh = head = page_buffers(page), block_start = 0;
432+
for (bh = head = folio_buffers(folio), block_start = 0;
433433
bh != head || !block_start;
434434
block_start = block_end, bh = bh->b_this_page) {
435435
block_end = block_start + bh->b_size;

fs/nilfs2/page.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
4343
void nilfs_copy_back_pages(struct address_space *, struct address_space *);
4444
void nilfs_clear_folio_dirty(struct folio *folio);
4545
void nilfs_clear_dirty_pages(struct address_space *mapping);
46-
unsigned int nilfs_page_count_clean_buffers(struct page *, unsigned int,
47-
unsigned int);
46+
unsigned int nilfs_page_count_clean_buffers(struct folio *folio,
47+
unsigned int from, unsigned int to);
4848
unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
4949
sector_t start_blk,
5050
sector_t *blkoff);

0 commit comments

Comments
 (0)