summaryrefslogtreecommitdiff
path: root/fs/9p/vfs_addr.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2021-11-02 16:16:43 +0300
committerDominique Martinet <asmadeus@codewreck.org>2021-11-04 15:04:25 +0300
commit6e195b0f7c8e50927fa31946369c22a0534ec7e2 (patch)
tree3ea5eedbf582fca37aacba19dbfc59ffa0df6ffe /fs/9p/vfs_addr.c
parentb1843d23854aeae95ce92a3432bc1bea4cdbb2e7 (diff)
downloadlinux-6e195b0f7c8e50927fa31946369c22a0534ec7e2.tar.xz
9p: fix a bunch of checkpatch warnings
Sohaib Mohamed started a serie of tiny and incomplete checkpatch fixes but seemingly stopped halfway -- take over and do most of it. This is still missing net/9p/trans* and net/9p/protocol.c for a later time... Link: http://lkml.kernel.org/r/20211102134608.1588018-3-dominique.martinet@atmark-techno.com Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'fs/9p/vfs_addr.c')
-rw-r--r--fs/9p/vfs_addr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index fc8feb4f320e..adafdf86f42f 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -247,11 +247,13 @@ v9fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
loff_t pos = iocb->ki_pos;
ssize_t n;
int err = 0;
+
if (iov_iter_rw(iter) == WRITE) {
n = p9_client_write(file->private_data, pos, iter, &err);
if (n) {
struct inode *inode = file_inode(file);
loff_t i_size = i_size_read(inode);
+
if (pos + n > i_size)
inode_add_bytes(inode, pos + n - i_size);
}
@@ -262,7 +264,7 @@ v9fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
}
static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned flags,
+ loff_t pos, unsigned int len, unsigned int flags,
struct page **pagep, void **fsdata)
{
int retval;
@@ -287,7 +289,7 @@ static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
}
static int v9fs_write_end(struct file *filp, struct address_space *mapping,
- loff_t pos, unsigned len, unsigned copied,
+ loff_t pos, unsigned int len, unsigned int copied,
struct page *page, void *fsdata)
{
loff_t last_pos = pos + copied;