[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1544990640-11604-1-git-send-email-carmeli.tamir@gmail.com>
Date: Sun, 16 Dec 2018 15:03:57 -0500
From: Carmeli Tamir <carmeli.tamir@...il.com>
To: carmeli.tamir@...il.com, hirofumi@...l.parknet.co.jp,
linux-kernel@...r.kernel.org, jthumshirn@...e.de,
sergey.senozhatsky@...il.com, akpm@...ux-foundation.org,
bvanassche@....org, axboe@...nel.dk, martin.petersen@...cle.com,
sfr@...b.auug.org.au
Subject: [PATCH v3 0/3] fat: Added functions to determine the FAT variant (12/16/32bit)
Along the FAT FS code, the FAT variant (whether this is FAT12, FAT16 or FAT32) is
determined by checking the fat_bits field of struct msdos_sb_info.
This is somewhat error prone as it forces the usage of magics (12, 16, 32)
multiple times in the code.
This series replaces the places in which the variant is checked with three
inline functions - IS_FAT12, IS_FAT16 and IS_FAT16.
The introduction of these simple inline functions makes a clearer API for determining the variant,
rather than searching the code for some field in a struct, and therefore
increases the code's maintainability and readability.
In addition, minor cleanups around code that checks for the FAT variant,
and fixed comments from v1 and v2.
Carmeli Tamir (3):
Removed fat_first_ent
Moved and inlined MAX_FAT
IS_FAT functions
fs/fat/cache.c | 2 +-
fs/fat/dir.c | 4 ++--
fs/fat/fat.h | 30 +++++++++++++++++++++++++++++-
fs/fat/fatent.c | 16 +++++++---------
fs/fat/inode.c | 26 +++++++++++++++-----------
fs/fat/misc.c | 2 +-
include/uapi/linux/msdos_fs.h | 5 -----
7 files changed, 55 insertions(+), 30 deletions(-)
--
2.7.4
Powered by blists - more mailing lists