linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org
Subject: [PATCH 4/7] fuse: Add fud pointer to struct fuse_copy_state
Date: Tue, 15 Jan 2019 13:19:36 +0300	[thread overview]
Message-ID: <154754757625.4244.1439886690789751308.stgit@localhost.localdomain> (raw)
In-Reply-To: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain>

... and propagate fud into fuse_copy_init().

This is preparation for next patches.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/dev.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index b393fbedcc1f..afadf462ec18 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -769,6 +769,7 @@ static int unlock_request(struct fuse_req *req)
 }
 
 struct fuse_copy_state {
+	struct fuse_dev *fud;
 	int write;
 	struct fuse_req *req;
 	struct iov_iter *iter;
@@ -782,10 +783,12 @@ struct fuse_copy_state {
 	unsigned move_pages:1;
 };
 
-static void fuse_copy_init(struct fuse_copy_state *cs, int write,
+static void fuse_copy_init(struct fuse_copy_state *cs,
+		           struct fuse_dev *fud, int write,
 			   struct iov_iter *iter)
 {
 	memset(cs, 0, sizeof(*cs));
+	cs->fud = fud;
 	cs->write = write;
 	cs->iter = iter;
 }
@@ -1436,7 +1439,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, struct iov_iter *to)
 	if (!iter_is_iovec(to))
 		return -EINVAL;
 
-	fuse_copy_init(&cs, 1, to);
+	fuse_copy_init(&cs, fud, 1, to);
 
 	return fuse_dev_do_read(fud, file, &cs, iov_iter_count(to));
 }
@@ -1459,7 +1462,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
 	if (!bufs)
 		return -ENOMEM;
 
-	fuse_copy_init(&cs, 1, NULL);
+	fuse_copy_init(&cs, fud, 1, NULL);
 	cs.pipebufs = bufs;
 	cs.pipe = pipe;
 	ret = fuse_dev_do_read(fud, in, &cs, len);
@@ -2020,7 +2023,7 @@ static ssize_t fuse_dev_write(struct kiocb *iocb, struct iov_iter *from)
 	if (!iter_is_iovec(from))
 		return -EINVAL;
 
-	fuse_copy_init(&cs, 0, from);
+	fuse_copy_init(&cs, fud, 0, from);
 
 	return fuse_dev_do_write(fud, &cs, iov_iter_count(from));
 }
@@ -2089,7 +2092,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
 	}
 	pipe_unlock(pipe);
 
-	fuse_copy_init(&cs, 0, NULL);
+	fuse_copy_init(&cs, fud, 0, NULL);
 	cs.pipebufs = bufs;
 	cs.nr_segs = nbuf;
 	cs.pipe = pipe;


  parent reply	other threads:[~2019-01-15 10:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 10:19 [PATCH 0/7] fuse: Improve disconnect scheme and avoid taking fpq->lock on hot paths Kirill Tkhai
2019-01-15 10:19 ` [PATCH 1/7] fuse: Check for fc->connected in fuse_dev_alloc() Kirill Tkhai
2019-01-18 12:07   ` Miklos Szeredi
2019-01-18 12:28     ` Kirill Tkhai
2019-01-23  9:45       ` Miklos Szeredi
2019-01-23  9:55         ` Kirill Tkhai
2019-01-23 10:24           ` Miklos Szeredi
2019-01-15 10:19 ` [PATCH 2/7] fuse: Move flush_bg_queue() up in fuse_abort_conn() Kirill Tkhai
2019-01-15 10:19 ` [PATCH 3/7] fuse: Drop and reacquire fc->lock in middle of fuse_abort_conn() Kirill Tkhai
2019-01-15 10:19 ` Kirill Tkhai [this message]
2019-01-15 10:19 ` [PATCH 5/7] fuse: Introduce generic fuse_copy_aborted() Kirill Tkhai
2019-01-17  9:48   ` Miklos Szeredi
2019-01-15 10:19 ` [PATCH 6/7] fuse: Kill unused FR_ABORTED, FR_LOCKED and FR_PRIVATE flags Kirill Tkhai
2019-01-15 10:19 ` [PATCH 7/7] fuse: Kill fuse_pqueue::io list and avoid taking fpq->lock on hot paths Kirill Tkhai

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=154754757625.4244.1439886690789751308.stgit@localhost.localdomain \
    --to=ktkhai@virtuozzo.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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 NNTP newsgroup(s).