Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs: Remove three arguments from block_write_end()

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>

authored by

Matthew Wilcox (Oracle) and committed by
Christian Brauner
b39f7d75 06a70535

+13 -19
+1 -1
block/fops.c
··· 507 507 void *fsdata) 508 508 { 509 509 int ret; 510 - ret = block_write_end(file, mapping, pos, len, copied, folio, fsdata); 510 + ret = block_write_end(pos, len, copied, folio); 511 511 512 512 folio_unlock(folio); 513 513 folio_put(folio);
+3 -4
fs/buffer.c
··· 2270 2270 } 2271 2271 EXPORT_SYMBOL(block_write_begin); 2272 2272 2273 - int block_write_end(struct file *file, struct address_space *mapping, 2274 - loff_t pos, unsigned len, unsigned copied, 2275 - struct folio *folio, void *fsdata) 2273 + int block_write_end(loff_t pos, unsigned len, unsigned copied, 2274 + struct folio *folio) 2276 2275 { 2277 2276 size_t start = pos - folio_pos(folio); 2278 2277 ··· 2310 2311 loff_t old_size = inode->i_size; 2311 2312 bool i_size_changed = false; 2312 2313 2313 - copied = block_write_end(file, mapping, pos, len, copied, folio, fsdata); 2314 + copied = block_write_end(pos, len, copied, folio); 2314 2315 2315 2316 /* 2316 2317 * No need to use i_size_read() here, the i_size cannot change under us
+1 -1
fs/ext2/dir.c
··· 87 87 struct inode *dir = mapping->host; 88 88 89 89 inode_inc_iversion(dir); 90 - block_write_end(NULL, mapping, pos, len, len, folio, NULL); 90 + block_write_end(pos, len, len, folio); 91 91 92 92 if (pos+len > dir->i_size) { 93 93 i_size_write(dir, pos+len);
+2 -3
fs/ext4/inode.c
··· 1424 1424 return ext4_write_inline_data_end(inode, pos, len, copied, 1425 1425 folio); 1426 1426 1427 - copied = block_write_end(file, mapping, pos, len, copied, folio, fsdata); 1427 + copied = block_write_end(pos, len, copied, folio); 1428 1428 /* 1429 1429 * it's important to update i_size while still holding folio lock: 1430 1430 * page writeout could otherwise come in and zero beyond i_size. ··· 3144 3144 * block_write_end() will mark the inode as dirty with I_DIRTY_PAGES 3145 3145 * flag, which all that's needed to trigger page writeback. 3146 3146 */ 3147 - copied = block_write_end(NULL, mapping, pos, len, copied, 3148 - folio, NULL); 3147 + copied = block_write_end(pos, len, copied, folio); 3149 3148 new_i_size = pos + copied; 3150 3149 3151 3150 /*
+1 -2
fs/iomap/buffered-io.c
··· 923 923 if (srcmap->flags & IOMAP_F_BUFFER_HEAD) { 924 924 size_t bh_written; 925 925 926 - bh_written = block_write_end(NULL, iter->inode->i_mapping, pos, 927 - len, copied, folio, NULL); 926 + bh_written = block_write_end(pos, len, copied, folio); 928 927 WARN_ON_ONCE(bh_written != copied && bh_written != 0); 929 928 return bh_written == copied; 930 929 }
+1 -1
fs/minix/dir.c
··· 45 45 struct address_space *mapping = folio->mapping; 46 46 struct inode *dir = mapping->host; 47 47 48 - block_write_end(NULL, mapping, pos, len, len, folio, NULL); 48 + block_write_end(pos, len, len, folio); 49 49 50 50 if (pos+len > dir->i_size) { 51 51 i_size_write(dir, pos+len);
+1 -1
fs/nilfs2/dir.c
··· 96 96 int err; 97 97 98 98 nr_dirty = nilfs_page_count_clean_buffers(folio, from, to); 99 - copied = block_write_end(NULL, mapping, pos, len, len, folio, NULL); 99 + copied = block_write_end(pos, len, len, folio); 100 100 if (pos + copied > dir->i_size) 101 101 i_size_write(dir, pos + copied); 102 102 if (IS_DIRSYNC(dir))
+1 -2
fs/nilfs2/recovery.c
··· 560 560 if (unlikely(err)) 561 561 goto failed_folio; 562 562 563 - block_write_end(NULL, inode->i_mapping, pos, blocksize, 564 - blocksize, folio, NULL); 563 + block_write_end(pos, blocksize, blocksize, folio); 565 564 566 565 folio_unlock(folio); 567 566 folio_put(folio);
+1 -1
fs/ufs/dir.c
··· 48 48 struct inode *dir = mapping->host; 49 49 50 50 inode_inc_iversion(dir); 51 - block_write_end(NULL, mapping, pos, len, len, folio, NULL); 51 + block_write_end(pos, len, len, folio); 52 52 if (pos+len > dir->i_size) { 53 53 i_size_write(dir, pos+len); 54 54 mark_inode_dirty(dir);
+1 -3
include/linux/buffer_head.h
··· 262 262 struct folio **foliop, get_block_t *get_block); 263 263 int __block_write_begin(struct folio *folio, loff_t pos, unsigned len, 264 264 get_block_t *get_block); 265 - int block_write_end(struct file *, struct address_space *, 266 - loff_t, unsigned len, unsigned copied, 267 - struct folio *, void *); 265 + int block_write_end(loff_t pos, unsigned len, unsigned copied, struct folio *); 268 266 int generic_write_end(struct file *, struct address_space *, 269 267 loff_t, unsigned len, unsigned copied, 270 268 struct folio *, void *);