Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2704141pxp; Mon, 7 Mar 2022 23:20:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMiofCOtztQ6cqNp4MoevOzSqtVJBkIPwrnz/fl0mqZJtx8o4WuEjc8tJILig6jTp8CKZw X-Received: by 2002:a17:90a:2b88:b0:1bf:5252:3afd with SMTP id u8-20020a17090a2b8800b001bf52523afdmr3224956pjd.92.1646724004106; Mon, 07 Mar 2022 23:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646724004; cv=none; d=google.com; s=arc-20160816; b=Utj9eOPLf5Y1zTHYChF0tpOWwmhetg7fk8YR9ESwDqQoQndzbXPLPNggnMSqUnU1ST qzM7xZcKu9b8aWlusASeddQTlJ3DVE/oNekwTV7Tn+DKXHitzfOjF0cKUymlA5pd7IRR lAvCOKGRqmJqBZ8S6tib9E9OttDaFzUtwEfc2mQk6cjBd4UzfDjDFpY7NaarnMhMoJYs EdgelXff2wl52mjiEmeFaJEuC6FRw1WeXYU8GL9btaD2zqhr5p7KR0QqGA8HZ6S/cwML 9Z77WxPaxETBOW+1opnyaZOifrn4/JSx4ltic5aTFzIWpHLfsxiHsdEUquOFs/z0hGsz Oamg== 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=5lis1fUhc13kkzpEFsyZ4ZJbPseUAiEfqEyKrEBCwdI=; b=lK+mzWIDFKPgBeRFAt1giJoAO1FLNlTXBwU9EzH9hBvrgIiy9smCS3lnLUzSSY5HM6 uLdblRHVq/XC8av3hH8fuGV8Wi2iqS8WyG4gITF8PDj5BSU+uVi/8Nud3ClbXDHYqu8z hTpuuDyCUCztYjtM+4Z8+1keYH0LvSECjM0RSSHApEOXt5AQ4N/a2ACgL87kKS7B6LL8 Y76magbHDeshr3gbstaaxn0J1CWuV6QWs29cSFRLeLYWEIr3JUiE+5Pyip19y74z2gxZ 28LufRigRnuUBI4R19XD1sbblHbdzTsoaiuuPj1FuW918gOS1zDgmyIjMXLEBvfJ28XJ 8tyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a17090a55cc00b001bf552c46d4si1307061pjm.173.2022.03.07.23.19.48; Mon, 07 Mar 2022 23:20:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242343AbiCGMeU (ORCPT + 99 others); Mon, 7 Mar 2022 07:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242310AbiCGMeG (ORCPT ); Mon, 7 Mar 2022 07:34:06 -0500 Received: from out199-4.us.a.mail.aliyun.com (out199-4.us.a.mail.aliyun.com [47.90.199.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2366B3BBD7; Mon, 7 Mar 2022 04:33:11 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0V6VlXv8_1646656387; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V6VlXv8_1646656387) by smtp.aliyun-inc.com(127.0.0.1); Mon, 07 Mar 2022 20:33:08 +0800 From: Jeffle Xu To: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org Subject: [PATCH v4 01/21] fscache: export fscache_end_operation() Date: Mon, 7 Mar 2022 20:32:45 +0800 Message-Id: <20220307123305.79520-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220307123305.79520-1-jefflexu@linux.alibaba.com> References: <20220307123305.79520-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export fscache_end_operation() to avoid code duplication. Besides, considering the paired fscache_begin_read_operation() is already exported, it shall make sense to also export fscache_end_operation(). Signed-off-by: Jeffle Xu Reviewed-by: Liu Bo --- fs/fscache/internal.h | 11 ----------- fs/nfs/fscache.c | 8 -------- include/linux/fscache.h | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h index f121c21590dc..ed1c9ed737f2 100644 --- a/fs/fscache/internal.h +++ b/fs/fscache/internal.h @@ -70,17 +70,6 @@ static inline void fscache_see_cookie(struct fscache_cookie *cookie, where); } -/* - * io.c - */ -static inline void fscache_end_operation(struct netfs_cache_resources *cres) -{ - const struct netfs_cache_ops *ops = fscache_operation_valid(cres); - - if (ops) - ops->end_operation(cres); -} - /* * main.c */ diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index cfe901650ab0..39654ca72d3d 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c @@ -249,14 +249,6 @@ void nfs_fscache_release_file(struct inode *inode, struct file *filp) } } -static inline void fscache_end_operation(struct netfs_cache_resources *cres) -{ - const struct netfs_cache_ops *ops = fscache_operation_valid(cres); - - if (ops) - ops->end_operation(cres); -} - /* * Fallback page reading interface. */ diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 296c5f1d9f35..d2430da8aa67 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -456,6 +456,20 @@ int fscache_begin_read_operation(struct netfs_cache_resources *cres, return -ENOBUFS; } +/** + * fscache_end_operation - End the read operation for the netfs lib + * @cres: The cache resources for the read operation + * + * Clean up the resources at the end of the read request. + */ +static inline void fscache_end_operation(struct netfs_cache_resources *cres) +{ + const struct netfs_cache_ops *ops = fscache_operation_valid(cres); + + if (ops) + ops->end_operation(cres); +} + /** * fscache_read - Start a read from the cache. * @cres: The cache resources to use -- 2.27.0