From patchwork Tue May 17 08:26:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 12852110 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF19AC433F5 for ; Tue, 17 May 2022 08:28:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60CA86B0074; Tue, 17 May 2022 04:28:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BCAE6B0075; Tue, 17 May 2022 04:28:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 484796B0078; Tue, 17 May 2022 04:28:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3C7076B0074 for ; Tue, 17 May 2022 04:28:03 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 116D960359 for ; Tue, 17 May 2022 08:28:03 +0000 (UTC) X-FDA: 79474557246.11.A040F3F Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by imf18.hostedemail.com (Postfix) with ESMTP id 7C87F1C00B6 for ; Tue, 17 May 2022 08:27:49 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id a191so16346306pge.2 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=ww/bUnkh5k2vjfdcKt+6keTkCT2R9ykltX5D1jeL2K9L9XT/L7ToJDjAOwwRHmMpqG gGh57+OeyKHsTCIzgxqekobPYGXTcRp37OUO0qv+1rzyu5/38SK+OdBi3OZbW4+K7Ox7 Ktv8vlY5eeva00Iy1bKyocz6SzkBl9qeNk2OQFcew0KuHIx6v5oW4Xb/4DluKMVQcm1N 8HI51L+VCbmObvO76PIQqslPIJ07F4jvMPg7jS04VQZPVxi9hm5J5Np3ejuUOttrwLzt GJrjrihw59qXR6duTjDqQeZ2MtCWYDbAee+IzixHprasNT74aC0oto5CEgKBjWpKk2gD euOA== X-Gm-Message-State: AOAM531DmydP7756q8Kl5Men2GWGNwtEMvv2mMCr8/ZlhniPCgMnhAQX Q0qFsRBxoYkLy3r2pjmWSz/8Cg== 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 X-Stat-Signature: 6e47pk3ic8jp4g1m91q9d5g5juesdtmp X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7C87F1C00B6 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=m3EFejuW; spf=pass (imf18.hostedemail.com: domain of hsinyi@chromium.org designates 209.85.215.182 as permitted sender) smtp.mailfrom=hsinyi@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspam-User: X-HE-Tag: 1652776069-372079 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 @@ obj-$(CONFIG_SQUASHFS) += squashfs.o squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o -squashfs-y += namei.o super.o symlink.o decompressor.o +squashfs-y += namei.o super.o symlink.o decompressor.o page_actor.o squashfs-$(CONFIG_SQUASHFS_FILE_CACHE) += file_cache.o -squashfs-$(CONFIG_SQUASHFS_FILE_DIRECT) += file_direct.o page_actor.o +squashfs-$(CONFIG_SQUASHFS_FILE_DIRECT) += file_direct.o squashfs-$(CONFIG_SQUASHFS_DECOMP_SINGLE) += decompressor_single.o squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI) += decompressor_multi.o squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU) += decompressor_multi_percpu.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 */ -#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 = kmalloc(sizeof(*actor), GFP_KERNEL); - - if (actor == NULL) - return NULL; - - actor->length = length ? : pages * PAGE_SIZE; - actor->page = page; - actor->pages = pages; - actor->next_page = 0; - return actor; -} - -static inline void *squashfs_first_page(struct squashfs_page_actor *actor) -{ - actor->next_page = 1; - return actor->page[0]; -} - -static inline void *squashfs_next_page(struct squashfs_page_actor *actor) -{ - return actor->next_page == 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_page_actor *actor) actor->squashfs_finish_page(actor); } #endif -#endif