From patchwork Wed Feb 8 11:29:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 54412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3403340wrn; Wed, 8 Feb 2023 03:39:32 -0800 (PST) X-Google-Smtp-Source: AK7set94+GfukCG3WbBkoOwEM8J7Inh8zx1RwKFZeEITMkSheU+PSXvcgx2M8PTrjzX7x2ViLjVj X-Received: by 2002:a17:90a:e38d:b0:22c:2483:2401 with SMTP id b13-20020a17090ae38d00b0022c24832401mr218702pjz.2.1675856371752; Wed, 08 Feb 2023 03:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675856371; cv=none; d=google.com; s=arc-20160816; b=ZG0PHGUobGHOINmHYAtZDFT6ZCNKDTzxIBdM6KsAluey21oytHumhVr7LICjjwVDfK L9jxd6Lyym27m/gzVeXfgCsVpeRSJhJNX7Tj2hy/ebvM7u8fGRMd9/6g+GbJswZAoybQ 3+w9Zq6XsgiZo/MIUhUkyAv6yVd0aaCBsSikwfxLd2IxJ2T5AUC8kQPlopGmabetNsXF wCgJ85ZyrA2bnRouqkYyQg0TjvRN1zZug35z7ZGIcX8WdWH1woPSEAuf0vItnHTIDAiz RSJvGvfjeFXdWgDewsqwzkCvy2O4SexKFVg6tTcoIgUM5TTyUf8mwe9mmI/mYTEmsOrH /DOw== 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 :message-id:date:subject:cc:to:from; bh=NTnp04I/SRh02sIOUAkY2Ai+IZMU5gzPlpelaSFhd9s=; b=cncMeyW83XekBwkLaUUX/vw4zCPejB6Vq7PU0mddPkDfv6o3gN2dgvUZt6p0Wlzn3u dY+ui4dokNXtzCZL2buIekNCtuzYl/f1v4R8MeOzW+tmeWcQea8HOg50YiLkwpJDVgh5 0vSm1rTitdtm8nj9gVDWPaTfEa0Q3mepmGZpIDiae7b8tb3ivkoYJ79LX67uL8LiTEf/ 1jgWOMzkNq82knxP8Ua2HB2RfYYtGl5satIFenJ7ky6GRWD9CGzUnf/NwkpQH+j4Pll8 Bv7ObWxXiWo839+BI52+hbYiVgxHR/okqkzKY7DQEOaIKc8NtO53Ot2erXP3JFsdlYC+ UEwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a17090a804a00b00231141b9011si1478620pjw.97.2023.02.08.03.39.19; Wed, 08 Feb 2023 03:39:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230515AbjBHL3V (ORCPT + 99 others); Wed, 8 Feb 2023 06:29:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230236AbjBHL3T (ORCPT ); Wed, 8 Feb 2023 06:29:19 -0500 Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B1D93CE33 for ; Wed, 8 Feb 2023 03:29:17 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VbBr6Y5_1675855755; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VbBr6Y5_1675855755) by smtp.aliyun-inc.com; Wed, 08 Feb 2023 19:29:15 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, huyue2@coolpad.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] erofs: update print symbols for various flags in trace Date: Wed, 8 Feb 2023 19:29:14 +0800 Message-Id: <20230208112915.6543-1-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757262771342894758?= X-GMAIL-MSGID: =?utf-8?q?1757262771342894758?= As new flags introduced, the corresponding print symbols for trace are not added accordingly. Add these missing print symbols for these flags. Also remove the print symbol for EROFS_GET_BLOCKS_RAW as it is going to be removed soon. Signed-off-by: Jingbo Xu --- v2: remove print symbol for EROFS_GET_BLOCKS_RAW --- include/trace/events/erofs.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h index e095d36db939..cf4a0d28b178 100644 --- a/include/trace/events/erofs.h +++ b/include/trace/events/erofs.h @@ -19,12 +19,17 @@ struct erofs_map_blocks; { 1, "DIR" }) #define show_map_flags(flags) __print_flags(flags, "|", \ - { EROFS_GET_BLOCKS_RAW, "RAW" }) + { EROFS_GET_BLOCKS_FIEMAP, "FIEMAP" }, \ + { EROFS_GET_BLOCKS_READMORE, "READMORE" }, \ + { EROFS_GET_BLOCKS_FINDTAIL, "FINDTAIL" }) #define show_mflags(flags) __print_flags(flags, "", \ - { EROFS_MAP_MAPPED, "M" }, \ - { EROFS_MAP_META, "I" }, \ - { EROFS_MAP_ENCODED, "E" }) + { EROFS_MAP_MAPPED, "M" }, \ + { EROFS_MAP_META, "I" }, \ + { EROFS_MAP_ENCODED, "E" }, \ + { EROFS_MAP_FULL_MAPPED, "F" }, \ + { EROFS_MAP_FRAGMENT, "R" }, \ + { EROFS_MAP_PARTIAL_REF, "P" }) TRACE_EVENT(erofs_lookup, From patchwork Wed Feb 8 11:29:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingbo Xu X-Patchwork-Id: 54413 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3403869wrn; Wed, 8 Feb 2023 03:40:54 -0800 (PST) X-Google-Smtp-Source: AK7set8iLwn2+zbruufWU2SrNyMFrn/8/mkU8mzk5clCZGh+wtXcJqco96tq56a0Xknkq5IeJiEq X-Received: by 2002:a05:6a20:8e19:b0:b8:84d2:f9aa with SMTP id y25-20020a056a208e1900b000b884d2f9aamr4436096pzj.2.1675856454289; Wed, 08 Feb 2023 03:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675856454; cv=none; d=google.com; s=arc-20160816; b=IISAqwsfqgpDA9PLxBFXMGCKs0aBjzTmxnHW94bLxP9iOziAZto3CHzv5O/AAoNapx Tg5mBksN5XV/wB8tfiVlAwRZLyxAmvFijN8wFjYlLQPNyqaobvH+B5y04I18e6XDep9N pepdcWPzqI51vGeZjaDfLSwUsYLLwBj8QC4vfmS9V599BnLTg2ty4R8F9mLT1vWk/IKE goO3/bPSmufqv5e/EQJ191c4eK3p2ac5Qdf/hlpzxawKqvSMZeRfj3pRZGbunPgHZ+QA vl7vZS/sTQK20cCac8olwE3/dSsTxP4Ul4o/pbJBQzIpRy3h2KeKa3DxY5Cav/8Rro7t kDYA== 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=H3+GkqFit+4g6km6C9fr9ESjVUzOV7li/2W3x6gHy7k=; b=WQb8BWeO6ZXmmV7DbUhbfRd124zpRDHVQl7ie0S9JdqhhMmsUiZBYWMKtPsIpvjIrI XJU8ql7YC1FrYDmRts8wiZ2vZ5D8hpFh7FMY7BRgynDEOqlDjSm3n740XqPj+bh230Jw Gwk9oXEnOK4evZLLZ77TiGjldFnzYTFHuTwKJ4qgCPRzJIILUtno0ZKtVZRnu/Vp6gjZ uHqRoE4k70gO6h11xVKxNcqrXOteqw1ECAVR663cNJ8t766+VTqRkF5Zqu/t/9IPAcMb uXAaXHsgyUUrhyAGrMkYxCiTj1H1hVKx0zhJfzd7YBYiOKUJHcKEnvrqjGPpb9CAIy+m //Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a639343000000b004f1956b511dsi16867221pgm.219.2023.02.08.03.40.40; Wed, 08 Feb 2023 03:40:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231142AbjBHL3X (ORCPT + 99 others); Wed, 8 Feb 2023 06:29:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbjBHL3U (ORCPT ); Wed, 8 Feb 2023 06:29:20 -0500 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E6910F2 for ; Wed, 8 Feb 2023 03:29:18 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VbBvrhq_1675855756; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VbBvrhq_1675855756) by smtp.aliyun-inc.com; Wed, 08 Feb 2023 19:29:16 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, huyue2@coolpad.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] erofs: remove unused EROFS_GET_BLOCKS_RAW flag Date: Wed, 8 Feb 2023 19:29:15 +0800 Message-Id: <20230208112915.6543-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230208112915.6543-1-jefflexu@linux.alibaba.com> References: <20230208112915.6543-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757262857786857471?= X-GMAIL-MSGID: =?utf-8?q?1757262857786857471?= For erofs_map_blocks() and erofs_map_blocks_flatmode(), the flags argument is always EROFS_GET_BLOCKS_RAW. Thus remove the unused flags parameter for these two functions. Besides EROFS_GET_BLOCKS_RAW is originally introduced for reading compressed (raw) data for compressed files. However it's never used actually and let's remove it now. Signed-off-by: Jingbo Xu --- fs/erofs/data.c | 14 ++++++-------- fs/erofs/fscache.c | 2 +- fs/erofs/internal.h | 10 ++++------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 2713257ee718..032e12dccb84 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -74,8 +74,7 @@ void *erofs_read_metabuf(struct erofs_buf *buf, struct super_block *sb, } static int erofs_map_blocks_flatmode(struct inode *inode, - struct erofs_map_blocks *map, - int flags) + struct erofs_map_blocks *map) { erofs_blk_t nblocks, lastblk; u64 offset = map->m_la; @@ -114,8 +113,7 @@ static int erofs_map_blocks_flatmode(struct inode *inode, return 0; } -int erofs_map_blocks(struct inode *inode, - struct erofs_map_blocks *map, int flags) +int erofs_map_blocks(struct inode *inode, struct erofs_map_blocks *map) { struct super_block *sb = inode->i_sb; struct erofs_inode *vi = EROFS_I(inode); @@ -127,7 +125,7 @@ int erofs_map_blocks(struct inode *inode, void *kaddr; int err = 0; - trace_erofs_map_blocks_enter(inode, map, flags); + trace_erofs_map_blocks_enter(inode, map, 0); map->m_deviceid = 0; if (map->m_la >= inode->i_size) { /* leave out-of-bound access unmapped */ @@ -137,7 +135,7 @@ int erofs_map_blocks(struct inode *inode, } if (vi->datalayout != EROFS_INODE_CHUNK_BASED) { - err = erofs_map_blocks_flatmode(inode, map, flags); + err = erofs_map_blocks_flatmode(inode, map); goto out; } @@ -189,7 +187,7 @@ int erofs_map_blocks(struct inode *inode, out: if (!err) map->m_llen = map->m_plen; - trace_erofs_map_blocks_exit(inode, map, flags, 0); + trace_erofs_map_blocks_exit(inode, map, 0, err); return err; } @@ -252,7 +250,7 @@ static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length, map.m_la = offset; map.m_llen = length; - ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); + ret = erofs_map_blocks(inode, &map); if (ret < 0) return ret; diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 03de4dc99302..9658cf8689d9 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -197,7 +197,7 @@ static int erofs_fscache_data_read_slice(struct erofs_fscache_request *primary) int ret; map.m_la = pos; - ret = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW); + ret = erofs_map_blocks(inode, &map); if (ret) return ret; diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 48a2f33de15a..8a6ae820cd6d 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -401,16 +401,15 @@ struct erofs_map_blocks { unsigned int m_flags; }; -#define EROFS_GET_BLOCKS_RAW 0x0001 /* * Used to get the exact decompressed length, e.g. fiemap (consider lookback * approach instead if possible since it's more metadata lightweight.) */ -#define EROFS_GET_BLOCKS_FIEMAP 0x0002 +#define EROFS_GET_BLOCKS_FIEMAP 0x0001 /* Used to map the whole extent if non-negligible data is requested for LZMA */ -#define EROFS_GET_BLOCKS_READMORE 0x0004 +#define EROFS_GET_BLOCKS_READMORE 0x0002 /* Used to map tail extent for tailpacking inline or fragment pcluster */ -#define EROFS_GET_BLOCKS_FINDTAIL 0x0008 +#define EROFS_GET_BLOCKS_FINDTAIL 0x0004 enum { Z_EROFS_COMPRESSION_SHIFTED = Z_EROFS_COMPRESSION_MAX, @@ -458,8 +457,7 @@ void *erofs_read_metabuf(struct erofs_buf *buf, struct super_block *sb, int erofs_map_dev(struct super_block *sb, struct erofs_map_dev *dev); int erofs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, u64 start, u64 len); -int erofs_map_blocks(struct inode *inode, - struct erofs_map_blocks *map, int flags); +int erofs_map_blocks(struct inode *inode, struct erofs_map_blocks *map); struct inode *erofs_iget(struct super_block *sb, erofs_nid_t nid); int erofs_getattr(struct user_namespace *mnt_userns, const struct path *path, struct kstat *stat, u32 request_mask,