From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) (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 5E64A78C9C for ; Sat, 25 Apr 2026 18:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.171.160.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777140382; cv=none; b=SmCtskUfTKT9TGkGYs1bW04cUZCui7hSG9Vg2m2hGW0VNyHUCYSsLCTPdRMDyNj+jS9EWqcrknfdPC3hXf9r0cKWfUeJURVJmQDsGmJUT6XqZHXptbA62I5vqgvUMXiwSJeM3rtIAIRqTMfiwp5tmWgZMbgoZuO1vm4awQxsDvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777140382; c=relaxed/simple; bh=S6UB1B9kCzT2xQZHd/JKjwIikGqnEVE+5xJeBn2gciA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Ao36RE2Za3Ox6XuewVsMqhvIg4in3kSTYRuopGqs+CmA5Sk4L/iL6gntkHLKDw/qwO5JgCfHlG33dZdGQt7C0Vp8M8/wq3EhAkib3Yr4Z3mX61jvLqbPwIZcgG+Bd3H3QdCiPfewAwlg1tElmsnn8q1Vgck7Nlc+xoZ+wWRvx/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mail.parknet.co.jp; spf=pass smtp.mailfrom=parknet.co.jp; dkim=pass (2048-bit key) header.d=parknet.co.jp header.i=@parknet.co.jp header.b=2UUzxdeT; dkim=permerror (0-bit key) header.d=parknet.co.jp header.i=@parknet.co.jp header.b=Pvury/vm; arc=none smtp.client-ip=210.171.160.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mail.parknet.co.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=parknet.co.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=parknet.co.jp header.i=@parknet.co.jp header.b="2UUzxdeT"; dkim=permerror (0-bit key) header.d=parknet.co.jp header.i=@parknet.co.jp header.b="Pvury/vm" Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id 8400C26F765F; Sun, 26 Apr 2026 02:56:46 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=parknet.co.jp; s=20250114; t=1777139806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1NigGpuwQuZo9P/ht8oVakl1nqO0bYh8EHr+621DfC0=; b=2UUzxdeTRbOsol7BTcWitn5kTtT5nn2ZclHr3d0rnMRrCZjbnvgUnUaUOiII4FqS0d2Pws WVQ9vhV0vWV5LCCxII/Zk4oc/mUrcsHXdVBDqB2UcWntvokANKih8o3DD4lws5iR2OSjga 2FwqOnr0BCVm2rgCcFVPJrqlb/jz9vzlujc49K0RfrTmNwManPPhiX1aQJfoty46seErK/ h7OOOyih/xBU99rFYpRSd7jgDDfS6ptRjLWssYpDGX8v+GjOJr/CSbrap6xZAOAOndD66o uDfsKbOdqHQgDeHiR6iN/ISXI98VMcaJ7IQ5uhs2GLA5e5ghx1bY31QC7KBWgQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=parknet.co.jp; s=20250114-ed25519; t=1777139806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1NigGpuwQuZo9P/ht8oVakl1nqO0bYh8EHr+621DfC0=; b=Pvury/vm4aRmy5vb19gYiny5tc0wmAggoY6gkG2uA+Br3Tj4d2rSm+NHs0lwDoWmj4tiRI iPifYbdrdVTlOaBQ== Received: from devron.myhome.or.jp (devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (Postfix) with ESMTPS id 0E50FE00A8A; Sun, 26 Apr 2026 02:56:46 +0900 (JST) Received: by devron.myhome.or.jp (Postfix, from userid 1000) id 0119722000EA; Sun, 26 Apr 2026 02:56:45 +0900 (JST) From: OGAWA Hirofumi To: Ziran Zhang Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] FAT: Rename ambiguous fat_sectors and fat_total_sect fields In-Reply-To: <20260418130845.7365-1-zhangcoder@yeah.net> References: <20260418130845.7365-1-zhangcoder@yeah.net> Date: Sun, 26 Apr 2026 02:56:45 +0900 Message-ID: <87tssyc49u.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ziran Zhang writes: > The fields 'fat_sectors' (BPB_TotSec16) and 'fat_total_sect' > (BPB_TotSec32) in struct fat_bios_param_block have ambiguous > names that do not clearly indicate their size or purpose, often > leading to confusion with FAT table sectors. > > These fields correspond to BPB_TotSec16 and BPB_TotSec32 as > defined in Microsoft's fatgen103.doc. > > Rename them for clarity: > - fat_sectors =E2=86=92 fat_total_sect16 (16-bit total sector count) > - fat_total_sect =E2=86=92 fat_total_sect32 (32-bit total sector count) > > This makes their roles immediately obvious. No functional change, > and the struct is internal to the kernel so ABI is unaffected. > > Signed-off-by: Ziran Zhang Change is more readable I think too. However, inconsistent can be more confusable. And I think no value to change user visible header, so this is remaining. Thanks. > --- > fs/fat/inode.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/fs/fat/inode.c b/fs/fat/inode.c > index 28f78df08..90286ba0e 100644 > --- a/fs/fat/inode.c > +++ b/fs/fat/inode.c > @@ -47,9 +47,9 @@ struct fat_bios_param_block { > u16 fat_reserved; > u8 fat_fats; > u16 fat_dir_entries; > - u16 fat_sectors; > + u16 fat_total_sect16; > u16 fat_fat_length; > - u32 fat_total_sect; > + u32 fat_total_sect32; >=20=20 > u8 fat16_state; > u32 fat16_vol_id; > @@ -1403,9 +1403,9 @@ static int fat_read_bpb(struct super_block *sb, str= uct fat_boot_sector *b, > bpb->fat_reserved =3D le16_to_cpu(b->reserved); > bpb->fat_fats =3D b->fats; > bpb->fat_dir_entries =3D get_unaligned_le16(&b->dir_entries); > - bpb->fat_sectors =3D get_unaligned_le16(&b->sectors); > + bpb->fat_total_sect16 =3D get_unaligned_le16(&b->sectors); > bpb->fat_fat_length =3D le16_to_cpu(b->fat_length); > - bpb->fat_total_sect =3D le32_to_cpu(b->total_sect); > + bpb->fat_total_sect32 =3D le32_to_cpu(b->total_sect); >=20=20 > bpb->fat16_state =3D b->fat16.state; > bpb->fat16_vol_id =3D get_unaligned_le32(b->fat16.vol_id); > @@ -1523,7 +1523,7 @@ static int fat_read_static_bpb(struct super_block *= sb, > bpb->fat_reserved =3D 1; > bpb->fat_fats =3D 2; > bpb->fat_dir_entries =3D fdefaults->dir_entries; > - bpb->fat_sectors =3D fdefaults->nr_sectors; > + bpb->fat_total_sect16 =3D fdefaults->nr_sectors; > bpb->fat_fat_length =3D fdefaults->fat_length; >=20=20 > error =3D 0; > @@ -1734,9 +1734,9 @@ int fat_fill_super(struct super_block *sb, struct f= s_context *fc, > rootdir_sectors =3D sbi->dir_entries > * sizeof(struct msdos_dir_entry) / sb->s_blocksize; > sbi->data_start =3D sbi->dir_start + rootdir_sectors; > - total_sectors =3D bpb.fat_sectors; > + total_sectors =3D bpb.fat_total_sect16; > if (total_sectors =3D=3D 0) > - total_sectors =3D bpb.fat_total_sect; > + total_sectors =3D bpb.fat_total_sect32; >=20=20 > total_clusters =3D (total_sectors - sbi->data_start) / sbi->sec_per_clu= s; --=20 OGAWA Hirofumi