Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6126544rwb; Sun, 11 Dec 2022 19:39:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5aV3BL2qSQY/+lkMtzbpOtU5Yb5hitdh0Ui9ISca10LFiZkcQ0mDYo0kgMKChEWSxsdY6r X-Received: by 2002:a17:90a:bd17:b0:218:77c1:5557 with SMTP id y23-20020a17090abd1700b0021877c15557mr14690299pjr.41.1670816380591; Sun, 11 Dec 2022 19:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670816380; cv=none; d=google.com; s=arc-20160816; b=qIUfVmY5xdad470+nP2Gt/MKjEszumxHOiHAWmL4TOVdXaAg7QgnGBhGZ9rfWfoNTX DlY+jt524ZIItQDsd8tmICc2S+7wiLscpbgovCfbfAVgrBtLyPkO5Ukrwx899PN/BFEI pp4ZSFsgz0drKkteYIAXPfo2wRVi28fglN10FxV4fA6ygGt5SngGK+gYnkmS74CR87N6 HWSb9c9FHm+1ObYeQ6Jy/Wm+tAsxAQXLhvg5Xxwbwe2L6K4N7hK+g40K4zpDjVCWsU3K qz6fS8HJfvevZ0RedlPvJLyVaDB68Adxj25TIaFrsfX9kNhpUjY7hA6+uwfXblJKqVS6 z9LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:reply-to:user-agent :mime-version:date:message-id:from:dkim-signature; bh=DFgrDYhwuet6qjJ8Wq4sAS0uEiwAbXa5YALkWoY0Wck=; b=NlcOr1CGFZIuWzRyldywn96V81B1ooUnpmrkwG65TmQn9ShzSFqGioELfgBRYrMCbo V7fYik7CDxds+QbOjV3HmpWr82e8HjtgSOxTPX4SHfmyOE/uF+oO+woApXqAABXIo1IE E16BSO7Y0cTrZ5nMQAYc5SlgHe06wBwDBd4mN/XnJ5V1Ty4h2IdXtarO8jXjHN/Upxf8 Wvu+rjfzRDnVaUsbwH71CTlyuy92PejYVEDI/y/HxTo5esIRYPQoMdOxh4J+mFkpyZaU 42YQMU+FW63Vdq+IMQjP4g067qfZ5qVzjrbb18M8tw53uYW4FGB0udlTxFlM4AXBkVCq kvxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CfI2c265; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l70-20020a638849000000b004785dacca57si7810588pgd.457.2022.12.11.19.39.29; Sun, 11 Dec 2022 19:39:40 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CfI2c265; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230441AbiLLDaE (ORCPT + 77 others); Sun, 11 Dec 2022 22:30:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbiLLDaA (ORCPT ); Sun, 11 Dec 2022 22:30:00 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B67B9DE90; Sun, 11 Dec 2022 19:29:59 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id 17so3293233pll.0; Sun, 11 Dec 2022 19:29:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:reply-to:user-agent:mime-version:date:message-id:from :from:to:cc:subject:date:message-id:reply-to; bh=DFgrDYhwuet6qjJ8Wq4sAS0uEiwAbXa5YALkWoY0Wck=; b=CfI2c265dZResWya/YCRxbZJeNm+wWXrt3ejL/JdVZYrEs3uGVmhCIt7wFam1u9ZDv TqIM/NZGil4Lc0+wUaN1EaWIB8IALKqgAM/xEQa/VvXmnUaOiSq8BQipxwsBd6wOHmv2 /Tff/l5/3FUSFndWolsvOjWYHP/diJOCjc4YHGl+CRYWNY0V+EB51SDl3n+2KW3y8kM9 bF1tRJYUgmbHkmUpXdMWW2wWGyME1zN1/wDOoTTkhgMA4A+dNVkVn1PzdkxgAsrE9x0V 3I6nQa8ucXXTn3dPby/kSsF2QI0j36gxmcYVWIJ1yGIxAiZPbmY9wxt0q9XYglaWTFfJ jILg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:reply-to:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DFgrDYhwuet6qjJ8Wq4sAS0uEiwAbXa5YALkWoY0Wck=; b=NRsmI2vk3DpPMLBxw/U2qRHmjIRE/3xvNA04vKDoiYezpPLrWAkuxixciFGtAX//CO iU2SAQCTQvH9i/R9552HysZLRVpppIqYx5QSigzAtiTaUpB4I98lET02Tn/1juD1tbao gfw2BNAUll/UJ+940oe9UVeb+Z7vXKEyodyuDrj2Xc9wpinmmomtQETWBba5Wpeq61Es N3hc+TC89/FmeybAVzoagyfvhnd/qp8i2F8KOiLCgPLXUCTc6MmGBfuC6kdb8elcShm0 Zg/95VqDnAo3PpXkXRtq4dmRuWfbmUogBYVzOWrHFcA81XWuanka/mYVmX6zWNwo31OE jX0w== X-Gm-Message-State: ANoB5pkpqD7rx27ZleUQU+g46/GNO6kqo5fkAXZ0JBjlPFtOqObutCiq swfSMM2WOVQUXghisV8G40gRJtzd+SAcxQ== X-Received: by 2002:a17:90a:c304:b0:20d:bd63:830a with SMTP id g4-20020a17090ac30400b0020dbd63830amr14630926pjt.49.1670815799253; Sun, 11 Dec 2022 19:29:59 -0800 (PST) Received: from [172.22.60.4] ([1.242.215.113]) by smtp.gmail.com with ESMTPSA id gf12-20020a17090ac7cc00b0021904307a53sm4338816pjb.19.2022.12.11.19.29.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Dec 2022 19:29:58 -0800 (PST) From: Sungjong Seo X-Google-Original-From: Sungjong Seo Message-ID: <5229bc2c-2191-8e4d-f711-4787f8306226@samsung.com> Date: Mon, 12 Dec 2022 12:29:54 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Reply-To: sj1557.seo@samsung.com Subject: Re: [PATCH v1 6/6] exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set() To: "Yuezhang.Mo@sony.com" , "linkinjeon@kernel.org" Cc: "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi. Yuezhang, On 12/5/22 14:10, Yuezhang.Mo@sony.com wrote: > In exfat_get_dentry_set(), part of the code is the same as > exfat_find_location(), reuse exfat_find_location() to simplify > exfat_get_dentry_set(). > > Code refinement, no functional changes. > > Signed-off-by: Yuezhang Mo > Reviewed-by: Andy Wu > Reviewed-by: Aoyama Wataru > --- > fs/exfat/dir.c | 17 ++++------------- > 1 file changed, 4 insertions(+), 13 deletions(-) > > diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c > index 8121a7e073bc..834c0e634250 100644 > --- a/fs/exfat/dir.c > +++ b/fs/exfat/dir.c > @@ -818,7 +818,7 @@ int exfat_get_dentry_set(struct exfat_entry_set_cache *es, > unsigned int type) > { > int ret, i, num_bh; > - unsigned int off, byte_offset, clu = 0; > + unsigned int off; > sector_t sec; > struct exfat_sb_info *sbi = EXFAT_SB(sb); > struct exfat_dentry *ep; > @@ -831,27 +831,16 @@ int exfat_get_dentry_set(struct exfat_entry_set_cache *es, > return -EIO; > } > > - byte_offset = EXFAT_DEN_TO_B(entry); > - ret = exfat_walk_fat_chain(sb, p_dir, byte_offset, &clu); > + ret = exfat_find_location(sb, p_dir, entry, &sec, &off); > if (ret) > return ret; > > memset(es, 0, sizeof(*es)); > es->sb = sb; > es->modified = false; > - > - /* byte offset in cluster */ > - byte_offset = EXFAT_CLU_OFFSET(byte_offset, sbi); > - > - /* byte offset in sector */ > - off = EXFAT_BLK_OFFSET(byte_offset, sb); > es->start_off = off; > es->bh = es->__bh; > > - /* sector offset in cluster */ > - sec = EXFAT_B_TO_BLK(byte_offset, sb); > - sec += exfat_cluster_to_sector(sbi, clu); > - > bh = sb_bread(sb, sec); > if (!bh) > return -EIO; > @@ -878,6 +867,8 @@ int exfat_get_dentry_set(struct exfat_entry_set_cache *es, > for (i = 1; i < num_bh; i++) { > /* get the next sector */ > if (exfat_is_last_sector_in_cluster(sbi, sec)) { > + int clu = exfat_sector_to_cluster(sbi, sec); > + 'clu' should be defined as 'unsigned int'. However, as of now, exfat_sector_to_cluster() seems to be unused function and to return wrong type 'int'. So it should be fixed prior to this patch. Could you send patchset again includes the fix? > if (p_dir->flags == ALLOC_NO_FAT_CHAIN) > clu++; > else if (exfat_get_next_cluster(sb, &clu))