Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2651587pxb; Sun, 24 Jan 2021 15:24:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgQvP5gBkWsz89XikUILsb72JyTLZjbE5zpPobcLTyv6QjsbaqT1vn+QA2Ns//FMhyjP1A X-Received: by 2002:a05:6402:100c:: with SMTP id c12mr220931edu.356.1611530697178; Sun, 24 Jan 2021 15:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611530697; cv=none; d=google.com; s=arc-20160816; b=zzE0CybHtPkKz8fDXHQP8bkhxZfMyiEwidUmsyJUmbhKT+/+pDx8Z9jVkNPZL32V5Z JZ3u4G6d9hRBRo7MNWKQ/7P55gLyHvrzVkownJYVhTe2Dk1+ML6lDvDIk0ecA870xQVB bxUmS+MnhRb7Hqj2VPtOBm/TJICl5DonHGcxk/4e2e3yRswHhRz0hbNl9+h6LLdhMw9M xz6CRTb5vzV33yH4DuXs/Fz1DiXH7QjRUtlIMylLqikeHqYCyu6k5qjnJetqryKigPfz Bfeg7Ege+ddbSj68qtEMz444ujt/2tV0kFa2tJfXdiU01o5rJO5CGQ8LSw4UX2tGDfyB LN9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZGcICP2RvkjIn13q7g5kt94ONO39lvyf+L+jtGF8Prs=; b=x3+eTIv72vdZ71JODOEVkuJcosIxzZzyuN6S+X8ZN6dQSpymjkcZZNrdp7rLdMFBpi lQnpktT8d1MqzPAkzwE57kO1AD+zI8LOpRjIW1gY2uYxe+JGg/ArGMgdiSGjjq9cEICE 5wk9ZuliD0Z1UtgNaf5ndJCJP0TxKRmw3uCUlJFomuCAq4e50b1Ie+ulv3WA54po9yOj 4qn42w+qNBw0uu36Tp+2o0Yi7hTrCVnE8ZJ8rFvFA7xbCu6uaLDgwQjMYMouYSkZ9bBp C6XpDORu1Qbq67gXf3/ucLJ+3R14nI5gpfN4P+IrzKD/+uUv2Kd6kKz/wYdpaUj0ujhh kuyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si5403907eja.208.2021.01.24.15.24.32; Sun, 24 Jan 2021 15:24:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbhAXXWA (ORCPT + 99 others); Sun, 24 Jan 2021 18:22:00 -0500 Received: from lilium.sigma-star.at ([109.75.188.150]:46984 "EHLO lilium.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbhAXXVr (ORCPT ); Sun, 24 Jan 2021 18:21:47 -0500 Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id 2AF42181D91AC; Mon, 25 Jan 2021 00:21:01 +0100 (CET) Received: from lilium.sigma-star.at ([127.0.0.1]) by localhost (lilium.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id G1T-RcRj43zU; Mon, 25 Jan 2021 00:21:00 +0100 (CET) Received: from lilium.sigma-star.at ([127.0.0.1]) by localhost (lilium.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 86Bd4mavDEFC; Mon, 25 Jan 2021 00:21:00 +0100 (CET) From: Richard Weinberger To: miklos@szeredi.hu Cc: miquel.raynal@bootlin.com, vigneshr@ti.com, boris.brezillon@collabora.com, rminnich@google.com, sven@narfation.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, fuse-devel@lists.sourceforge.net, Richard Weinberger Subject: [PATCH 2/8] fuse: Export IO helpers Date: Mon, 25 Jan 2021 00:20:01 +0100 Message-Id: <20210124232007.21639-3-richard@nod.at> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210124232007.21639-1-richard@nod.at> References: <20210124232007.21639-1-richard@nod.at> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MUSE will use this functions in its IO path, so export them. Signed-off-by: Richard Weinberger --- fs/fuse/file.c | 16 +++------------- fs/fuse/fuse_i.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 8cccecb55fb8..d41660b7f5bc 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -20,8 +20,8 @@ #include #include =20 -static struct page **fuse_pages_alloc(unsigned int npages, gfp_t flags, - struct fuse_page_desc **desc) +struct page **fuse_pages_alloc(unsigned int npages, gfp_t flags, + struct fuse_page_desc **desc) { struct page **pages; =20 @@ -31,6 +31,7 @@ static struct page **fuse_pages_alloc(unsigned int npag= es, gfp_t flags, =20 return pages; } +EXPORT_SYMBOL_GPL(fuse_pages_alloc); =20 static int fuse_send_open(struct fuse_mount *fm, u64 nodeid, struct file= *file, int opcode, struct fuse_open_out *outargp) @@ -1356,17 +1357,6 @@ static inline void fuse_page_descs_length_init(str= uct fuse_page_desc *descs, descs[i].length =3D PAGE_SIZE - descs[i].offset; } =20 -static inline unsigned long fuse_get_user_addr(const struct iov_iter *ii= ) -{ - return (unsigned long)ii->iov->iov_base + ii->iov_offset; -} - -static inline size_t fuse_get_frag_size(const struct iov_iter *ii, - size_t max_size) -{ - return min(iov_iter_single_seg_count(ii), max_size); -} - static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_it= er *ii, size_t *nbytesp, int write, unsigned int max_pages) diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 7c4b8cb93f9f..8c56a3fd2c4e 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -31,6 +31,7 @@ #include #include #include +#include =20 /** Default max number of pages that can be used in a single read reques= t */ #define FUSE_DEFAULT_MAX_PAGES_PER_REQ 32 @@ -871,6 +872,17 @@ static inline bool fuse_is_bad(struct inode *inode) return unlikely(test_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state)); } =20 +static inline unsigned long fuse_get_user_addr(const struct iov_iter *ii= ) +{ + return (unsigned long)ii->iov->iov_base + ii->iov_offset; +} + +static inline size_t fuse_get_frag_size(const struct iov_iter *ii, + size_t max_size) +{ + return min(iov_iter_single_seg_count(ii), max_size); +} + /** Device operations */ extern const struct file_operations fuse_dev_operations; =20 @@ -1213,4 +1225,8 @@ void fuse_dax_inode_cleanup(struct inode *inode); bool fuse_dax_check_alignment(struct fuse_conn *fc, unsigned int map_ali= gnment); void fuse_dax_cancel_work(struct fuse_conn *fc); =20 +/* file.c */ +struct page **fuse_pages_alloc(unsigned int npages, gfp_t flags, + struct fuse_page_desc **desc); + #endif /* _FS_FUSE_I_H */ --=20 2.26.2