Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3887510imu; Mon, 10 Dec 2018 09:20:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/XoG4AX/4GytE9kXoKIRtDbXBuXaoYNQHQY6Lm7lXqvkMK/tHsgXTlJCF1YllgNkwzUE1dN X-Received: by 2002:a17:902:a9c4:: with SMTP id b4mr12875395plr.298.1544462443098; Mon, 10 Dec 2018 09:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544462443; cv=none; d=google.com; s=arc-20160816; b=MjbPGJZChn63H14qNAxlVAIhw1KGrS8K3lqr9liUytSsA/w9FgheO7CxyYPGf7OVMu pIxYYAc6lRtMk9hzPUXRSo2N9pKBhZEZVoszPZnSKNmPetu6/bigMr8BYaY+AIm7Orrk nq/bBqK1dcYNE1r+372UCfadqv/R2C58/wdIxMT/eUtXwYVL/gDSLG/qDoWfTd9E9cbu 0sCEdcM9kXJV1XOVJibwP0sgreZiLEi1BuPp8BBZIJHjOcrM2E8xCHEuO5ZYHgOFMG7I gkvxBHjXFm4bUocX/TWSJAbiLWavPNowmrWWFL96bCPvfvWpiLDGSo+HECLC0nLfZkEV i5bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=iniMA3FKhlEum3He89rqOu8s2lcXadLc642JLQXbKRY=; b=RIgqLr1pU5JsKfAbu5r8aBCKhd2cF4pFp9FvJJ/fwlncOtpzxK+akYLsz4CMWIpIZl b+DI3tm/LVvlUkxAr1HBKcRqbhmQCAcPWwDyUcCHg9a9UYl52hq+pHSIQQy2nBFaWrnm nfbB19Sk+TwUSnpE2z5OMYZqKUmXRNwvhL1/0q9YImkhD3GU00OW+e96yGlSqSsmUQGm X6bXGOOfB9QwT5MBnFZfKzS4VUbJwQOLt2Axs1eYf/rpwZr/4Hdyyn0spg+hVI8m/r7l zbSDbBouYs4+fEfWj04OigipJ5CukP9R2KBUn7qpoW39jBLcMursxNu6NYcVDioPpO8X b3yA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si9356046pgi.227.2018.12.10.09.20.27; Mon, 10 Dec 2018 09:20:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728696AbeLJROs (ORCPT + 99 others); Mon, 10 Dec 2018 12:14:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728571AbeLJRNo (ORCPT ); Mon, 10 Dec 2018 12:13:44 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57A1581DF0; Mon, 10 Dec 2018 17:13:44 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8600F5FCA2; Mon, 10 Dec 2018 17:13:33 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 2069A223BF8; Mon, 10 Dec 2018 12:13:30 -0500 (EST) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, sweil@redhat.com, swhiteho@redhat.com Subject: [PATCH 07/52] fuse: export fuse_len_args() Date: Mon, 10 Dec 2018 12:12:33 -0500 Message-Id: <20181210171318.16998-8-vgoyal@redhat.com> In-Reply-To: <20181210171318.16998-1-vgoyal@redhat.com> References: <20181210171318.16998-1-vgoyal@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 10 Dec 2018 17:13:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Hajnoczi virtio-fs will need to query the length of fuse_arg lists. Make the symbol visible. Signed-off-by: Stefan Hajnoczi --- fs/fuse/dev.c | 7 ++++--- fs/fuse/fuse_i.h | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 5b90c839a7c3..7fd627d5cf58 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -348,7 +348,7 @@ 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) +unsigned fuse_len_args(unsigned numargs, struct fuse_arg *args) { unsigned nbytes = 0; unsigned i; @@ -358,6 +358,7 @@ static unsigned len_args(unsigned numargs, struct fuse_arg *args) return nbytes; } +EXPORT_SYMBOL_GPL(fuse_len_args); static u64 fuse_get_unique(struct fuse_iqueue *fiq) { @@ -373,7 +374,7 @@ static unsigned int fuse_req_hash(u64 unique) 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); + fuse_len_args(req->in.numargs, (struct fuse_arg *) req->in.args); list_add_tail(&req->list, &fiq->pending); wake_up_locked(&fiq->waitq); kill_fasync(&fiq->fasync, SIGIO, POLL_IN); @@ -1870,7 +1871,7 @@ static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out, if (out->h.error) return nbytes != reqsize ? -EINVAL : 0; - reqsize += len_args(out->numargs, out->args); + reqsize += fuse_len_args(out->numargs, out->args); if (reqsize < nbytes || (reqsize > nbytes && !out->argvar)) return -EINVAL; diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 32c4466a8f89..f41ebc723e01 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -1120,4 +1120,9 @@ int fuse_set_acl(struct inode *inode, struct posix_acl *acl, int type); /* readdir.c */ int fuse_readdir(struct file *file, struct dir_context *ctx); +/** + * Return the number of bytes in an arguments list + */ +unsigned fuse_len_args(unsigned numargs, struct fuse_arg *args); + #endif /* _FS_FUSE_I_H */ -- 2.13.6