From patchwork Tue Jan 15 10:19:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10764245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 728BC13B5 for ; Tue, 15 Jan 2019 10:19:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 610EA2B2ED for ; Tue, 15 Jan 2019 10:19:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5572F2B2FF; Tue, 15 Jan 2019 10:19:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E43A22B2ED for ; Tue, 15 Jan 2019 10:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbfAOKTj (ORCPT ); Tue, 15 Jan 2019 05:19:39 -0500 Received: from relay.sw.ru ([185.231.240.75]:36304 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfAOKTj (ORCPT ); Tue, 15 Jan 2019 05:19:39 -0500 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gjLom-00012o-OA; Tue, 15 Jan 2019 13:19:36 +0300 Subject: [PATCH 4/7] fuse: Add fud pointer to struct fuse_copy_state From: Kirill Tkhai To: miklos@szeredi.hu, ktkhai@virtuozzo.com, linux-fsdevel@vger.kernel.org Date: Tue, 15 Jan 2019 13:19:36 +0300 Message-ID: <154754757625.4244.1439886690789751308.stgit@localhost.localdomain> In-Reply-To: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain> References: <154754701031.4244.8089449938935364463.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... and propagate fud into fuse_copy_init(). This is preparation for next patches. Signed-off-by: Kirill Tkhai --- 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;