Skip to content

Commit 26ddb1f

Browse files
Andreas Gruenbacherdjwong
authored andcommitted
fs: Turn __generic_write_end into a void function
The VFS-internal __generic_write_end helper always returns the value of its @copied argument. This can be confusing, and it isn't very useful anyway, so turn __generic_write_end into a function returning void instead. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent dbc582b commit 26ddb1f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

fs/buffer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
20852085
}
20862086
EXPORT_SYMBOL(block_write_begin);
20872087

2088-
int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
2088+
void __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
20892089
struct page *page)
20902090
{
20912091
loff_t old_size = inode->i_size;
@@ -2116,7 +2116,6 @@ int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
21162116
*/
21172117
if (i_size_changed)
21182118
mark_inode_dirty(inode);
2119-
return copied;
21202119
}
21212120

21222121
int block_write_end(struct file *file, struct address_space *mapping,
@@ -2160,7 +2159,8 @@ int generic_write_end(struct file *file, struct address_space *mapping,
21602159
struct page *page, void *fsdata)
21612160
{
21622161
copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
2163-
return __generic_write_end(mapping->host, pos, copied, page);
2162+
__generic_write_end(mapping->host, pos, copied, page);
2163+
return copied;
21642164
}
21652165
EXPORT_SYMBOL(generic_write_end);
21662166

fs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static inline int __sync_blockdev(struct block_device *bdev, int wait)
4444
extern void guard_bio_eod(int rw, struct bio *bio);
4545
extern int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
4646
get_block_t *get_block, struct iomap *iomap);
47-
int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
47+
void __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
4848
struct page *page);
4949

5050
/*

fs/iomap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
769769
ret = __iomap_write_end(inode, pos, len, copied, page, iomap);
770770
}
771771

772-
ret = __generic_write_end(inode, pos, ret, page);
772+
__generic_write_end(inode, pos, ret, page);
773773
if (iomap->page_done)
774774
iomap->page_done(inode, pos, copied, page, iomap);
775775

0 commit comments

Comments
 (0)