]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: Remove three arguments from block_write_end()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 24 Jun 2025 13:21:27 +0000 (14:21 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 24 Jun 2025 13:53:40 +0000 (15:53 +0200)
block_write_end() looks like it can be used as a ->write_end()
implementation.  However, it can't as it does not unlock nor put
the folio.  Since it does not use the 'file', 'mapping' nor 'fsdata'
arguments, remove them.

Signed-off-by: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Link: https://lore.kernel.org/20250624132130.1590285-1-willy@infradead.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
block/fops.c
fs/buffer.c
fs/ext2/dir.c
fs/ext4/inode.c
fs/iomap/buffered-io.c
fs/minix/dir.c
fs/nilfs2/dir.c
fs/nilfs2/recovery.c
fs/ufs/dir.c
include/linux/buffer_head.h

index 1309861d4c2c4b88be375136eb83e34299ef7616..35cea0cb304d03d988ab9c0f8a285da45728f783 100644 (file)
@@ -507,7 +507,7 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping,
                void *fsdata)
 {
        int ret;
-       ret = block_write_end(file, mapping, pos, len, copied, folio, fsdata);
+       ret = block_write_end(pos, len, copied, folio);
 
        folio_unlock(folio);
        folio_put(folio);
index 1d34200f69c8ff42e54f648cea4087b194345e58..d6107314312774ee6077d8da386dbe3c39222fa2 100644 (file)
@@ -2270,9 +2270,8 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
 }
 EXPORT_SYMBOL(block_write_begin);
 
-int block_write_end(struct file *file, struct address_space *mapping,
-                       loff_t pos, unsigned len, unsigned copied,
-                       struct folio *folio, void *fsdata)
+int block_write_end(loff_t pos, unsigned len, unsigned copied,
+               struct folio *folio)
 {
        size_t start = pos - folio_pos(folio);
 
@@ -2311,7 +2310,7 @@ int generic_write_end(struct file *file, struct address_space *mapping,
        loff_t old_size = inode->i_size;
        bool i_size_changed = false;
 
-       copied = block_write_end(file, mapping, pos, len, copied, folio, fsdata);
+       copied = block_write_end(pos, len, copied, folio);
 
        /*
         * No need to use i_size_read() here, the i_size cannot change under us
index 402fecf90a44b8b42dda270d681b6629f56c3ebf..b07b3b369710c4848d6091742cdd0b5c42d4674d 100644 (file)
@@ -87,7 +87,7 @@ static void ext2_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
        struct inode *dir = mapping->host;
 
        inode_inc_iversion(dir);
-       block_write_end(NULL, mapping, pos, len, len, folio, NULL);
+       block_write_end(pos, len, len, folio);
 
        if (pos+len > dir->i_size) {
                i_size_write(dir, pos+len);
index be9a4cba35fd523adce76b3b22a9677fbd86264b..e6aa7ca6d8420880c29396976d4fa5150fa95885 100644 (file)
@@ -1424,7 +1424,7 @@ static int ext4_write_end(struct file *file,
                return ext4_write_inline_data_end(inode, pos, len, copied,
                                                  folio);
 
-       copied = block_write_end(file, mapping, pos, len, copied, folio, fsdata);
+       copied = block_write_end(pos, len, copied, folio);
        /*
         * it's important to update i_size while still holding folio lock:
         * page writeout could otherwise come in and zero beyond i_size.
@@ -3144,8 +3144,7 @@ static int ext4_da_do_write_end(struct address_space *mapping,
         * block_write_end() will mark the inode as dirty with I_DIRTY_PAGES
         * flag, which all that's needed to trigger page writeback.
         */
-       copied = block_write_end(NULL, mapping, pos, len, copied,
-                       folio, NULL);
+       copied = block_write_end(pos, len, copied, folio);
        new_i_size = pos + copied;
 
        /*
index 3729391a18f32bc9830baa7273e84028bb42b099..775e8f1f02863c22eac469e67dd4a98c20f78207 100644 (file)
@@ -923,8 +923,7 @@ static bool iomap_write_end(struct iomap_iter *iter, size_t len, size_t copied,
        if (srcmap->flags & IOMAP_F_BUFFER_HEAD) {
                size_t bh_written;
 
-               bh_written = block_write_end(NULL, iter->inode->i_mapping, pos,
-                                       len, copied, folio, NULL);
+               bh_written = block_write_end(pos, len, copied, folio);
                WARN_ON_ONCE(bh_written != copied && bh_written != 0);
                return bh_written == copied;
        }
index dd2a425b41f044872dc46e3d514f0a7ad77c8ac0..19052fc47e9ea75dbbfb2c2770c4dd8f716e7d7c 100644 (file)
@@ -45,7 +45,7 @@ static void dir_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
        struct address_space *mapping = folio->mapping;
        struct inode *dir = mapping->host;
 
-       block_write_end(NULL, mapping, pos, len, len, folio, NULL);
+       block_write_end(pos, len, len, folio);
 
        if (pos+len > dir->i_size) {
                i_size_write(dir, pos+len);
index 9b7f8e9655a277b0009ce9af1bae95c3cba96296..6ca3d74be1e16d5bc577e2520f1e841287a2511f 100644 (file)
@@ -96,7 +96,7 @@ static void nilfs_commit_chunk(struct folio *folio,
        int err;
 
        nr_dirty = nilfs_page_count_clean_buffers(folio, from, to);
-       copied = block_write_end(NULL, mapping, pos, len, len, folio, NULL);
+       copied = block_write_end(pos, len, len, folio);
        if (pos + copied > dir->i_size)
                i_size_write(dir, pos + copied);
        if (IS_DIRSYNC(dir))
index 22aecf6e23445e6b5a21beb065502babcc3c52c8..a9c61d0492cbd4e78980328ef2949cfb7c30ca28 100644 (file)
@@ -560,8 +560,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
                if (unlikely(err))
                        goto failed_folio;
 
-               block_write_end(NULL, inode->i_mapping, pos, blocksize,
-                               blocksize, folio, NULL);
+               block_write_end(pos, blocksize, blocksize, folio);
 
                folio_unlock(folio);
                folio_put(folio);
index 88d0062cfdb9eb0e6e7c38e6edf842e23c7c503f..0388a1bae326ba41bc03471fcb7ed01098a707d8 100644 (file)
@@ -48,7 +48,7 @@ static void ufs_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
        struct inode *dir = mapping->host;
 
        inode_inc_iversion(dir);
-       block_write_end(NULL, mapping, pos, len, len, folio, NULL);
+       block_write_end(pos, len, len, folio);
        if (pos+len > dir->i_size) {
                i_size_write(dir, pos+len);
                mark_inode_dirty(dir);
index 0029ff880e27483baf90bb80daf9b914b857ca0d..178eb90e9cf3068f55ebf260e5c58ced3b306c18 100644 (file)
@@ -262,9 +262,7 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
                struct folio **foliop, get_block_t *get_block);
 int __block_write_begin(struct folio *folio, loff_t pos, unsigned len,
                get_block_t *get_block);
-int block_write_end(struct file *, struct address_space *,
-                               loff_t, unsigned len, unsigned copied,
-                               struct folio *, void *);
+int block_write_end(loff_t pos, unsigned len, unsigned copied, struct folio *);
 int generic_write_end(struct file *, struct address_space *,
                                loff_t, unsigned len, unsigned copied,
                                struct folio *, void *);