Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp831914lqo; Fri, 17 May 2024 03:00:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNMpr/bydifkJpXJqNNlBwELkxhYPwsKW6bnl6ez9fVX0aNodReQrrQsZrz45XOToMfU1G739XTmeMCvWFdRpVWGHHrmpi37Z8Sp6KQw== X-Google-Smtp-Source: AGHT+IEa8+chMwHkiQTBLzMJ8J0vA3iHYWFSQ+4j1Gnpo2wlJk9pycMQLL3eaKY7ZDNJJ8mEmFhF X-Received: by 2002:a05:6870:b4aa:b0:23f:eea9:ae35 with SMTP id 586e51a60fabf-24172bdfb52mr25266976fac.41.1715940020422; Fri, 17 May 2024 03:00:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715940020; cv=pass; d=google.com; s=arc-20160816; b=TIQ9jRcbudgEMBqYADOOuk2x41Lw6hwtwh4zfsUITs0xBwbMLfzYFkh2swVDKG9xoM NmP5jCe3NaKQg7xp2rkYsg5HByGIqjecQc0Jy0R1/WvsBV+pO5N0IdN6b/1CKMY5XrdT IpG3UUJ00eJR0IS/CZQmGoObDpqoboktftAW52WD4kY6WVov7YSV9pFfPsJTUPyXjgVU FBGhvPo6hidSI65cTZVTl0wOhNqzSFEiJ76amAptFBFHnL6u1uI4Vzm0h6T5H4jkDpPJ pM2ic6kswcOA1oBD9hJ0RmhSr5V6jC+McQI+xOpYTasl8ORuE5F3BtfMY/9x8doFOhw6 hj9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=hdb/3TvARJVZ7RhOX63ITgXZ/E5Lk4N24+C/9grOEmc=; fh=F5Jw1qm4JDs9yW0DavQSA2HoDhZ6jfUR51p32vWd+hI=; b=euHcx6qP+69RLpth/FMn9LIUiiyn3M5x9oCN6tjfOZIJ6r91PL0P+dNTCN12wAeCfL 8Xy1aqYNVsYWLjco78HLVAsMJoSimw8dOR8DvKM46eXAXEr0Eke9lse9rrUeII0yBH4j R0TWnEK/XmFcucE2ygO5VSZqCSTd8bJ9E1Cai7bBPRiI2dLG5qa6Y2TUOiMihWVV5U8h mgJJgy//1Qpf6NAC8bhkY02wiUa7cTWQogsUf7KWGRWN4R2BUAptgBmHtWVE+hSUjpmX 2c6vE+PkKH5MNeqqACF7MAatBdEDKHxpZp2IFnNEgJUrE0ARuAiF6U2GF7/jDzzQqOg3 RaVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=FgjE81uD; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-181963-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181963-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-65c5a29f820si2107608a12.505.2024.05.17.03.00.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 03:00:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181963-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=FgjE81uD; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-181963-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181963-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id AF67DB228F6 for ; Fri, 17 May 2024 09:57:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31CAB3613C; Fri, 17 May 2024 09:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="FgjE81uD" Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9079C2E852 for ; Fri, 17 May 2024 09:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715939820; cv=none; b=TyGMWYk1aBjRITrkSTYiin929pEqOBvB+0JxzVXLCog4FKuBzDKyOaFHKjuXpkRUVeYTBedgMmy+NDqhO/KxRRf9mxYLe/BW1ZU3wZA21m2wIRjU2NoPwxbGnMTx1zwxvEGF4npeBzCduT3HhJLDJWqD00KlSO1IB87AGYny5Us= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715939820; c=relaxed/simple; bh=6dv1ARr8AfSeat6L7IDqLiV12HzGwVJ0hWWWehC6BRs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PaMsVMJWqm79tfvrcZRvAUBPxBwoSfnR9B74k3vEMgqJpDWPCpWwcarnFiFn6Zv4vE0ab7+tbfwMg7GWp0gEYhnLdw2mk+2830WMN0rSPc/WLYojmpUuMqPTpU/hDXIZCqU3KdGCvf+GTC8ylqBZr9BgxhsEdvuqL5BD2UWq2fs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=FgjE81uD; arc=none smtp.client-ip=115.124.30.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1715939815; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=hdb/3TvARJVZ7RhOX63ITgXZ/E5Lk4N24+C/9grOEmc=; b=FgjE81uDttziQ+J8maIJEwy1a+FLXj+8UVYShcOWqcIhNSAoQWKD8ELDGocbVH8DuFQKx1HlKbXtV4cyyYyPiHTwvjFoaSFzqoY0hxm7GYYCiCrRoslPjUDg7TySttS4ByOglcTyGfq/DpHScI+EU/RbzhQTtxasWJdQaOsKw64= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R821e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067111;MF=hongzhen@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0W6eF9U7_1715939813; Received: from localhost(mailfrom:hongzhen@linux.alibaba.com fp:SMTPD_---0W6eF9U7_1715939813) by smtp.aliyun-inc.com; Fri, 17 May 2024 17:56:55 +0800 From: Hongzhen Luo To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: huyue2@coolpad.com, jefflexu@linux.alibaba.com, linux-kernel@vger.kernel.org, Hongzhen Luo Subject: [PATCH] erofs: clean up erofs_show_options() Date: Fri, 17 May 2024 17:56:52 +0800 Message-Id: <20240517095652.2282972-1-hongzhen@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Avoid unnecessary #ifdefs and simplify the code a bit. Signed-off-by: Hongzhen Luo --- fs/erofs/internal.h | 3 --- fs/erofs/super.c | 28 ++++++++-------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 39c67119f43b..16097d95501a 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -64,15 +64,12 @@ enum { }; struct erofs_mount_opts { -#ifdef CONFIG_EROFS_FS_ZIP /* current strategy of how to use managed cache */ unsigned char cache_strategy; /* strategy of sync decompression (0 - auto, 1 - force on, 2 - force off) */ unsigned int sync_decompress; - /* threshold for decompression synchronously */ unsigned int max_sync_decompress_pages; -#endif unsigned int mount_opt; }; diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 69308fd73e4a..14822642e2f6 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -948,26 +948,14 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root) struct erofs_sb_info *sbi = EROFS_SB(root->d_sb); struct erofs_mount_opts *opt = &sbi->opt; -#ifdef CONFIG_EROFS_FS_XATTR - if (test_opt(opt, XATTR_USER)) - seq_puts(seq, ",user_xattr"); - else - seq_puts(seq, ",nouser_xattr"); -#endif -#ifdef CONFIG_EROFS_FS_POSIX_ACL - if (test_opt(opt, POSIX_ACL)) - seq_puts(seq, ",acl"); - else - seq_puts(seq, ",noacl"); -#endif -#ifdef CONFIG_EROFS_FS_ZIP - if (opt->cache_strategy == EROFS_ZIP_CACHE_DISABLED) - seq_puts(seq, ",cache_strategy=disabled"); - else if (opt->cache_strategy == EROFS_ZIP_CACHE_READAHEAD) - seq_puts(seq, ",cache_strategy=readahead"); - else if (opt->cache_strategy == EROFS_ZIP_CACHE_READAROUND) - seq_puts(seq, ",cache_strategy=readaround"); -#endif + if (IS_ENABLED(CONFIG_EROFS_FS_XATTR)) + seq_puts(seq, test_opt(opt, XATTR_USER) ? + ",user_xattr" : ",nouser_xattr"); + if (IS_ENABLED(CONFIG_EROFS_FS_POSIX_ACL)) + seq_puts(seq, test_opt(opt, POSIX_ACL) ? ",acl" : ",noacl"); + if (IS_ENABLED(CONFIG_EROFS_FS_ZIP)) + seq_printf(seq, ",cache_strategy=%s", + erofs_param_cache_strategy[opt->cache_strategy].name); if (test_opt(opt, DAX_ALWAYS)) seq_puts(seq, ",dax=always"); if (test_opt(opt, DAX_NEVER)) -- 2.39.3