Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1788460pxb; Wed, 9 Feb 2022 04:38:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJziHE0sHn4qbhqQ7bqOUoTbf3LSXlukzqG7L72qGqpeq6opEsBSf0JHZ7as9gd2qhDJTl2B X-Received: by 2002:a17:902:f70a:: with SMTP id h10mr1898944plo.127.1644410327850; Wed, 09 Feb 2022 04:38:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644410327; cv=none; d=google.com; s=arc-20160816; b=jEkd6bSKe4ehuODZCi6sCgiO9c4pM/etk8QDnEVPGUs0M7MqCTIh2NsH4Q1mGs9KDI qsIl6Xq7ajPeWapq3nJ2JiJ/iETrF0eybJ3g0BAp+pOevR4if0UC0or2+fUSDv0rWt4y 7ITh6j86qkwipTlz2KTq3DU3ftVnInidA/sv+fh/4NtSJHWK8XacewLgXQE4hUC8fC61 VIGxBldW0rgbPm7lu1oZSdCLMEM0RCpRoA3Quzc5DS0A+AuwLLyLbKzZs1M8tcQktlJ/ V4jV37c+5qe3qXnEH8zm7NwWqWs352fxArZvajJte7Z2eEvt5B/T8uZMPCvIpzdo7n1f zgZg== 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=Wrw+ikW6+owNGCofL7UakSx2PpiV/eDxpUAszLl99KA=; b=pXUIvPhXWv2MKs+HJe+2JpQ01MtzOE/lOK7rIlBt3CEZhlxkEbbxadsewCggiPmmxY QbUVxyEDZaZhmN+Dd267G2tCWFrf4V6PwG8hP6VLvAjjJ2JU1cUMfaIZNGW2dbnhGNnT IC2uPlxHsFGFdqnNLZbv+BTvoFyTxdoOd86w8MbeyqKoDsWiG0z7yKplYualjRR9d12w PQb1KuYqn4zoyShQweimgSh3rZdlr0w4MDTE6e3IMrdUWQsyCTHJ+Du2KrvkN674Cl92 e06yedubxNApe3Nkg+W6jUYFemYn31EU3PdcYZ3JcRitlI+dVm5Xy9wUDEAUbavsIoyC 7edw== 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 l8si3763563pls.416.2022.02.09.04.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:38:47 -0800 (PST) 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 C5568E04FF2A; Wed, 9 Feb 2022 02:24:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234806AbiBIGCu (ORCPT + 99 others); Wed, 9 Feb 2022 01:02:50 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:51828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234221AbiBIGBK (ORCPT ); Wed, 9 Feb 2022 01:01:10 -0500 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 024ECC050CC1; Tue, 8 Feb 2022 22:01:13 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;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_---0V3zflkL_1644386469; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V3zflkL_1644386469) by smtp.aliyun-inc.com(127.0.0.1); Wed, 09 Feb 2022 14:01:10 +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 v3 01/22] fscache: export fscache_end_operation() Date: Wed, 9 Feb 2022 14:00:47 +0800 Message-Id: <20220209060108.43051-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220209060108.43051-1-jefflexu@linux.alibaba.com> References: <20220209060108.43051-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 --- 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