From nobody Sun May 10 09:55:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC672C433EF for ; Tue, 17 May 2022 08:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243553AbiEQI2h (ORCPT ); Tue, 17 May 2022 04:28:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243051AbiEQI2B (ORCPT ); Tue, 17 May 2022 04:28:01 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE0E634659 for ; Tue, 17 May 2022 01:27:44 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id x143so172377pfc.11 for ; Tue, 17 May 2022 01:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5RbQ3j9RMbZ/D6MAR7ISAUvOQDvpOlhf1s/Zk6REvQs=; b=cERWjiKZfw6WI/Su4knl08OFpy0v1f15tlBLnsXgpC5PzSp8bOebBCMkUcd5OCB9UD lIxv/+8BEnS2GfuwK7MqUOVhkyw9+22ami2fNlkkuviZhGeIVFudl94jcGgPWlxFoBv4 HyTm/0jPE9VJ4tQ9d/oDOTxiG0k05DenlMHTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5RbQ3j9RMbZ/D6MAR7ISAUvOQDvpOlhf1s/Zk6REvQs=; b=uRqNRAaw+8XMu5nA/f5rX+Tmh725IpHGH4lmF6VUEMEYgB/CPJqZwQziwQlrYjehN3 Rvm//L+r5v+1SWU7DScN+/iRAP+LnA2KiFanQLhllG3YuyWU2MxxLa62SleX3x2+WcAD y8+b5y5Kt5BmBX3jIP8v4e9Pgxl1nVyuG3ShRdoritv17AxSYk7TTwHbG9r3tlPr9ztb +qt5TnLZXhiqIN3i/ojn73HugwF1BSjbHSltst9k/N1YCHevIEM5DmXmrHcJqpCURsiU 0IC7OA16oLMNk+H4ovyBa9wbe6OKQbuLnXCmjHOLwU/ROuDIBGq99BjdZfAS4sy/IUe1 AuKg== X-Gm-Message-State: AOAM530ETrvz7dB/6cWbdpsvHAuTfsT2NKi/SCyipAOXYST2KmaqIkHw gDYaaHQ9ODCvy77Ep28YvOEHeg== X-Google-Smtp-Source: ABdhPJz4aF4dMhqEmu0GTfbz8WlmgQ+lpbplL1Gv3txGEhH2G1P5A91yfhnjV8d4iZYVkJ5sRaF/lw== X-Received: by 2002:a05:6a00:164c:b0:50a:472a:6b0a with SMTP id m12-20020a056a00164c00b0050a472a6b0amr21308254pfc.77.1652776064207; Tue, 17 May 2022 01:27:44 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:beb2:ec58:2159:9a33]) by smtp.gmail.com with ESMTPSA id k9-20020a628409000000b0050dc76281d3sm8615083pfd.173.2022.05.17.01.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:27:43 -0700 (PDT) From: Hsin-Yi Wang To: Phillip Lougher , Matthew Wilcox , Xiongwei Song Cc: Zheng Liang , Zhang Yi , Hou Tao , Miao Xie , Andrew Morton , "linux-mm @ kvack . org" , "squashfs-devel @ lists . sourceforge . net" , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] Revert "squashfs: provide backing_dev_info in order to disable read-ahead" Date: Tue, 17 May 2022 16:26:50 +0800 Message-Id: <20220517082650.2005840-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog In-Reply-To: <20220517082650.2005840-1-hsinyi@chromium.org> References: <20220517082650.2005840-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This reverts commit 9eec1d897139e5de287af5d559a02b811b844d82. Revert closing the readahead to squashfs since the readahead callback for squashfs is implemented. Suggested-by: Xiongwei Song Signed-off-by: Hsin-Yi Wang --- fs/squashfs/super.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 6d594ba2ed28..32565dafa7f3 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c @@ -29,7 +29,6 @@ #include #include #include -#include =20 #include "squashfs_fs.h" #include "squashfs_fs_sb.h" @@ -113,24 +112,6 @@ static const struct squashfs_decompressor *supported_s= quashfs_filesystem( return decompressor; } =20 -static int squashfs_bdi_init(struct super_block *sb) -{ - int err; - unsigned int major =3D MAJOR(sb->s_dev); - unsigned int minor =3D MINOR(sb->s_dev); - - bdi_put(sb->s_bdi); - sb->s_bdi =3D &noop_backing_dev_info; - - err =3D super_setup_bdi_name(sb, "squashfs_%u_%u", major, minor); - if (err) - return err; - - sb->s_bdi->ra_pages =3D 0; - sb->s_bdi->io_pages =3D 0; - - return 0; -} =20 static int squashfs_fill_super(struct super_block *sb, struct fs_context *= fc) { @@ -146,20 +127,6 @@ static int squashfs_fill_super(struct super_block *sb,= struct fs_context *fc) =20 TRACE("Entered squashfs_fill_superblock\n"); =20 - /* - * squashfs provides 'backing_dev_info' in order to disable read-ahead. F= or - * squashfs, I/O is not deferred, it is done immediately in read_folio, - * which means the user would always have to wait their own I/O. So the e= ffect - * of readahead is very weak for squashfs. squashfs_bdi_init will set - * sb->s_bdi->ra_pages and sb->s_bdi->io_pages to 0 and close readahead f= or - * squashfs. - */ - err =3D squashfs_bdi_init(sb); - if (err) { - errorf(fc, "squashfs init bdi failed"); - return err; - } - sb->s_fs_info =3D kzalloc(sizeof(*msblk), GFP_KERNEL); if (sb->s_fs_info =3D=3D NULL) { ERROR("Failed to allocate squashfs_sb_info\n"); --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:55:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 578FBC433F5 for ; Tue, 17 May 2022 08:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234903AbiEQI2Y (ORCPT ); Tue, 17 May 2022 04:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243213AbiEQI2E (ORCPT ); Tue, 17 May 2022 04:28:04 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B81C35840 for ; Tue, 17 May 2022 01:28:02 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id q15so331442pgr.4 for ; Tue, 17 May 2022 01:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+R+fxU+HB5gKOLIq4R9U6MpMKxamVRAqOnvuBWzswog=; b=m3EFejuWwJKbr8acWHYt1jcKH1XPKtFgaFUPy58b25qXx9yCAoCuerpQi4PbWKF27G hGHiDFPzoph/KDl9JYmlHIYxwQqIt1ZjhgiRd6QDvDvAZSXs808vVl3+58ngkfAoA8rl ISEXhRBLuWXeOyCpeTrupazy1U4QHKCuRDBUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+R+fxU+HB5gKOLIq4R9U6MpMKxamVRAqOnvuBWzswog=; b=UHbBO/YX756DNIgWsHgTZ9keHsWYCqQUwoxV80r1pyHx6tSBQrMzRnS6mjOxLgcuMm sJhhcDyLfteuyMUSf1nZkrKAmAB0BBbnO7V3byen4g2xyZQB3lsvZ3TxvMjX+aOpJ4Ha yrsSYDdU9DOAPOMSOQUjdjs2XkzvbAN6q0rHUMemdEsNRGBZ2ZoUKjEvvCcUQopwo2Jc BJvUGkQeh242kJKl7ULGc958W5AwSmSNGzKvPf0XNJ8bJ/DaLEPtXlB7Qc/X93p9b78j eQQKdgZl2Zhzu1FpwkSjpb1d6X+0ncRFrloTj+DuaQGpuDTZR5ZKQBfuXNAaj7M9+I5P Kg5w== X-Gm-Message-State: AOAM531sHhT5W3uFnUkgjA+6KYOBYvkfsHTDbgDH57ZhyobRGEwxIF2g MiDB5QES7FdxfDrXum1DFzcqug== X-Google-Smtp-Source: ABdhPJxTRQM6mw43bwjZ0jYUndKgxmKDCioKQ+bdLyU0Z5Ic7AFcCEZavy5zlfYApCDIc7k2AI2kQA== X-Received: by 2002:a05:6a00:f85:b0:518:10e1:86b with SMTP id ct5-20020a056a000f8500b0051810e1086bmr97209pfb.34.1652776081745; Tue, 17 May 2022 01:28:01 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:beb2:ec58:2159:9a33]) by smtp.gmail.com with ESMTPSA id k9-20020a628409000000b0050dc76281d3sm8615083pfd.173.2022.05.17.01.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:28:01 -0700 (PDT) From: Hsin-Yi Wang To: Phillip Lougher , Matthew Wilcox , Xiongwei Song Cc: Zheng Liang , Zhang Yi , Hou Tao , Miao Xie , Andrew Morton , "linux-mm @ kvack . org" , "squashfs-devel @ lists . sourceforge . net" , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] squashfs: always build "file direct" version of page actor Date: Tue, 17 May 2022 16:26:52 +0800 Message-Id: <20220517082650.2005840-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog In-Reply-To: <20220517082650.2005840-1-hsinyi@chromium.org> References: <20220517082650.2005840-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Phillip Lougher Squashfs_readahead uses the "file direct" version of the page actor, and so build it unconditionally. Reported-by: kernel test robot Signed-off-by: Phillip Lougher Signed-off-by: Hsin-Yi Wang --- fs/squashfs/Makefile | 4 ++-- fs/squashfs/page_actor.h | 41 ---------------------------------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile index 7bd9b8b856d0..477c89a519ee 100644 --- a/fs/squashfs/Makefile +++ b/fs/squashfs/Makefile @@ -5,9 +5,9 @@ =20 obj-$(CONFIG_SQUASHFS) +=3D squashfs.o squashfs-y +=3D block.o cache.o dir.o export.o file.o fragment.o id.o inod= e.o -squashfs-y +=3D namei.o super.o symlink.o decompressor.o +squashfs-y +=3D namei.o super.o symlink.o decompressor.o page_actor.o squashfs-$(CONFIG_SQUASHFS_FILE_CACHE) +=3D file_cache.o -squashfs-$(CONFIG_SQUASHFS_FILE_DIRECT) +=3D file_direct.o page_actor.o +squashfs-$(CONFIG_SQUASHFS_FILE_DIRECT) +=3D file_direct.o squashfs-$(CONFIG_SQUASHFS_DECOMP_SINGLE) +=3D decompressor_single.o squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI) +=3D decompressor_multi.o squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU) +=3D decompressor_multi_pe= rcpu.o diff --git a/fs/squashfs/page_actor.h b/fs/squashfs/page_actor.h index 2e3073ace009..26e07373af8a 100644 --- a/fs/squashfs/page_actor.h +++ b/fs/squashfs/page_actor.h @@ -6,46 +6,6 @@ * Phillip Lougher */ =20 -#ifndef CONFIG_SQUASHFS_FILE_DIRECT -struct squashfs_page_actor { - void **page; - int pages; - int length; - int next_page; -}; - -static inline struct squashfs_page_actor *squashfs_page_actor_init(void **= page, - int pages, int length) -{ - struct squashfs_page_actor *actor =3D kmalloc(sizeof(*actor), GFP_KERNEL); - - if (actor =3D=3D NULL) - return NULL; - - actor->length =3D length ? : pages * PAGE_SIZE; - actor->page =3D page; - actor->pages =3D pages; - actor->next_page =3D 0; - return actor; -} - -static inline void *squashfs_first_page(struct squashfs_page_actor *actor) -{ - actor->next_page =3D 1; - return actor->page[0]; -} - -static inline void *squashfs_next_page(struct squashfs_page_actor *actor) -{ - return actor->next_page =3D=3D actor->pages ? NULL : - actor->page[actor->next_page++]; -} - -static inline void squashfs_finish_page(struct squashfs_page_actor *actor) -{ - /* empty */ -} -#else struct squashfs_page_actor { union { void **buffer; @@ -76,4 +36,3 @@ static inline void squashfs_finish_page(struct squashfs_p= age_actor *actor) actor->squashfs_finish_page(actor); } #endif -#endif --=20 2.36.0.550.gb090851708-goog From nobody Sun May 10 09:55:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAC2BC433F5 for ; Tue, 17 May 2022 08:29:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241664AbiEQI3W (ORCPT ); Tue, 17 May 2022 04:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243189AbiEQI27 (ORCPT ); Tue, 17 May 2022 04:28:59 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B304134BB2 for ; Tue, 17 May 2022 01:28:43 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id z7-20020a17090abd8700b001df78c7c209so1765145pjr.1 for ; Tue, 17 May 2022 01:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=795DpeL4AVvHI+lpL0joEtH4VZitVLN+aqxdeh6jjYU=; b=ED/whdRh9rUIrpg2gVqOkUlPSLfH+d13dKN6o5qhscZGfYA1wIc36jAYuO2aCcUTME tywwpQRtrhoL7YMncd8uUcl8ldVWCDe8Tvq+4wKthS8GnM6L16HjHx69ofm21fozQ2c1 0gPwozKxl0EWsQf4v0ye2mrWDjOsxXqCxTdjA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=795DpeL4AVvHI+lpL0joEtH4VZitVLN+aqxdeh6jjYU=; b=T50XU1eDzJKMrVHoctaCws7G31iheG9pa8nYUH/6IGHL5PW+G14GrexufAjxLY6WuD 4nYFZEO93nbL1UKcRHvtzjhawRgT/7xb3Zy6LYhWlVHBbqazxBXP5IhFylM+8hBzF4D+ wYCMr5eWmi6qQ504UzY5u1LUI/YwVn9/RgKvKHpV74mB2MJ3H8egZgWMx/pyDqdDutf1 x8xUnlEBfEbvcgzlTiC/CgJLqaawW6oBsdu2lmugzPyQJEFZlwvW5XqZdJGbUsxHL9EW c0bZoyzMHFsCkF1dZ3r9p84fjrDjOpygLr0lTe8SYsE0aokBayB7bATQKqihlKPd9+LP +zBw== X-Gm-Message-State: AOAM5303G3HRGcUmpi7RuwinR4YVkoI+Q6NGuDVAFPCjC10ImRMh260z 9c/q9NgYUOIzV9fhE6AJoM4OeA== X-Google-Smtp-Source: ABdhPJw4ZGZtF+d/OR1j0hvEL/B0NPDWxF9N8bLKwYKVOTs7d4kGTcfAco2jqXBr0hSexPHPCcRxIw== X-Received: by 2002:a17:90b:4a02:b0:1dc:4710:c1fe with SMTP id kk2-20020a17090b4a0200b001dc4710c1femr35223567pjb.208.1652776122745; Tue, 17 May 2022 01:28:42 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:beb2:ec58:2159:9a33]) by smtp.gmail.com with ESMTPSA id k9-20020a628409000000b0050dc76281d3sm8615083pfd.173.2022.05.17.01.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 01:28:42 -0700 (PDT) From: Hsin-Yi Wang To: Phillip Lougher , Matthew Wilcox , Xiongwei Song Cc: Zheng Liang , Zhang Yi , Hou Tao , Miao Xie , Andrew Morton , "linux-mm @ kvack . org" , "squashfs-devel @ lists . sourceforge . net" , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] squashfs: implement readahead Date: Tue, 17 May 2022 16:26:54 +0800 Message-Id: <20220517082650.2005840-4-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.0.550.gb090851708-goog In-Reply-To: <20220517082650.2005840-1-hsinyi@chromium.org> References: <20220517082650.2005840-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Implement readahead callback for squashfs. It will read datablocks which cover pages in readahead request. For a few cases it will not mark page as uptodate, including: - file end is 0. - zero filled blocks. - current batch of pages isn't in the same datablock or not enough in a datablock. Otherwise pages will be marked as uptodate. The unhandled pages will be updated by readpage later. Suggested-by: Matthew Wilcox Signed-off-by: Hsin-Yi Wang Reported-by: Matthew Wilcox Reported-by: Phillip Lougher Reported-by: Xiongwei Song --- v1->v2: remove unused check on readahead_expand(). v1: https://lore.kernel.org/lkml/20220516105100.1412740-3-hsinyi@chromium.o= rg/ --- fs/squashfs/file.c | 77 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index a8e495d8eb86..e10a55c5b1eb 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -39,6 +39,7 @@ #include "squashfs_fs_sb.h" #include "squashfs_fs_i.h" #include "squashfs.h" +#include "page_actor.h" =20 /* * Locate cache slot in range [offset, index] for specified inode. If @@ -495,7 +496,81 @@ static int squashfs_read_folio(struct file *file, stru= ct folio *folio) return 0; } =20 +static void squashfs_readahead(struct readahead_control *ractl) +{ + struct inode *inode =3D ractl->mapping->host; + struct squashfs_sb_info *msblk =3D inode->i_sb->s_fs_info; + size_t mask =3D (1UL << msblk->block_log) - 1; + size_t shift =3D msblk->block_log - PAGE_SHIFT; + loff_t start =3D readahead_pos(ractl) &~ mask; + size_t len =3D readahead_length(ractl) + readahead_pos(ractl) - start; + struct squashfs_page_actor *actor; + unsigned int nr_pages =3D 0; + struct page **pages; + u64 block =3D 0; + int bsize, res, i, index; + int file_end =3D i_size_read(inode) >> msblk->block_log; + unsigned int max_pages =3D 1UL << shift; + + readahead_expand(ractl, start, (len | mask) + 1); + + if (file_end =3D=3D 0) + return; + + pages =3D kmalloc_array(max_pages, sizeof(void *), GFP_KERNEL); + if (!pages) + return; + + actor =3D squashfs_page_actor_init_special(pages, max_pages, 0); + if (!actor) + goto out; + + for (;;) { + nr_pages =3D __readahead_batch(ractl, pages, max_pages); + if (!nr_pages) + break; + + if (readahead_pos(ractl) >=3D i_size_read(inode) || + nr_pages < max_pages) + goto skip_pages; + + index =3D pages[0]->index >> shift; + if ((pages[nr_pages - 1]->index >> shift) !=3D index) + goto skip_pages; + + bsize =3D read_blocklist(inode, index, &block); + if (bsize =3D=3D 0) + goto skip_pages; + + res =3D squashfs_read_data(inode->i_sb, block, bsize, NULL, + actor); + + if (res >=3D 0) + for (i =3D 0; i < nr_pages; i++) + SetPageUptodate(pages[i]); + + for (i =3D 0; i < nr_pages; i++) { + unlock_page(pages[i]); + put_page(pages[i]); + } + } + + kfree(actor); + kfree(pages); + return; + +skip_pages: + for (i =3D 0; i < nr_pages; i++) { + unlock_page(pages[i]); + put_page(pages[i]); + } + + kfree(actor); +out: + kfree(pages); +} =20 const struct address_space_operations squashfs_aops =3D { - .read_folio =3D squashfs_read_folio + .read_folio =3D squashfs_read_folio, + .readahead =3D squashfs_readahead }; --=20 2.36.0.550.gb090851708-goog