linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] fat: Added functions to determine the FAT variant (12/16/32bit)
@ 2018-12-16 20:03 Carmeli Tamir
  2018-12-16 20:03 ` [PATCH v3 1/3] fat: Removed FAT_FIRST_ENT macro Carmeli Tamir
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Carmeli Tamir @ 2018-12-16 20:03 UTC (permalink / raw)
  To: carmeli.tamir, hirofumi, linux-kernel, jthumshirn,
	sergey.senozhatsky, akpm, bvanassche, axboe, martin.petersen,
	sfr

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-25  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-16 20:03 [PATCH v3 0/3] fat: Added functions to determine the FAT variant (12/16/32bit) Carmeli Tamir
2018-12-16 20:03 ` [PATCH v3 1/3] fat: Removed FAT_FIRST_ENT macro Carmeli Tamir
2018-12-16 20:03 ` [PATCH v3 2/3] fat: Moved MAX_FAT to fat.h and changed it to inline function Carmeli Tamir
2018-12-16 20:04 ` [PATCH v3 3/3] fat: New inline functions to determine the FAT variant (32, 16 or 12) Carmeli Tamir
2018-12-24 12:04 ` [PATCH v3 0/3] fat: Added functions to determine the FAT variant (12/16/32bit) OGAWA Hirofumi
2018-12-25  9:48   ` Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).