From patchwork Thu Oct 27 08:35:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 11647 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp105917wru; Thu, 27 Oct 2022 01:36:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pmKEsuDqly6YgedCdVdiqoqJzZ++0+hCGmJTAA61scaNVj06KX5XjPbbKDZCB+gZXYDrZ X-Received: by 2002:a62:5e81:0:b0:563:1f18:62ab with SMTP id s123-20020a625e81000000b005631f1862abmr47703743pfb.76.1666859797563; Thu, 27 Oct 2022 01:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666859797; cv=none; d=google.com; s=arc-20160816; b=sIdQjlZfn03H0H7Xmg6o0EvYPIocP12oL6jjITMy2b0MFWs7oYImQbjS1kWPnYfHLj WJTId2PWrn0H36XaPehiqFrDc+huiaS+APMznMwsoWQemQ5lmDqitUBRv58NoQNdG6d9 hDd3LMyyUy4ted7JrGeaYMRjoelgWD8I9KOjyUOchRDOJk+W4B/MkfoQHhsmqdWq6KGb tF45036Z4AQRyQnc82RdwqyZ13uHmIijcX+CdTNnsGuG7kjhZBFJO5KRKZhY+y5HaVxa u0ICQjseJaeDtq5C06HJ1WdENU1ScC8HbQDNHy2oxBGl6K/XETpQlCyoKLnTRyRojLaR ZXnA== 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=SxGtC/9LDSYnDOt1p8cEcL7fIPdJSD2CY8zPs624VIE=; b=z3KM4lcvB079D5VmQjZKAd88TzVcJwpuLvOtxoVQgh+pWucTdkIhEvDHmH7kHZ/J8W 3DWiCHTbc29RYSPNPKNY93Vp3BDV6IxfeRs7FO311+TGEyMs6LboE8v2DETktgyXRgZ0 YYGWNPwTp6iIwzjLtOnEGVFTZFSEM1n6l8hIwHfRrzPIhJ8nCPw95w6OYlOz6D6CKIjT ZitgUdAxdF3F6SqJChWwR7xu9cXajSRYyXZNw8UiiRL0yMbbj7LTJaDzNp25er8csK3R kSeU1iK/SqPAdM9RnmFYQaerNy4aAYPbGQBBW6ib1NZ6ujkEB2xVjHvWx3KZFaMfkJZL gQew== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a63e104000000b0046af665ed92si911482pgh.480.2022.10.27.01.36.23; Thu, 27 Oct 2022 01:36:37 -0700 (PDT) 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 S234955AbiJ0IgK (ORCPT + 99 others); Thu, 27 Oct 2022 04:36:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234899AbiJ0If7 (ORCPT ); Thu, 27 Oct 2022 04:35:59 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F37DD8A7C8; Thu, 27 Oct 2022 01:35:56 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0VTAsArv_1666859753; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VTAsArv_1666859753) by smtp.aliyun-inc.com; Thu, 27 Oct 2022 16:35:54 +0800 From: Jingbo Xu To: dhowells@redhat.com, jlayton@kernel.org, linux-cachefs@redhat.com, linux-erofs@lists.ozlabs.org Cc: linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] fscache,netfs: rename netfs_read_from_hole as fscache_read_from_hole Date: Thu, 27 Oct 2022 16:35:42 +0800 Message-Id: <20221027083547.46933-5-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20221027083547.46933-1-jefflexu@linux.alibaba.com> References: <20221027083547.46933-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 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, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747829179077457939?= X-GMAIL-MSGID: =?utf-8?q?1747829179077457939?= Rename netfs_read_from_hole as fscache_read_from_hole to make raw fscache APIs more neutral independent on libnetfs. This is a cleanup without logic change. Signed-off-by: Jingbo Xu --- fs/cachefiles/io.c | 6 +++--- fs/cifs/fscache.c | 2 +- fs/erofs/fscache.c | 2 +- fs/netfs/io.c | 6 +++--- fs/nfs/fscache.c | 2 +- include/linux/fscache.h | 8 ++++---- include/linux/netfs.h | 10 +++++----- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/cachefiles/io.c b/fs/cachefiles/io.c index 6931032b837c..2dce7af0fbcf 100644 --- a/fs/cachefiles/io.c +++ b/fs/cachefiles/io.c @@ -73,7 +73,7 @@ static void cachefiles_read_complete(struct kiocb *iocb, long ret) static int cachefiles_read(struct netfs_cache_resources *cres, loff_t start_pos, struct iov_iter *iter, - enum netfs_read_from_hole read_hole, + enum fscache_read_from_hole read_hole, fscache_io_terminated_t term_func, void *term_func_priv) { @@ -98,7 +98,7 @@ static int cachefiles_read(struct netfs_cache_resources *cres, /* If the caller asked us to seek for data before doing the read, then * we should do that now. If we find a gap, we fill it with zeros. */ - if (read_hole != NETFS_READ_HOLE_IGNORE) { + if (read_hole != FSCACHE_READ_HOLE_IGNORE) { loff_t off = start_pos, off2; off2 = cachefiles_inject_read_error(); @@ -116,7 +116,7 @@ static int cachefiles_read(struct netfs_cache_resources *cres, * return success. */ ret = -ENODATA; - if (read_hole == NETFS_READ_HOLE_FAIL) + if (read_hole == FSCACHE_READ_HOLE_FAIL) goto presubmission_error; iov_iter_zero(len, iter); diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index a1751b956318..3145e0993313 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c @@ -156,7 +156,7 @@ static int fscache_fallback_read_page(struct inode *inode, struct page *page) if (ret < 0) return ret; - ret = fscache_read(&cres, page_offset(page), &iter, NETFS_READ_HOLE_FAIL, + ret = fscache_read(&cres, page_offset(page), &iter, FSCACHE_READ_HOLE_FAIL, NULL, NULL); fscache_end_operation(&cres); return ret; diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index bf216478afa2..1cc0437eab50 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -195,7 +195,7 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie, start + done, subreq->len); ret = fscache_read(cres, subreq->start, &iter, - NETFS_READ_HOLE_FAIL, + FSCACHE_READ_HOLE_FAIL, erofc_fscache_subreq_complete, subreq); if (ret == -EIOCBQUEUED) ret = 0; diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 992f3eebd2ee..2fc211376dc2 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -43,7 +43,7 @@ static void netfs_cache_read_terminated(void *priv, ssize_t transferred_or_error */ static void netfs_read_from_cache(struct netfs_io_request *rreq, struct netfs_io_subrequest *subreq, - enum netfs_read_from_hole read_hole) + enum fscache_read_from_hole read_hole) { struct netfs_cache_resources *cres = &rreq->cache_resources; struct iov_iter iter; @@ -251,7 +251,7 @@ static void netfs_rreq_short_read(struct netfs_io_request *rreq, netfs_get_subrequest(subreq, netfs_sreq_trace_get_short_read); atomic_inc(&rreq->nr_outstanding); if (subreq->source == FSCACHE_READ_FROM_CACHE) - netfs_read_from_cache(rreq, subreq, NETFS_READ_HOLE_CLEAR); + netfs_read_from_cache(rreq, subreq, FSCACHE_READ_HOLE_CLEAR); else netfs_read_from_server(rreq, subreq); } @@ -580,7 +580,7 @@ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, netfs_read_from_server(rreq, subreq); break; case FSCACHE_READ_FROM_CACHE: - netfs_read_from_cache(rreq, subreq, NETFS_READ_HOLE_IGNORE); + netfs_read_from_cache(rreq, subreq, FSCACHE_READ_HOLE_IGNORE); break; default: BUG(); diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index e861d7bae305..509236f8b750 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c @@ -258,7 +258,7 @@ static int fscache_fallback_read_page(struct inode *inode, struct page *page) if (ret < 0) return ret; - ret = fscache_read(&cres, page_offset(page), &iter, NETFS_READ_HOLE_FAIL, + ret = fscache_read(&cres, page_offset(page), &iter, FSCACHE_READ_HOLE_FAIL, NULL, NULL); fscache_end_operation(&cres); return ret; diff --git a/include/linux/fscache.h b/include/linux/fscache.h index ee8e14f142e8..80455e00c520 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -496,18 +496,18 @@ static inline void fscache_end_operation(struct netfs_cache_resources *cres) * @read_hole indicates how a partially populated region in the cache should be * handled. It can be one of a number of settings: * - * NETFS_READ_HOLE_IGNORE - Just try to read (may return a short read). + * FSCACHE_READ_HOLE_IGNORE - Just try to read (may return a short read). * - * NETFS_READ_HOLE_CLEAR - Seek for data, clearing the part of the buffer + * FSCACHE_READ_HOLE_CLEAR - Seek for data, clearing the part of the buffer * skipped over, then do as for IGNORE. * - * NETFS_READ_HOLE_FAIL - Give ENODATA if we encounter a hole. + * FSCACHE_READ_HOLE_FAIL - Give ENODATA if we encounter a hole. */ static inline int fscache_read(struct netfs_cache_resources *cres, loff_t start_pos, struct iov_iter *iter, - enum netfs_read_from_hole read_hole, + enum fscache_read_from_hole read_hole, fscache_io_terminated_t term_func, void *term_func_priv) { diff --git a/include/linux/netfs.h b/include/linux/netfs.h index 2cac478607a8..998402e34c00 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -221,10 +221,10 @@ struct netfs_request_ops { /* * How to handle reading from a hole. */ -enum netfs_read_from_hole { - NETFS_READ_HOLE_IGNORE, - NETFS_READ_HOLE_CLEAR, - NETFS_READ_HOLE_FAIL, +enum fscache_read_from_hole { + FSCACHE_READ_HOLE_IGNORE, + FSCACHE_READ_HOLE_CLEAR, + FSCACHE_READ_HOLE_FAIL, }; /* @@ -239,7 +239,7 @@ struct netfs_cache_ops { int (*read)(struct netfs_cache_resources *cres, loff_t start_pos, struct iov_iter *iter, - enum netfs_read_from_hole read_hole, + enum fscache_read_from_hole read_hole, fscache_io_terminated_t term_func, void *term_func_priv);