From patchwork Mon Jun 13 08:28:01 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: 12879164 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 0FB75C433EF for ; Mon, 13 Jun 2022 08:28:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EEE08D0142; Mon, 13 Jun 2022 04:28:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 94EDC6B0259; Mon, 13 Jun 2022 04:28:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C87D8D0142; Mon, 13 Jun 2022 04:28:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 677BB6B0258 for ; Mon, 13 Jun 2022 04:28:14 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3E971344D3 for ; Mon, 13 Jun 2022 08:28:14 +0000 (UTC) X-FDA: 79572535308.20.A133961 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf30.hostedemail.com (Postfix) with ESMTP id D774F80088 for ; Mon, 13 Jun 2022 08:28:13 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id k12-20020a17090a404c00b001eaabc1fe5dso2275078pjg.1 for ; Mon, 13 Jun 2022 01:28:13 -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=PWjwYzB1HNf+oPRDU2wDyWSO4j3cyp8KqyrOSYFXeuM=; b=R43F9PSPlNS3+j0fw+D4qLkyB2pNxxG+Kf9qvBKMGRcozIpC9qYPH9m/kxTrduFUZt Get7ZtYXGMS0lblH3PECs6OSbjvJQAeSIxK8WwtonC7AjhgAC8AMUSGLtH6Qo3XUmCbu CtNNhK/b0kQt0+tvXslyUKS2nSNroZsDd6aJs= 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=PWjwYzB1HNf+oPRDU2wDyWSO4j3cyp8KqyrOSYFXeuM=; b=MpjUtQoj207CZCh9wP+yW3qJJFZq2GVGDAJsmW8y/vrYnei2fpCiikodL9Et+JqCuH 1bHzVtXYNDn+Fa1IH/IIjgEQlorieip1QwzlYBrGqkfNXXUHZlkvIyVlKRHD3x+85tgz oQO0TawD0oD3nnMCj/0M0dxfSBny+kJA3QQ7cXBVU6CTvcKVenIXO+VkDXXvJIH/pmHS meEATz4/XE1Qj9zSlBmkXm65aHm72xO2WvBxGLVq+qJmu2X4PWF+Q/32Kmf11m65SrrR F2rjid+HD1sst+9VdZICde35/v1B2XJ727D22/SQ9Jkk3FLu9qS8L0SppRHDFDugapY0 k9tA== X-Gm-Message-State: AOAM530HJO9wdN3QkjXKNQo/oQJ1/UPY43r6i30BNiCf3iz3f5gXcLDa DLLb25IGL7oATeCek1WfemMVcA== X-Google-Smtp-Source: ABdhPJxGVyS1PPoBilRK9Z+DXulNdhuOawyV0hnMEGPXO44wPhWnP2DXLm8oOQeYEhn1M78QwqZJFg== X-Received: by 2002:a17:902:7e84:b0:166:395c:4b68 with SMTP id z4-20020a1709027e8400b00166395c4b68mr58667443pla.8.1655108892769; Mon, 13 Jun 2022 01:28:12 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:79ca:e1d9:ad5:dc9e]) by smtp.gmail.com with ESMTPSA id br8-20020a056a00440800b00518a473265csm4624906pfb.217.2022.06.13.01.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 01:28:12 -0700 (PDT) From: Hsin-Yi Wang To: Phillip Lougher , Matthew Wilcox , Marek Szyprowski , Andrew Morton Cc: Xiongwei Song , Zheng Liang , Zhang Yi , Hou Tao , Miao Xie , "linux-mm @ kvack . org" , "squashfs-devel @ lists . sourceforge . net" , linux-kernel@vger.kernel.org Subject: [PATCH v6 2/3] squashfs: always build "file direct" version of page actor Date: Mon, 13 Jun 2022 16:28:01 +0800 Message-Id: <20220613082802.1301238-3-hsinyi@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog In-Reply-To: <20220613082802.1301238-1-hsinyi@chromium.org> References: <20220613082802.1301238-1-hsinyi@chromium.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655108894; a=rsa-sha256; cv=none; b=3iy1eTT9GlVGiNVPi3do0JrH4+opJQZjuh95ycpyT5nJk49PSsr8L3mv8j3WyQ4hJHLLt6 aPkljfpFhNo1LRbaJ4PgAgoKnf3ArVPMKAAiTt2H6d8kgKlSLjqGqIl5F40xhBlNRA77ji Pml99Y2m9cE1sD0HKbhvMyQBTejT1JI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655108894; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PWjwYzB1HNf+oPRDU2wDyWSO4j3cyp8KqyrOSYFXeuM=; b=YPDP62jrz6UNmYdYAU3AHKLpMEnN2SEVeShfOQeM4Q0DiR5rkinSXCtRnJLv/E16nsxFOp H1efVByHN3lWvy6ASilSN+cNPIqwulhmeKtcE8MklSDASLOTTjClrHkoyizRdibX5bOP8d 0v2rIOEvOe9qWopDlN5pO7zy5hUzc2I= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=R43F9PSP; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf30.hostedemail.com: domain of hsinyi@chromium.org designates 209.85.216.54 as permitted sender) smtp.mailfrom=hsinyi@chromium.org Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=R43F9PSP; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf30.hostedemail.com: domain of hsinyi@chromium.org designates 209.85.216.54 as permitted sender) smtp.mailfrom=hsinyi@chromium.org X-Stat-Signature: 5sa55x54nabhqqpwe8ahwwk6os5sj5e9 X-Rspamd-Queue-Id: D774F80088 X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1655108893-910711 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 --- v5->v6: rebase content on top of the dependent series. --- fs/squashfs/Makefile | 4 ++-- fs/squashfs/page_actor.h | 46 ---------------------------------------- 2 files changed, 2 insertions(+), 48 deletions(-) diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile index 7bd9b8b856d0b..477c89a519ee8 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 37523c54256fa..24841d28bc0fb 100644 --- a/fs/squashfs/page_actor.h +++ b/fs/squashfs/page_actor.h @@ -6,51 +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 */ -} - -static inline void squashfs_actor_nobuff(struct squashfs_page_actor *actor) -{ - /* empty */ -} -#else struct squashfs_page_actor { union { void **buffer; @@ -91,4 +46,3 @@ static inline void squashfs_actor_nobuff(struct squashfs_page_actor *actor) actor->alloc_buffer = 0; } #endif -#endif