]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nilfs2: convert nilfs_page_count_clean_buffers() to take a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 24 Oct 2024 09:25:44 +0000 (18:25 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 6 Nov 2024 01:12:39 +0000 (17:12 -0800)
Both callers have a folio, so pass it in and use it directly.

[konishi.ryusuke@gmail.com: fixed a checkpatch warning about function declaration]
Link: https://lkml.kernel.org/r/20241002150036.1339475-3-willy@infradead.org
Link: https://lkml.kernel.org/r/20241024092602.13395-11-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/nilfs2/dir.c
fs/nilfs2/inode.c
fs/nilfs2/page.c
fs/nilfs2/page.h

index a8602729586ab7b9058fd6726e9e5f6436be307b..14e8d82f862980d8018a99a27dafa2342f0e786f 100644 (file)
@@ -95,7 +95,7 @@ static void nilfs_commit_chunk(struct folio *folio,
        unsigned int nr_dirty;
        int err;
 
-       nr_dirty = nilfs_page_count_clean_buffers(&folio->page, from, to);
+       nr_dirty = nilfs_page_count_clean_buffers(folio, from, to);
        copied = block_write_end(NULL, mapping, pos, len, len, folio, NULL);
        if (pos + copied > dir->i_size)
                i_size_write(dir, pos + copied);
index c24f06268010b1410312cfa1949f340890c24590..cf9ba481ae376083175643c5233044d5ca2fadca 100644 (file)
@@ -242,7 +242,7 @@ static int nilfs_write_end(struct file *file, struct address_space *mapping,
        unsigned int nr_dirty;
        int err;
 
-       nr_dirty = nilfs_page_count_clean_buffers(&folio->page, start,
+       nr_dirty = nilfs_page_count_clean_buffers(folio, start,
                                                  start + copied);
        copied = generic_write_end(file, mapping, pos, len, copied, folio,
                                   fsdata);
index 10def4b55995631b0e01905d5a1b1d97be10d65a..e48079ebe93972dce2919ab38c34c9a80e72909b 100644 (file)
@@ -422,14 +422,14 @@ void nilfs_clear_folio_dirty(struct folio *folio)
        __nilfs_clear_folio_dirty(folio);
 }
 
-unsigned int nilfs_page_count_clean_buffers(struct page *page,
+unsigned int nilfs_page_count_clean_buffers(struct folio *folio,
                                            unsigned int from, unsigned int to)
 {
        unsigned int block_start, block_end;
        struct buffer_head *bh, *head;
        unsigned int nc = 0;
 
-       for (bh = head = page_buffers(page), block_start = 0;
+       for (bh = head = folio_buffers(folio), block_start = 0;
             bh != head || !block_start;
             block_start = block_end, bh = bh->b_this_page) {
                block_end = block_start + bh->b_size;
index 64521a03a19e06f44e5f5464bb9feb36e0da828d..136cd1c143c9c1844a0cf5643dcfad11cfd11614 100644 (file)
@@ -43,8 +43,8 @@ int nilfs_copy_dirty_pages(struct address_space *, struct address_space *);
 void nilfs_copy_back_pages(struct address_space *, struct address_space *);
 void nilfs_clear_folio_dirty(struct folio *folio);
 void nilfs_clear_dirty_pages(struct address_space *mapping);
-unsigned int nilfs_page_count_clean_buffers(struct page *, unsigned int,
-                                           unsigned int);
+unsigned int nilfs_page_count_clean_buffers(struct folio *folio,
+               unsigned int from, unsigned int to);
 unsigned long nilfs_find_uncommitted_extent(struct inode *inode,
                                            sector_t start_blk,
                                            sector_t *blkoff);