fs: Turn __generic_write_end into a void function
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 30 Apr 2019 15:45:33 +0000 (08:45 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 1 May 2019 14:47:37 +0000 (07:47 -0700)
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>
fs/buffer.c
fs/internal.h
fs/iomap.c

index ce357602f471dbe1ebf7f998af50d69d5884ba4a..e0d4c6a5e2d2abc73d5f6341f1116f2f8285458c 100644 (file)
@@ -2085,7 +2085,7 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
 }
 EXPORT_SYMBOL(block_write_begin);
 
-int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
+void __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
                struct page *page)
 {
        loff_t old_size = inode->i_size;
@@ -2116,7 +2116,6 @@ int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
         */
        if (i_size_changed)
                mark_inode_dirty(inode);
-       return copied;
 }
 
 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,
                        struct page *page, void *fsdata)
 {
        copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
-       return __generic_write_end(mapping->host, pos, copied, page);
+       __generic_write_end(mapping->host, pos, copied, page);
+       return copied;
 }
 EXPORT_SYMBOL(generic_write_end);
 
index 6a8b71643af40375fbdffa1af506510dd120acd3..530587fdf5d8c1ffce0ec8c9eab2b60b458ac6a1 100644 (file)
@@ -44,7 +44,7 @@ static inline int __sync_blockdev(struct block_device *bdev, int wait)
 extern void guard_bio_eod(int rw, struct bio *bio);
 extern int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
                get_block_t *get_block, struct iomap *iomap);
-int __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
+void __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
                struct page *page);
 
 /*
index 9f159c39fbdcb65f73f4a865fcd3c37c1687be7f..4380d2c412f4527461bc87f2f104e4ffc40768bf 100644 (file)
@@ -769,7 +769,7 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
                ret = __iomap_write_end(inode, pos, len, copied, page, iomap);
        }
 
-       ret = __generic_write_end(inode, pos, ret, page);
+       __generic_write_end(inode, pos, ret, page);
        if (iomap->page_done)
                iomap->page_done(inode, pos, copied, page, iomap);