Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp511165pxb; Thu, 17 Feb 2022 08:41:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJy86bL5eekeVKM/J9GcL4+V4yLHiD7W7Q4l/XShDf92j83jO2vgVtXt0Uu9hGK3S8UVXJ6o X-Received: by 2002:a17:906:c092:b0:6ce:1018:9f4e with SMTP id f18-20020a170906c09200b006ce10189f4emr2985768ejz.430.1645116112247; Thu, 17 Feb 2022 08:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645116112; cv=none; d=google.com; s=arc-20160816; b=h7lLMm8qTiozuA2nOU/EfqLm6mIdRSU3ljwUrzFng+M8OPWR6F2zvu2tcxCfeUb95O R/Ec0ftbpDQjs5bPAItpeXPgqatffLGGnDCD4Fvgv/J6jYOALCE3BPrGtyJPoU27tuPD 2DJJBshGvnKzki+XsyYX/AxxrdGIg7VZnNNZNwKlF7o9YmeNryBWcIw3SU4KzycncCOS Ah+GK2jlrKl9Wg383ejFJxGBJWiiCioqVZYu/UP/g/U2ZOXbnefnh9VFmn1YU7QKngru UYVNVgAUsj2oOi6ZHtheltMa14wPAzTIkW6FSEfQBkh1B94gJOOFrHLYhTvk+MS5BDZt e8fw== 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=VpJqB6B5EInxbN7zfnr1XIbIXHi+XnX6BXilj66heJ/Oe91/xV4sDoXOHfOWCGORFV QsD7nBjE6yaLXTV/V5SjwEbHo/mnUZtG/GWcCclcC5pnVJZZmbbyS16za5Z7xhEO27Ra 9ShWvI9Wuz+RyiSG8ks4CuOvLgM8lQBLb7+cEnOI2pJx8S+uqAR+pGPAmAjLHd12sjrk BMoEnOfRn6Ow5JztPS+MPj+wGfx9lNLQdiqKwAe4KXhT3FhErXOkalT7KhibTGW3zNB/ UYCuuNVLMGWUl0UBITt2XcO1FBIvVlgP0DWSUVPFQsGxcHpyxhILqqa1zBiJxGs2XS7X QOnw== 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 jg42si2397649ejc.928.2022.02.17.08.41.28; Thu, 17 Feb 2022 08:41:52 -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 S240195AbiBQMCS (ORCPT + 99 others); Thu, 17 Feb 2022 07:02:18 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240166AbiBQMCP (ORCPT ); Thu, 17 Feb 2022 07:02:15 -0500 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4CD762D1; Thu, 17 Feb 2022 04:01:59 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0V4kJNJN_1645099316; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V4kJNJN_1645099316) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Feb 2022 20:01:56 +0800 From: Jeffle Xu To: dhowells@redhat.com, linux-cachefs@redhat.com Cc: xiang@kernel.org, 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: [RESEND PATCH v3 1/4] fscache: export fscache_end_operation() Date: Thu, 17 Feb 2022 20:01:51 +0800 Message-Id: <20220217120154.16658-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220217120154.16658-1-jefflexu@linux.alibaba.com> References: <20220217120154.16658-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