mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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>
This commit is contained in:
parent
06a705356d
commit
b39f7d75dc
@ -507,7 +507,7 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping,
|
|||||||
void *fsdata)
|
void *fsdata)
|
||||||
{
|
{
|
||||||
int ret;
|
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_unlock(folio);
|
||||||
folio_put(folio);
|
folio_put(folio);
|
||||||
|
@ -2270,9 +2270,8 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(block_write_begin);
|
EXPORT_SYMBOL(block_write_begin);
|
||||||
|
|
||||||
int block_write_end(struct file *file, struct address_space *mapping,
|
int block_write_end(loff_t pos, unsigned len, unsigned copied,
|
||||||
loff_t pos, unsigned len, unsigned copied,
|
struct folio *folio)
|
||||||
struct folio *folio, void *fsdata)
|
|
||||||
{
|
{
|
||||||
size_t start = pos - folio_pos(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;
|
loff_t old_size = inode->i_size;
|
||||||
bool i_size_changed = false;
|
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
|
* No need to use i_size_read() here, the i_size cannot change under us
|
||||||
|
@ -87,7 +87,7 @@ static void ext2_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
|
|||||||
struct inode *dir = mapping->host;
|
struct inode *dir = mapping->host;
|
||||||
|
|
||||||
inode_inc_iversion(dir);
|
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) {
|
if (pos+len > dir->i_size) {
|
||||||
i_size_write(dir, pos+len);
|
i_size_write(dir, pos+len);
|
||||||
|
@ -1424,7 +1424,7 @@ static int ext4_write_end(struct file *file,
|
|||||||
return ext4_write_inline_data_end(inode, pos, len, copied,
|
return ext4_write_inline_data_end(inode, pos, len, copied,
|
||||||
folio);
|
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:
|
* it's important to update i_size while still holding folio lock:
|
||||||
* page writeout could otherwise come in and zero beyond i_size.
|
* 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
|
* block_write_end() will mark the inode as dirty with I_DIRTY_PAGES
|
||||||
* flag, which all that's needed to trigger page writeback.
|
* flag, which all that's needed to trigger page writeback.
|
||||||
*/
|
*/
|
||||||
copied = block_write_end(NULL, mapping, pos, len, copied,
|
copied = block_write_end(pos, len, copied, folio);
|
||||||
folio, NULL);
|
|
||||||
new_i_size = pos + copied;
|
new_i_size = pos + copied;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -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) {
|
if (srcmap->flags & IOMAP_F_BUFFER_HEAD) {
|
||||||
size_t bh_written;
|
size_t bh_written;
|
||||||
|
|
||||||
bh_written = block_write_end(NULL, iter->inode->i_mapping, pos,
|
bh_written = block_write_end(pos, len, copied, folio);
|
||||||
len, copied, folio, NULL);
|
|
||||||
WARN_ON_ONCE(bh_written != copied && bh_written != 0);
|
WARN_ON_ONCE(bh_written != copied && bh_written != 0);
|
||||||
return bh_written == copied;
|
return bh_written == copied;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ static void dir_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
|
|||||||
struct address_space *mapping = folio->mapping;
|
struct address_space *mapping = folio->mapping;
|
||||||
struct inode *dir = mapping->host;
|
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) {
|
if (pos+len > dir->i_size) {
|
||||||
i_size_write(dir, pos+len);
|
i_size_write(dir, pos+len);
|
||||||
|
@ -96,7 +96,7 @@ static void nilfs_commit_chunk(struct folio *folio,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
nr_dirty = nilfs_page_count_clean_buffers(folio, from, to);
|
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)
|
if (pos + copied > dir->i_size)
|
||||||
i_size_write(dir, pos + copied);
|
i_size_write(dir, pos + copied);
|
||||||
if (IS_DIRSYNC(dir))
|
if (IS_DIRSYNC(dir))
|
||||||
|
@ -560,8 +560,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
|
|||||||
if (unlikely(err))
|
if (unlikely(err))
|
||||||
goto failed_folio;
|
goto failed_folio;
|
||||||
|
|
||||||
block_write_end(NULL, inode->i_mapping, pos, blocksize,
|
block_write_end(pos, blocksize, blocksize, folio);
|
||||||
blocksize, folio, NULL);
|
|
||||||
|
|
||||||
folio_unlock(folio);
|
folio_unlock(folio);
|
||||||
folio_put(folio);
|
folio_put(folio);
|
||||||
|
@ -48,7 +48,7 @@ static void ufs_commit_chunk(struct folio *folio, loff_t pos, unsigned len)
|
|||||||
struct inode *dir = mapping->host;
|
struct inode *dir = mapping->host;
|
||||||
|
|
||||||
inode_inc_iversion(dir);
|
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) {
|
if (pos+len > dir->i_size) {
|
||||||
i_size_write(dir, pos+len);
|
i_size_write(dir, pos+len);
|
||||||
mark_inode_dirty(dir);
|
mark_inode_dirty(dir);
|
||||||
|
@ -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);
|
struct folio **foliop, get_block_t *get_block);
|
||||||
int __block_write_begin(struct folio *folio, loff_t pos, unsigned len,
|
int __block_write_begin(struct folio *folio, loff_t pos, unsigned len,
|
||||||
get_block_t *get_block);
|
get_block_t *get_block);
|
||||||
int block_write_end(struct file *, struct address_space *,
|
int block_write_end(loff_t pos, unsigned len, unsigned copied, struct folio *);
|
||||||
loff_t, unsigned len, unsigned copied,
|
|
||||||
struct folio *, void *);
|
|
||||||
int generic_write_end(struct file *, struct address_space *,
|
int generic_write_end(struct file *, struct address_space *,
|
||||||
loff_t, unsigned len, unsigned copied,
|
loff_t, unsigned len, unsigned copied,
|
||||||
struct folio *, void *);
|
struct folio *, void *);
|
||||||
|
Loading…
Reference in New Issue
Block a user