From patchwork Fri Mar 10 16:20:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomohiro Kusumi X-Patchwork-Id: 9617729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 313B560417 for ; Fri, 10 Mar 2017 16:20:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E75628451 for ; Fri, 10 Mar 2017 16:20:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 114FD2871A; Fri, 10 Mar 2017 16:20:43 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 5A0A028451 for ; Fri, 10 Mar 2017 16:20:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933063AbdCJQUl (ORCPT ); Fri, 10 Mar 2017 11:20:41 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:32989 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932485AbdCJQUj (ORCPT ); Fri, 10 Mar 2017 11:20:39 -0500 Received: by mail-lf0-f68.google.com with SMTP id r36so7240998lfi.0 for ; Fri, 10 Mar 2017 08:20:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/HiyCir9+XI4QwSbbIyQ/e6Bz5ghE2tvHxgVt8utxL4=; b=LrJ4vCk8QTRJaRh8RWQ149sxACqXNKK1UsZRY+wewdgGxUbQADMU2KPGzqG0zrLGQx R3htIs4XOt2j0se/eV4vTktwtiq7enicLJaeAElDDAkGvoYGJOz1KvZs4xvGoQE0ic+t kg3Q8zfL28PFzI60P9HJd/6z/ySPmn2rG/eIloi0XK9/cakKOJMwJuvsqEaYO5hpfap6 eQVLvDCEK2EY4pu7IVDiVQybufpGe53ntImAZPCgPTZHOGjzK9qoVaq8ljb5uJtZtYpx hC8yCZT+amNNJBvR4WYBYcnitHZDrdRn58s8D9KhJUEMRCuEnNkqDK2qOGQ2AggLDrg/ NlSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/HiyCir9+XI4QwSbbIyQ/e6Bz5ghE2tvHxgVt8utxL4=; b=V0NUvPgGmLhkcEXsyuBWtAAXL8jhzQ6h1rO8N1guozQ6Jq0y5dXELxhbiEZDk/7Fpw 1ajwIuk65GiyRcPO8GJKnLdq1hdiiQMNl/3SxcjAlDGZy3L2mMJOKJS3VBhroAZnokMd 9P86ocJoQun6o5iFAO+f2gnDyLB/c3n7O4InVNvT4ZqwZfvXG/OfnuzFW+bKmgCD4o8e uszwcMfZTVOnKDbUTf8ksiBXLLAv6uOFw9eDmbLdJwZzJEM7Gy7CdV7grNjEsssXZcYP c/4Fj/8T1ZnVVk2bX7MSIv5WqGOB/iJppYXmbwPPcDTdDrYXiu30DxqmgLHamb8Jz6Im feIw== X-Gm-Message-State: AMke39mYnX7JEgKHKE+krPCwJ7phLGi8kb4PwkzeqTjdblPpHdYxPEuiauzMYIh4mKL7hg== X-Received: by 10.46.92.195 with SMTP id q186mr6508167ljb.107.1489162837264; Fri, 10 Mar 2017 08:20:37 -0800 (PST) Received: from localhost.localdomain ([194.100.106.190]) by smtp.gmail.com with ESMTPSA id g26sm1923900lfh.46.2017.03.10.08.20.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2017 08:20:36 -0800 (PST) From: kusumi.tomohiro@gmail.com X-Google-Original-From: tkusumi@tuxera.com To: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org Cc: Tomohiro Kusumi Subject: [PATCH] fuse: rename struct fuse_arg to fuse_out_arg Date: Fri, 10 Mar 2017 18:20:14 +0200 Message-Id: <20170310162014.1799-1-tkusumi@tuxera.com> X-Mailer: git-send-email 2.9.3 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 From: Tomohiro Kusumi Use the same naming scheme as in arg. There's also struct fuse_args as temporary holder of in/out args before in/out args get copied to a fuse request, which makes these structures a bit confusing. Signed-off-by: Tomohiro Kusumi --- fs/fuse/dev.c | 17 ++++++++++------- fs/fuse/fuse_i.h | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index f117926..3bb180c 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -288,7 +288,10 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req) } EXPORT_SYMBOL_GPL(fuse_put_request); -static unsigned len_args(unsigned numargs, struct fuse_arg *args) +/* + * This function also works for fuse_in_arg + */ +static unsigned len_args(unsigned numargs, struct fuse_out_arg *args) { unsigned nbytes = 0; unsigned i; @@ -307,7 +310,7 @@ static u64 fuse_get_unique(struct fuse_iqueue *fiq) static void queue_request(struct fuse_iqueue *fiq, struct fuse_req *req) { req->in.h.len = sizeof(struct fuse_in_header) + - len_args(req->in.numargs, (struct fuse_arg *) req->in.args); + len_args(req->in.numargs, (struct fuse_out_arg *) req->in.args); list_add_tail(&req->list, &fiq->pending); wake_up_locked(&fiq->waitq); kill_fasync(&fiq->fasync, SIGIO, POLL_IN); @@ -543,7 +546,7 @@ ssize_t fuse_simple_request(struct fuse_conn *fc, struct fuse_args *args) req->out.argvar = args->out.argvar; req->out.numargs = args->out.numargs; memcpy(req->out.args, args->out.args, - args->out.numargs * sizeof(struct fuse_arg)); + args->out.numargs * sizeof(struct fuse_out_arg)); fuse_request_send(fc, req); ret = req->out.h.error; if (!ret && args->out.argvar) { @@ -1021,14 +1024,14 @@ static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size) /* Copy request arguments to/from userspace buffer */ static int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs, - unsigned argpages, struct fuse_arg *args, + unsigned argpages, struct fuse_out_arg *args, int zeroing) { int err = 0; unsigned i; for (i = 0; !err && i < numargs; i++) { - struct fuse_arg *arg = &args[i]; + struct fuse_out_arg *arg = &args[i]; if (i == numargs - 1 && argpages) err = fuse_copy_pages(cs, arg->size, zeroing); else @@ -1275,7 +1278,7 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, err = fuse_copy_one(cs, &in->h, sizeof(in->h)); if (!err) err = fuse_copy_args(cs, in->numargs, in->argpages, - (struct fuse_arg *) in->args, 0); + (struct fuse_out_arg *) in->args, 0); fuse_copy_finish(cs); spin_lock(&fpq->lock); clear_bit(FR_LOCKED, &req->flags); @@ -1794,7 +1797,7 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out, if (reqsize < nbytes || (reqsize > nbytes && !out->argvar)) return -EINVAL; else if (reqsize > nbytes) { - struct fuse_arg *lastarg = &out->args[out->numargs-1]; + struct fuse_out_arg *lastarg = &out->args[out->numargs-1]; unsigned diffsize = reqsize - nbytes; if (diffsize > lastarg->size) return -EINVAL; diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 9130794..5022fbe 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -177,7 +177,7 @@ struct fuse_in { }; /** One output argument of a request */ -struct fuse_arg { +struct fuse_out_arg { unsigned size; void *value; }; @@ -209,7 +209,7 @@ struct fuse_out { unsigned numargs; /** Array of arguments */ - struct fuse_arg args[2]; + struct fuse_out_arg args[2]; }; /** FUSE page descriptor */ @@ -231,7 +231,7 @@ struct fuse_args { struct { unsigned argvar:1; unsigned numargs; - struct fuse_arg args[2]; + struct fuse_out_arg args[2]; } out; };