Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5688185pxb; Thu, 20 Jan 2022 02:30:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJydIelgPG2dLAsWdTk4PL+NWefslCS9O9FI9OzPR40+Nplo7nFsjJaw+w7AZ1APrpHaYCjs X-Received: by 2002:a17:90b:4c50:: with SMTP id np16mr10039244pjb.51.1642674629340; Thu, 20 Jan 2022 02:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642674629; cv=none; d=google.com; s=arc-20160816; b=lSzTOaf/uZHBgaymRFX59VAL6YBrLr9uSrRYbLu94kr0tdzIFLh5LYowmLiSvK0LFd 0nixIF+CHKZN5Jp2GuMK3SqBYMvZnUjhpGaiKgF4vyDzcrO6faGHMUbKb3Hix8FAIF9M fWvKQu2WOdvWIw8qsUFjCRrUMdO05QJG0P/MS8bkwMmCtNjguIiUzp4WDaOttVnwQA39 0qmu96hQT5XfcXUjcAewXOt3UaP0hGYsYAHGZTivaN9So8TVWQdaltsa2SegTILMARMU D/xOYx2nFt/ky7z0ZBt6a4gWLJOWtd+RsuHL/bfpu1GfQyygbqCzd0WFffU/6nnOhBBs htxQ== 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=aLhhTX/nL7pyopFPCNnDe6d+F0H1bYPBa/EpzmfyrG8=; b=WXCOwAaESCKLRc1ZiyN3YApdPtbwyzVk8CU/YuD76c0chiq46Ji4QkKFeOehW8CjXF U8P+jUNSyr5ofiR7qMsvSFo3D8T51EdUbpORGV3iwSs56Sou2s+FRV9u6YCXXebgPt+X XXfnhmwunWeOOSdaCOSK0peGWWvLFp8jUkZdtH6csoKJs82NcQ3pCY6xp+n7si3YTFCd xO/AQTf9hJiKm3DtAbJ1m8GLpRLEuimhMDiaHAQTy34LiN+ji4URVj5xJiVk0i98ZCCd 2N38tC0/GgbunCb6fxMvOQQMexPjgcUCSU7VHBq0E6CZeXYj8Zu1WaCeir/fDaZ7Y9lT obOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v69si449855pgd.261.2022.01.20.02.30.17; Thu, 20 Jan 2022 02:30:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242964AbiARNNR (ORCPT + 99 others); Tue, 18 Jan 2022 08:13:17 -0500 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:56252 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242680AbiARNMp (ORCPT ); Tue, 18 Jan 2022 08:12:45 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0V2C2ayE_1642511560; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V2C2ayE_1642511560) by smtp.aliyun-inc.com(127.0.0.1); Tue, 18 Jan 2022 21:12:41 +0800 From: Jeffle Xu To: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: 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 v2 20/20] erofs: support on-demand reading Date: Tue, 18 Jan 2022 21:12:16 +0800 Message-Id: <20220118131216.85338-21-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220118131216.85338-1-jefflexu@linux.alibaba.com> References: <20220118131216.85338-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement the .issue_op() callback, and all work is done by netfs_ondemand_read(). Signed-off-by: Jeffle Xu --- fs/erofs/fscache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index e8df35ee4ba8..9ba668c42098 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -28,9 +28,15 @@ static void erofs_noop_cleanup(struct address_space *mapping, void *netfs_priv) { } +static void erofs_issue_op(struct netfs_read_subrequest *subreq) +{ + netfs_ondemand_read(subreq); +} + static const struct netfs_read_request_ops erofs_blob_req_ops = { .begin_cache_operation = erofs_blob_begin_cache_operation, .cleanup = erofs_noop_cleanup, + .issue_op = erofs_issue_op, }; static int erofs_begin_cache_operation(struct netfs_read_request *rreq) @@ -58,6 +64,7 @@ static const struct netfs_read_request_ops erofs_req_ops = { .begin_cache_operation = erofs_begin_cache_operation, .cleanup = erofs_noop_cleanup, .clamp_length = erofs_clamp_length, + .issue_op = erofs_issue_op, }; static int erofs_fscache_blob_readpage(struct file *data, struct page *page) -- 2.27.0