From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-m16.yeah.net (mail-m16.yeah.net [220.197.32.16]) (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 667055D8F0 for ; Sat, 18 Apr 2026 13:09:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.32.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776517777; cv=none; b=G4uY1Hb1K65/VPQH8D8ZHMB0LwCUNenWj43sj7wKVkXKcHZtMcsNRD9+KnnMVOtNQ3oaJUm9B9qt1kEi74wEk1eW0W8jIh8z7VqYnt8F91C289BDUz/bseSXPMHyIdxUJGH7eNz8v1gJK1btyQrW6sIy71MntI+fRQTgImPP9KQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776517777; c=relaxed/simple; bh=KggQnEqvAF9PvVsCY0ZLR9H2+ZvTisjjA1SMQQi7TaI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=f1dkdrNvtvC82x04Opy/kwU76eqjHL+KWbSSpnAoidxEmRmnY+mo6VdKVstCsGZfVObUSzw36qkTZ6BFWTjhHDePcoKKd/hFppPcb84hX53CBIzJxBQNbE8/H+UyQI9XLuXZ0bAAldnOVuCC2Ry/IQV3fz8iAW4ZsEUpQPJQSKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yeah.net; spf=pass smtp.mailfrom=yeah.net; dkim=pass (1024-bit key) header.d=yeah.net header.i=@yeah.net header.b=L2wSJBwS; arc=none smtp.client-ip=220.197.32.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yeah.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yeah.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yeah.net header.i=@yeah.net header.b="L2wSJBwS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yeah.net; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=yUvxpal8DHGM/DHyMHyydwB2A2b5dws4Bq7nshvJ2Kc=; b=L2wSJBwSovMAgihBCvJARg5KjLz50MsxbzBaagSQna2GNwFAq84fP0nSmGlBGT ILHCzGp8ekyt/u/ZYa54cZmKb/hPVnjcebhBIX3s+CjVM/mDdUgJ72E9N4uBlQ6L 76RqasRTD7C40vG8dIMz3AJ015INH2x4rXVj5Xp9+YV5U= Received: from zhang.. (unknown []) by gzsmtp2 (Coremail) with UTF8SMTPSA id Ms8vCgD3D5Z2guNpLiGlAQ--.31396S4; Sat, 18 Apr 2026 21:09:13 +0800 (CST) From: Ziran Zhang To: hirofumi@mail.parknet.co.jp Cc: linux-kernel@vger.kernel.org, zhangcoder@yeah.net Subject: [PATCH] FAT: Rename ambiguous fat_sectors and fat_total_sect fields Date: Sat, 18 Apr 2026 21:08:45 +0800 Message-ID: <20260418130845.7365-1-zhangcoder@yeah.net> X-Mailer: git-send-email 2.43.0 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: 8bit X-CM-TRANSID:Ms8vCgD3D5Z2guNpLiGlAQ--.31396S4 X-Coremail-Antispam: 1Uf129KBjvJXoWxCryxtFWDKFWxtrWfuw1rJFb_yoW5XrWUpF 4UJ3s7KrW5Xa4UXwn5Jw45Crsayas5JrsrGF4Ivw1akrZIkr1xJF1UtFWYqr1Y93s5Xrnx u3909ryUu3Z2kFUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zEXTmxUUUUU= X-CM-SenderInfo: x2kd0wpfrgv2o61htxgoqh3/1tbiNBoS0mnjgnqEYgAA36 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 → fat_total_sect16 (16-bit total sector count) - fat_total_sect → 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 --- 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; u8 fat16_state; u32 fat16_vol_id; @@ -1403,9 +1403,9 @@ static int fat_read_bpb(struct super_block *sb, struct fat_boot_sector *b, bpb->fat_reserved = le16_to_cpu(b->reserved); bpb->fat_fats = b->fats; bpb->fat_dir_entries = get_unaligned_le16(&b->dir_entries); - bpb->fat_sectors = get_unaligned_le16(&b->sectors); + bpb->fat_total_sect16 = get_unaligned_le16(&b->sectors); bpb->fat_fat_length = le16_to_cpu(b->fat_length); - bpb->fat_total_sect = le32_to_cpu(b->total_sect); + bpb->fat_total_sect32 = le32_to_cpu(b->total_sect); bpb->fat16_state = b->fat16.state; bpb->fat16_vol_id = get_unaligned_le32(b->fat16.vol_id); @@ -1523,7 +1523,7 @@ static int fat_read_static_bpb(struct super_block *sb, bpb->fat_reserved = 1; bpb->fat_fats = 2; bpb->fat_dir_entries = fdefaults->dir_entries; - bpb->fat_sectors = fdefaults->nr_sectors; + bpb->fat_total_sect16 = fdefaults->nr_sectors; bpb->fat_fat_length = fdefaults->fat_length; error = 0; @@ -1734,9 +1734,9 @@ int fat_fill_super(struct super_block *sb, struct fs_context *fc, rootdir_sectors = sbi->dir_entries * sizeof(struct msdos_dir_entry) / sb->s_blocksize; sbi->data_start = sbi->dir_start + rootdir_sectors; - total_sectors = bpb.fat_sectors; + total_sectors = bpb.fat_total_sect16; if (total_sectors == 0) - total_sectors = bpb.fat_total_sect; + total_sectors = bpb.fat_total_sect32; total_clusters = (total_sectors - sbi->data_start) / sbi->sec_per_clus; -- 2.43.0