Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2949642pxb; Mon, 4 Apr 2022 03:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTcQS7JLvO6Pa4B0MkorV0Z7CQ3dryZ6Q7ZamwL9hF9jfXSV07nZQR/DyBUy/bRqc5/01/ X-Received: by 2002:a05:6402:370b:b0:413:3bcd:3d0e with SMTP id ek11-20020a056402370b00b004133bcd3d0emr32270917edb.178.1649069895951; Mon, 04 Apr 2022 03:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649069895; cv=none; d=google.com; s=arc-20160816; b=h1ozPievbhjo8LvzzJy5Y1Y2oOJXNOtgtjowquVXOhruDdb0meYhzzsxBL74rhjw6G DNu5MR/o5Hvh2ECH8qt4gMxzpeQWtGKILlBjbZhCvFHBMD3jsv1xXU72f9JKBQmFCoCt JQBz4M4V3fyLHJ1jtpGK61nrKBe2m40IbGNOiG1H8XBrQ6iEpKXdbSqHAp1E4aOBZciU CcdV/igFp0xPzRXKAwbRmRJdlI3bSx/3fzsrfh47S9FUTrp0A1YH3VqytYwYtUxdAJX3 DhiOcDQK4FnWWPW77s7gtSRFy03yrZf0duQZ81VnmWbLNba5UculHW7PSGIWchV/Wz0j S0+g== 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:subject:cc:to:from:date :dkim-signature; bh=oIRSTzpeogZQegTxy3HsXL8f2cTTP9W4dlr8OKiUWvM=; b=hbNTRRXd9bIS6zGnupfDQeoIMYGfNViDXGbazSPscRRkGKXY/Nh7Kd8uGQoUrejA01 UZZtb67Z2tTJmnth10io2S3jxf1EASUPGBNCM3//Y3/pv6XT/4/Z5+w7R81R1rw+VsJs nTbamPsQ3NCl+WUo0Z/0cLeGEgRdLTbnt8usWP8TEfnCRJg1c/dUydF9MC05hOjIIO/o hT7CtA2cAJZvvxPuSvjNrCYLzKj4erNG1qbGPyKjbRjnj/p/FC//H4IQpBaVcZW4OqeN 69pV65zYghDWchgIHQ1s/DoEMsdXYTWbTuaZeORtiLcgX0NcApXhm8wPrMQXTeGjtHtq CfEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MmNDOwVE; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a056402270600b00418c2b5bd70si8052014edd.82.2022.04.04.03.57.40; Mon, 04 Apr 2022 03:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MmNDOwVE; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233125AbiDBJe7 (ORCPT + 99 others); Sat, 2 Apr 2022 05:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232062AbiDBJe6 (ORCPT ); Sat, 2 Apr 2022 05:34:58 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90CB31C108; Sat, 2 Apr 2022 02:33:07 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id k14so4251550pga.0; Sat, 02 Apr 2022 02:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oIRSTzpeogZQegTxy3HsXL8f2cTTP9W4dlr8OKiUWvM=; b=MmNDOwVEm9/LVOFVLRabwEeZP2ohnfVDJl4b6rWpmqY7ck/S6PpyIGOmyHKtqdnrB6 MmfTPtCYh59zgoCCuotESVOzKCOJ20495cIfFbDPXFXedRy7EgZnpyR0z61XHHDKi7Mt gmO1GhLb9kfH1Lh1ZdRn7shLVz2Ep9pM2fKO/nUXKIyWd+toxIbk4mE8NamZjm/Fx7Ra C+KKcTcPRgmyi3AYRXyJ/9y1Gy43XNHxl4MDcMGP8V6Uokjsfi6ZyrJNHaDMuG3muHUr rCoAARHhh/CuKf93dFKNmSRFUR34oFcKJE/tyq+XjKnmAa3nBzkxqGDpM2BR18YAuaa3 Xzxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oIRSTzpeogZQegTxy3HsXL8f2cTTP9W4dlr8OKiUWvM=; b=H3DLIo1QlE3AZyVElpOk3BX6nfiywbF9mp2uxtG4FMgA1C3RvlzDW+jIXeCnCzR9ax w/0mmAgjnVX9QF+E8ZLg91YuswjUX8zfWD5r6xA8k2w/AFrswEJ6jmxCI1LNryXkPVzy xzlPxKqCYI+5IpOUSH7kb/EbU8BzGu1GbaEPv+K+h7m7ZDt1EIepZnv/N5APq/HOVaij cgxY1zd0qez+N1VYx/+YQ/zOWrb+zMX4ysOlr9H2ypdXybxGWuMQClIoy919/37POVA4 ztzoEvrzHQ612XYQYP7GK9/9LMRTnb4QnlXmGysEtd9PhJYON5N8U4e1vejznFVjpOv5 /9HA== X-Gm-Message-State: AOAM531W0IW3nkwPKUvpZePUeOheP8oTx+vNC7RpWZQ59CrtV3+Nb98R G4rz4utIoDN2jvd39siyNAEkm2/yFVAxgQ== X-Received: by 2002:aa7:8d47:0:b0:4f6:a7f9:1ead with SMTP id s7-20020aa78d47000000b004f6a7f91eadmr14749693pfe.42.1648891987038; Sat, 02 Apr 2022 02:33:07 -0700 (PDT) Received: from localhost ([103.220.76.197]) by smtp.gmail.com with ESMTPSA id f66-20020a62db45000000b004fa8a7b8ad3sm5593956pfg.77.2022.04.02.02.33.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Apr 2022 02:33:06 -0700 (PDT) Date: Sat, 2 Apr 2022 17:32:21 +0800 From: Yue Hu To: "Yue Hu" Cc: , , , , , , , , , , Subject: Re: [PATCH] fscache: Expose fscache_end_operation() helper Message-ID: <20220402173221.00002170.zbestahu@gmail.com> In-Reply-To: <20220402021841.22285-1-huyue2@coolpad.com> References: <20220402021841.22285-1-huyue2@coolpad.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-nfs@vger.kernel.org On Sat, 02 Apr 2022 10:18:55 +0800 "Yue Hu" wrote: > Currently, nfs and cifs have same fscache_end_operaion() as fscache. > We may put the helper in linux/fscache.h so that fscache internal > and client filesystem can all use it. Sorry, please ignore the patch due to my earlier code base. Thanks. > > Signed-off-by: Yue Hu > --- > fs/cifs/fscache.c | 8 -------- > fs/fscache/internal.h | 11 ----------- > fs/nfs/fscache.c | 8 -------- > include/linux/fscache.h | 12 ++++++++++++ > 4 files changed, 12 insertions(+), 27 deletions(-) > > diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c > index 33af72e0ac0c..b47c2011ce5b 100644 > --- a/fs/cifs/fscache.c > +++ b/fs/cifs/fscache.c > @@ -134,14 +134,6 @@ void cifs_fscache_release_inode_cookie(struct inode *inode) > } > } > > -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/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..79bb40b92e0f 100644 > --- a/include/linux/fscache.h > +++ b/include/linux/fscache.h > @@ -557,6 +557,18 @@ int fscache_write(struct netfs_cache_resources *cres, > return ops->write(cres, start_pos, iter, term_func, term_func_priv); > } > > +/* > + * Clean up at the end of an operation > + */ > +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_clear_page_bits - Clear the PG_fscache bits from a set of pages > * @cookie: The cookie representing the cache object