cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 12/13] fuse: drop redundant arguments to fuse_perform_write
Date: Fri, 19 May 2023 11:35:20 +0200	[thread overview]
Message-ID: <20230519093521.133226-13-hch@lst.de> (raw)
In-Reply-To: <20230519093521.133226-1-hch@lst.de>

pos is always equal to iocb->ki_pos, and mapping is always equal to
iocb->ki_filp->f_mapping.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/fuse/file.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index fd2f27f2144750..5f7b58798f99fc 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1280,13 +1280,13 @@ static inline unsigned int fuse_wr_pages(loff_t pos, size_t len,
 		     max_pages);
 }
 
-static ssize_t fuse_perform_write(struct kiocb *iocb,
-				  struct address_space *mapping,
-				  struct iov_iter *ii, loff_t pos)
+static ssize_t fuse_perform_write(struct kiocb *iocb, struct iov_iter *ii)
 {
+	struct address_space *mapping = iocb->ki_filp->f_mapping;
 	struct inode *inode = mapping->host;
 	struct fuse_conn *fc = get_fuse_conn(inode);
 	struct fuse_inode *fi = get_fuse_inode(inode);
+	loff_t pos = iocb->ki_pos;
 	int err = 0;
 	ssize_t res = 0;
 
@@ -1385,8 +1385,7 @@ static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		if (written < 0 || !iov_iter_count(from))
 			goto out;
 
-		written_buffered = fuse_perform_write(iocb, mapping, from,
-						      iocb->ki_pos);
+		written_buffered = fuse_perform_write(iocb, from);
 		if (written_buffered < 0) {
 			err = written_buffered;
 			goto out;
@@ -1406,7 +1405,7 @@ static ssize_t fuse_cache_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		written += written_buffered;
 		iocb->ki_pos += written_buffered;
 	} else {
-		written = fuse_perform_write(iocb, mapping, from, iocb->ki_pos);
+		written = fuse_perform_write(iocb, from);
 	}
 out:
 	current->backing_dev_info = NULL;
-- 
2.39.2


  parent reply	other threads:[~2023-05-19  9:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  9:35 [Cluster-devel] cleanup the filemap / direct I/O interaction Christoph Hellwig
2023-05-19  9:35 ` [Cluster-devel] [PATCH 01/13] iomap: update ki_pos a little later in iomap_dio_complete Christoph Hellwig
2023-05-21 23:40   ` Damien Le Moal
2023-07-06  0:18   ` [Cluster-devel] [f2fs-dev] " patchwork-bot+f2fs
2023-05-19  9:35 ` [Cluster-devel] [PATCH 02/13] filemap: update ki_pos in generic_perform_write Christoph Hellwig
2023-05-21 23:42   ` Damien Le Moal
2023-05-22  2:20   ` Xiubo Li
2023-05-19  9:35 ` [Cluster-devel] [PATCH 03/13] filemap: assign current->backing_dev_info " Christoph Hellwig
2023-05-21 23:44   ` Damien Le Moal
2023-05-22  2:22   ` Xiubo Li
2023-05-19  9:35 ` [Cluster-devel] [PATCH 04/13] filemap: add a kiocb_write_and_wait helper Christoph Hellwig
2023-05-21 23:46   ` Damien Le Moal
2023-05-19  9:35 ` [Cluster-devel] [PATCH 05/13] filemap: add a kiocb_invalidate_pages helper Christoph Hellwig
2023-05-21 23:51   ` Damien Le Moal
2023-05-19  9:35 ` [Cluster-devel] [PATCH 06/13] filemap: add a kiocb_invalidate_post_write helper Christoph Hellwig
2023-05-21 23:56   ` Damien Le Moal
2023-05-23 16:01     ` Christoph Hellwig
2023-05-19  9:35 ` [Cluster-devel] [PATCH 07/13] iomap: update ki_pos in iomap_file_buffered_write Christoph Hellwig
2023-05-22  0:01   ` Damien Le Moal
2023-05-23 16:02     ` Christoph Hellwig
2023-05-19  9:35 ` [Cluster-devel] [PATCH 08/13] iomap: assign current->backing_dev_info " Christoph Hellwig
2023-05-22  0:05   ` Damien Le Moal
2023-05-23  1:06   ` Darrick J. Wong
2023-05-23  3:30     ` Matthew Wilcox
2023-05-23 16:02       ` Christoph Hellwig
2023-05-19  9:35 ` [Cluster-devel] [PATCH 09/13] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages Christoph Hellwig
2023-05-22  0:07   ` Damien Le Moal
2023-05-19  9:35 ` [Cluster-devel] [PATCH 10/13] fs: factor out a direct_write_fallback helper Christoph Hellwig
2023-05-22  0:16   ` Damien Le Moal
2023-05-22 14:19   ` Miklos Szeredi
2023-05-23 16:03     ` Christoph Hellwig
2023-05-19  9:35 ` [Cluster-devel] [PATCH 11/13] fuse: update ki_pos in fuse_perform_write Christoph Hellwig
2023-05-22  0:18   ` Damien Le Moal
2023-05-19  9:35 ` Christoph Hellwig [this message]
2023-05-22  0:19   ` [Cluster-devel] [PATCH 12/13] fuse: drop redundant arguments to fuse_perform_write Damien Le Moal
2023-05-19  9:35 ` [Cluster-devel] [PATCH 13/13] fuse: use direct_write_fallback Christoph Hellwig
2023-05-22  0:20   ` Damien Le Moal
2023-05-23  1:12 ` [Cluster-devel] cleanup the filemap / direct I/O interaction Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230519093521.133226-13-hch@lst.de \
    --to=hch@lst.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).