Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2185053pxb; Fri, 25 Mar 2022 12:36:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFDYSQa3WVdhqcmWx4jrzePUaVtb90v1iin2Y2VPxL6r6WkoiUd6YWP1lHKlG6Av5cEPn1 X-Received: by 2002:a05:6830:c5:b0:5c9:7a04:b313 with SMTP id x5-20020a05683000c500b005c97a04b313mr4934275oto.176.1648236992345; Fri, 25 Mar 2022 12:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648236992; cv=none; d=google.com; s=arc-20160816; b=lT+q0YyYJIZIw93M2FSphvBzF5HzGtw2gohwXkC/weTPKmzSg1VoIp/EwL86Ihz58s RkPnmDMGO5oWsPR8I2ENV10rVTs6W1eTXLiVwARJPJLqD6djPj7IM8GbdZrKm/RmIKhQ eyw4Tba3c81CkBDkn2GZUrHSkKjIaXdj++XbAc2BpaqCPdNuFqcNra4D5uc36/5NgvMd DvzomnrKJLrazJpygWeym8y6ubHLvhn5+7y7TAJAXAZtZV22svjsw3oufnhmbatYv9eo LLwMLfCPpcRqEvvJTfqh3pJ5kVz4zQEReiHQBVTmWP/1f1saJ5yYDXCfFuGZ7Unme6Ej e0cQ== 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=QZXf8f72G9xseNGzDT5DbYb2e53vpamPHAdV4Tkeg+cOzRjBffFj9RdqCx5XAAFWD7 DX8/klgbDGdTUkRUGCc/p8YsAP9OLMipvDb10Oigv/qdaNTCCXtx/DJGTxkDSO2XLH2e iyXU5x9h+J7ing2+sO9i6+Md4ArWI9JmVddlfDrCifIiwuMUXH16cFS2Xa4ND3LcsUNN QGEoLOwUDd6Pt1wv201kUSMotRsRFQMriYtFcKfczuvn2urg8mayOSHWrMqSUQ4F9YJC 68Ta3d0v1eP3IsT/EpScuLuzawQxDkCxI1J+XlvuQHLPzrtG84j7HvudtbYoIBa4NtEI iTGg== 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 w63-20020aca6242000000b002ef0c34759csi2436958oib.28.2022.03.25.12.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:36:32 -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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE0D2264552; Fri, 25 Mar 2022 11:27:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358969AbiCYMYI (ORCPT + 99 others); Fri, 25 Mar 2022 08:24:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358958AbiCYMYH (ORCPT ); Fri, 25 Mar 2022 08:24:07 -0400 Received: from out199-6.us.a.mail.aliyun.com (out199-6.us.a.mail.aliyun.com [47.90.199.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4484DD447A; Fri, 25 Mar 2022 05:22:31 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;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=18;SR=0;TI=SMTPD_---0V89zY0V_1648210945; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V89zY0V_1648210945) by smtp.aliyun-inc.com(127.0.0.1); Fri, 25 Mar 2022 20:22: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, tianzichen@kuaishou.com, fannaihao@baidu.com Subject: [PATCH v6 01/22] fscache: export fscache_end_operation() Date: Fri, 25 Mar 2022 20:22:02 +0800 Message-Id: <20220325122223.102958-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220325122223.102958-1-jefflexu@linux.alibaba.com> References: <20220325122223.102958-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