Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp973493pxp; Wed, 16 Mar 2022 23:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP8ydffDv/P5MN3C+ae979iRPn2VO88MEFemOorgICVKlEj9VI/LuJfKxzpCzdPRdSLuQj X-Received: by 2002:a65:52cc:0:b0:374:3ee6:c632 with SMTP id z12-20020a6552cc000000b003743ee6c632mr2393013pgp.91.1647497261465; Wed, 16 Mar 2022 23:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497261; cv=none; d=google.com; s=arc-20160816; b=V5h61n/g0JVPjSt42nyNFEPfzkKrK+x0zyiZ/hghH5PrRdu56FyBzY7NH/EHoyzgHS EmiMzIg6b6kMRIeXrXxsuW3jCom3qV+TLFKIrMwMOS1EYiWcJjLdF575J5KxVTVzgVE/ HKoBfv9JO7v3FfP9XioKYLIOiIJSewCyRhGS6M9WStp7Ipvm4QfATskFdEEiB4wHVMOh TSSCOTFMr8w/bJH55mXtlstkIq0TWd1tDZyvd589cfCMb0cOyzQHfKcF2FJu/c3kZO66 AJHwApb1b6Q5M0HErCkzLLyqPJh6dCOR5SGPZnGxos35U//esT3H3SvbuX42cOA9AiW7 +gow== 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=G+5rXK+BiVQzti7sswgSihJ3g6G4xmED2NxSVHXjUZDn8tfrKV2txLmdveI8XzWTn6 YovZ8ayJr+CV2T+ZqIsx2uV1Qwx32zB/WShtDaI+h78k11gaD6giS4SlRaYpcEPeUdUa iMfa1Hn/qYMtENqfNUrzk5ItyUfFrtUwavrURf+ca7VJRA+VSN8mvv8J17Nl2mYBjk5k PbQvIMzR0bqITz5KSb7gU4OBupuahtmpvA+9OYPSuYb0Q9Z5x8w4oZlKjB2dNoVGMZS6 XwJnHoG4VwHNllA/8qvYd6QSKXxKHkwOkqJJ0ucoGr2yDTUPmCpLkBzecKxOSlLbEN0t MARg== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x26-20020a656aba000000b003816043f041si1254418pgu.566.2022.03.16.23.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:07:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0F0D3298C94; Wed, 16 Mar 2022 22:15:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356205AbiCPNSv (ORCPT + 99 others); Wed, 16 Mar 2022 09:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356180AbiCPNSo (ORCPT ); Wed, 16 Mar 2022 09:18:44 -0400 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 EFF2066AD3; Wed, 16 Mar 2022 06:17:29 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0V7NEPnw_1647436645; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V7NEPnw_1647436645) by smtp.aliyun-inc.com(127.0.0.1); Wed, 16 Mar 2022 21:17:26 +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, luodaowen.backend@bytedance.com Subject: [PATCH v5 01/22] fscache: export fscache_end_operation() Date: Wed, 16 Mar 2022 21:17:02 +0800 Message-Id: <20220316131723.111553-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220316131723.111553-1-jefflexu@linux.alibaba.com> References: <20220316131723.111553-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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