+ fat-moved-max_fat-to-fath-and-changed-it-to-inline-function.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: fat: move MAX_FAT to fat.h and change it to inline function
has been added to the -mm tree.  Its filename is
     fat-moved-max_fat-to-fath-and-changed-it-to-inline-function.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fat-moved-max_fat-to-fath-and-changed-it-to-inline-function.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fat-moved-max_fat-to-fath-and-changed-it-to-inline-function.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Carmeli Tamir <carmeli.tamir@xxxxxxxxx>
Subject: fat: move MAX_FAT to fat.h and change it to inline function

MAX_FAT is useless in msdos_fs.h, since it uses the MSDOS_SB function that
is defined in fat.h.  So really, this macro can be only called from code
that already includes fat.h.

Hence, this patch moves it to fat.h, right after MSDOS_SB is defined.  I
also changed it to an inline function in order to save the double call to
MSDOS_SB.  This was suggested by joe@xxxxxxxxxxx in the previous version.

This patch is required for the next in the series, in which the variant
(whether this is FAT12, FAT16 or FAT32) checks are replaced with new
macros.

Link: http://lkml.kernel.org/r/1544990640-11604-3-git-send-email-carmeli.tamir@xxxxxxxxx
Signed-off-by: Carmeli Tamir <carmeli.tamir@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/fat/fat.h                  |    9 +++++++++
 fs/fat/inode.c                |    2 +-
 include/uapi/linux/msdos_fs.h |    2 --
 3 files changed, 10 insertions(+), 3 deletions(-)

--- a/fs/fat/fat.h~fat-moved-max_fat-to-fath-and-changed-it-to-inline-function
+++ a/fs/fat/fat.h
@@ -142,6 +142,15 @@ static inline struct msdos_sb_info *MSDO
 	return sb->s_fs_info;
 }
 
+/* Maximum number of clusters */
+static inline u32 max_fat(struct super_block *sb)
+{
+	struct msdos_sb_info *sbi = MSDOS_SB(sb);
+
+	return sbi->fat_bits == 32 ? MAX_FAT32 :
+		sbi->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12;
+}
+
 static inline struct msdos_inode_info *MSDOS_I(struct inode *inode)
 {
 	return container_of(inode, struct msdos_inode_info, vfs_inode);
--- a/fs/fat/inode.c~fat-moved-max_fat-to-fath-and-changed-it-to-inline-function
+++ a/fs/fat/inode.c
@@ -1781,7 +1781,7 @@ int fat_fill_super(struct super_block *s
 	/* check that FAT table does not overflow */
 	fat_clusters = calc_fat_clusters(sb);
 	total_clusters = min(total_clusters, fat_clusters - FAT_START_ENT);
-	if (total_clusters > MAX_FAT(sb)) {
+	if (total_clusters > max_fat(sb)) {
 		if (!silent)
 			fat_msg(sb, KERN_ERR, "count of clusters too big (%u)",
 			       total_clusters);
--- a/include/uapi/linux/msdos_fs.h~fat-moved-max_fat-to-fath-and-changed-it-to-inline-function
+++ a/include/uapi/linux/msdos_fs.h
@@ -65,8 +65,6 @@
 #define MAX_FAT12	0xFF4
 #define MAX_FAT16	0xFFF4
 #define MAX_FAT32	0x0FFFFFF6
-#define MAX_FAT(s)	(MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 : \
-	MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
 
 /* bad cluster mark */
 #define BAD_FAT12	0xFF7
_

Patches currently in -mm which might be from carmeli.tamir@xxxxxxxxx are

fat-replaced-11-magic-to-msdos_name-for-volume-label.patch
fat-removed-fat_first_ent-macro.patch
fat-moved-max_fat-to-fath-and-changed-it-to-inline-function.patch
fat-new-inline-functions-to-determine-the-fat-variant-32-16-or-12.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux