From patchwork Mon Apr 8 13:11:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13621196 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A40CBC67861 for ; Mon, 8 Apr 2024 13:46:38 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rtpKV-0003zu-TY; Mon, 08 Apr 2024 13:46:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rtpKU-0003zf-EJ for linux-f2fs-devel@lists.sourceforge.net; Mon, 08 Apr 2024 13:46:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=435CMry6b/Ur3ATLhDQLWv8TL4NW3zA/cV2qOjy1KvU=; b=H8Ud0sjazFHsAh5taLkSr+zHWQ VOIhS4L7rNyWawWzuu4kYhd6lIOGO2Ndh3oleczwAVDQ8RDkHzTicsw3wsUhv7I5MaJIxDMOTvT4W DFbAdy/b4u2h0/X/KRKbbf4Ke/ODuz3BQLhkRPLA+dvGbVAruC9XgRwUxRwQ6nC8uNNI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=435CMry6b/Ur3ATLhDQLWv8TL4NW3zA/cV2qOjy1KvU=; b=n UjLjRUYSrYQtCQ1OAPG70FxTGItIITYqS03AjBqf1E8/f6dys/8ID/uCII56XnNK7Nkfdzwr2UfG2 uVzUajNUKaQyb6oaHg3+OMftCLeHcI32lc+umTBiH869SWk8VeX9RJev4vgYYFTtQnXiRaiTtqLWt pZuPRCshYSDtXmuY=; Received: from mail-southeastasiaazon11021006.outbound.protection.outlook.com ([52.101.133.6] helo=SINPR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rtpKR-00054F-H4 for linux-f2fs-devel@lists.sourceforge.net; Mon, 08 Apr 2024 13:46:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WgJGtSzL4NbCOG1FHyIjmskc7XcTejetJ5AmLVFdEVg0U52i4zYTdz6BUeE4q8tspGGi76OfUuEidbEJ7R+f8l6cwQtOtzJ26SazE5JetANgHQBS2Xv5zhAli6P2/DUyPXpexrgivirpoTi56Mrwn04UvNRGKIWVNFAlnOqQnAu1AJsr+fMZZYLmxQj8B6lxAV4kf1r409fTvLhLPcP0CBHuGiqlkPiOke3pP73CKDz8CdXTmePLw3cOLBks8kzS/dFKFcfH99Y0YWjJcdJZI0c7hEKCIlxI/nUJCo0uMvSiAyE5IpHRxmCkbvxOkpQtOaVRWN+ZeMDc5zYf74jU7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=435CMry6b/Ur3ATLhDQLWv8TL4NW3zA/cV2qOjy1KvU=; b=jesN5axLJNl6YbioKkQYE0sZXDzihSXiJNNY8r2uE+4uW2XBx++YsFeMvRHOe24g6OBLOWft6T+UC2dJgGEcuZu69Y/QVKyTlZsWVxiBvYTHom5JwSfARTdLe9Ylv0sZSVsfmFOsoJuhVp893mLDAKLNpzgEfyBE7un/slZ23bv1MIjLyPLdKvDZ+z4GSdmgg46pK464F98m0iVou2SBUOno1jgOEp7koey4CTj2a2PUzdO/tw9wuFQlo6H1Jy21a3As0tPOYvibiz+V5+eZiGCBM8wp39c0EBaVvyLmlt447sOvfHA6mcH5IkmcPx1GKbr/eO2E6YShzv1djztWVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=435CMry6b/Ur3ATLhDQLWv8TL4NW3zA/cV2qOjy1KvU=; b=oAk5msECTO8FeN29t8VhYaZFQ6t7kx1fh2RAhEjTG6v3ndBIvlPwIma6617uevhmiu6mvsUR7QQMGfqa/gjUIMWEj9q1HYLRG7mMI/3W73PE25eFZh8DFYZPubhI7yjwCZxxd891Tcxkv/k7QHb0w8/p3T3ABQCh68zfipb0JUw= Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by KL1PR02MB6141.apcprd02.prod.outlook.com (2603:1096:820:be::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 8 Apr 2024 13:11:51 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::a99e:50b1:70a6:3afc]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::a99e:50b1:70a6:3afc%4]) with mapi id 15.20.7409.042; Mon, 8 Apr 2024 13:11:51 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Mon, 8 Apr 2024 21:11:40 +0800 Message-Id: <20240408131140.4100090-1-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: SGBP274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::20) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|KL1PR02MB6141:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gdRIlMGn6anCNc00TfnEFTwPHtV91fxeJCqRh83v7H+9/vEbakDHMHWo7PzPpv5gdeWu80O9Ws4Vx0EGoOpuG7pe6aagaclzHO7tcJOV55tpLHamV57BpzBcXMvkArLQ8Xn0ILGQ6EHG/DB2tOFT6THiGTbzz2ZNllHDnUWb8PsHHMqzT5dPP+tTcXxA2mzrtYcpnJPDTTuInMpMG5mJAmqVhi59rl1xQKJ3qyGV2BtkqozDFYVIrIoHawMhKjXbdMiZbQDJdahfLXg2SupYm58ku5RGS/gvDiG0P2P0FOYADrGFcHYzpDLqqVxZsKPLzBca+cPNDKg3em+hI3+tHWjaEe6Np8+Fc1L4np1NU0n6tyr05Pm0a+Sm8W+X3EGLYjLrupkAasZ7mdqBmg3ibxLJFgQP6c3JfiZiqQEg3mJRa6RP/Gnd2mjspDpkF9M67Z2TeA1wN2V4pLfTw11/NzSmvbg/qWa1quN65rkVPIMZs2Y5FHMfgsUb9Uz98nPlcAINpizFy802xI2mx7KHWNG4Oso4Hyq/izgVxREFNcsfQMp0J4M5bYpHFdEvSQbV4QHvT1nMOq2nktiJYIWXUyEbPCSxHChlHhC7KWdEvYnzQ3FuGTOc5YGnioOXt9RAIARaMCgmVmoiKyp/d0n6nlnWuYVCQTMNgkAoWNXGpa+wOiZjIHJtG6Os9n07oQRpHrm8VSV/ubID1pFGullxaIsDzkQmYxmXJMhtyeiNlPc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(366007)(52116005)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 26pCmXp0uu7Bp8KDtTHJ2kmXAF49sz50NkEFsLPDN+FB0WCy6b2oqrlP+WzrhDAPAUtFhNk15J3nZy601doJvA8swrIkGs0rvWtaf0/HPky2PUiyiA7ytNWzIK8LEQ9TpXEBxcP8JREwqoSAxg0RFwG1h6FIhaulhpkOIP7dZza/t3nhNH4kHWIwcZ7eYpEJrqVe4MtXhdUq1RYzURM6Si2q1Mjk60LN+4FbVRa8R040de1rc1AHLnzCXVztnKpYBn2RnXp+HGnT4ghPTTr3sgmqOqtriGsJEXaS5FTfN11HXdO4TCRXNszAYSvzKi3CxgdTRhg9ng8zKEd6jOUKECirsusYi4enryybKTiPhhU8UW8EjtG1eBLh9OiwzGqfaKM2iVJvISGbR1h8DZrip1Ciy58835VyjPlvzXODrXE+9OtIV1LNVfmi7owweX2oVA5h0DIaFwvr8okSNsF3JBhEUde0nvJbAPgopLZjPPR5FXu7cuIRfi4mdGGVjS4RLmqK7bhrzJoSzAm/MtVVl90bp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com X-MS-Exchange-CrossTenant-Network-Message-Id: f6938b8f-6f0d-4a96-6a15-08dc57cd7452 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2024 13:11:51.2890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G0E7Ty4R/qHF+GGJQTRmoIHrW809TwsSXbpoxVTxY+9/u8bsIl4hLMnyWqFwKimNd9ROSQo0z/NO22G5tG7i0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR02MB6141 X-Headers-End: 1rtpKR-00054F-H4 Subject: [f2fs-dev] [PATCH] f2fs-tools: print extension list properly X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net The "hot file extensions" list does not print properly. **Before** extension_count [0x 23 : 35] cold file extentsions [mp wm og jp ] [avi m4v m4p mkv ] [mov webm wav m4a ] [3gp opus flac gif ] [png svg webp jar ] [deb iso gz xz ] [zst pdf pyc ttc ] [ttf exe apk cnt ] [exo odex vdex ] hot_ext_count [0x 1 : 1] hot file extentsions db ] cp_payload [0x 0 : 0] **After** extension_count [0x 23 : 35] cold file extentsions [mp wm og jp ] [avi m4v m4p mkv ] [mov webm wav m4a ] [3gp opus flac gif ] [png svg webp jar ] [deb iso gz xz ] [zst pdf pyc ttc ] [ttf exe apk cnt ] [exo odex vdex ] hot_ext_count [0x 1 : 1] hot file extentsions [db ] cp_payload [0x 0 : 0] Signed-off-by: Sheng Yong Reviewed-by: Chao Yu --- fsck/mount.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index b983920..8524335 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -429,20 +429,26 @@ void print_extention_list(struct f2fs_super_block *sb, int cold) printf("%s file extentsions\n", cold ? "cold" : "hot"); - for (i = start; i < end; i++) { + for (i = 0; i < end - start; i++) { if (c.layout) { printf("%-30s %-8.8s\n", "extension_list", - sb->extension_list[i]); + sb->extension_list[start + i]); } else { if (i % 4 == 0) printf("%-30s\t\t[", ""); - printf("%-8.8s", sb->extension_list[i]); + printf("%-8.8s", sb->extension_list[start + i]); - if (i % 4 == 4 - 1 || i == end - start - 1) + if (i % 4 == 4 - 1) printf("]\n"); } } + + for (; i < round_up(end - start, 4) * 4; i++) { + printf("%-8.8s", ""); + if (i % 4 == 4 - 1) + printf("]\n"); + } } static void DISP_label(const char *name)