public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fat_clusters_flush() cleanup (4/5)
@ 2002-04-25 14:51 OGAWA Hirofumi
  0 siblings, 0 replies; only message in thread
From: OGAWA Hirofumi @ 2002-04-25 14:51 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi,

This patch are cleanup of fat_clusters_flush().

Please apply.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

diff -urN fat_misc_cleanup-2.5.9/fs/fat/cache.c fat_cluster_flush_cleanup-2.5.9/fs/fat/cache.c
--- fat_misc_cleanup-2.5.9/fs/fat/cache.c	Thu Apr 25 01:42:17 2002
+++ fat_cluster_flush_cleanup-2.5.9/fs/fat/cache.c	Thu Apr 25 01:45:38 2002
@@ -388,14 +388,11 @@
 			nr = -EIO;
 			goto error;
 		}
-		if (MSDOS_SB(sb)->free_clusters != -1) {
+		if (MSDOS_SB(sb)->free_clusters != -1)
 			MSDOS_SB(sb)->free_clusters++;
-			if (MSDOS_SB(sb)->fat_bits == 32) {
-				fat_clusters_flush(sb);
-			}
-		}
-		inode->i_blocks -= (1 << MSDOS_SB(sb)->cluster_bits) >> 9 ;
+		inode->i_blocks -= (1 << MSDOS_SB(sb)->cluster_bits) >> 9;
 	}
+	fat_clusters_flush(sb);
 	nr = 0;
 error:
 	unlock_fat(sb);
diff -urN fat_misc_cleanup-2.5.9/fs/fat/inode.c fat_cluster_flush_cleanup-2.5.9/fs/fat/inode.c
--- fat_misc_cleanup-2.5.9/fs/fat/inode.c	Thu Apr 25 01:42:17 2002
+++ fat_cluster_flush_cleanup-2.5.9/fs/fat/inode.c	Thu Apr 25 01:45:38 2002
@@ -178,9 +178,7 @@
 		dec_cvf_format_use_count_by_version(sbi->cvf_format->cvf_version);
 		sbi->cvf_format->unmount_cvf(sb);
 	}
-	if (sbi->fat_bits == 32) {
-		fat_clusters_flush(sb);
-	}
+	fat_clusters_flush(sb);
 	fat_cache_inval_dev(sb);
 	if (sbi->nls_disk) {
 		unload_nls(sbi->nls_disk);
diff -urN fat_misc_cleanup-2.5.9/fs/fat/misc.c fat_cluster_flush_cleanup-2.5.9/fs/fat/misc.c
--- fat_misc_cleanup-2.5.9/fs/fat/misc.c	Thu Apr 25 01:33:58 2002
+++ fat_cluster_flush_cleanup-2.5.9/fs/fat/misc.c	Thu Apr 25 01:45:38 2002
@@ -97,6 +97,11 @@
 	struct buffer_head *bh;
 	struct fat_boot_fsinfo *fsinfo;
 
+	if (MSDOS_SB(sb)->fat_bits != 32)
+		return;
+	if (MSDOS_SB(sb)->free_clusters == -1)
+		return;
+
 	bh = fat_bread(sb, MSDOS_SB(sb)->fsinfo_sector);
 	if (bh == NULL) {
 		printk("FAT bread failed in fat_clusters_flush\n");
@@ -185,8 +190,7 @@
 	fat_access(sb, nr, FAT_ENT_EOF);
 	if (MSDOS_SB(sb)->free_clusters != -1)
 		MSDOS_SB(sb)->free_clusters--;
-	if (MSDOS_SB(sb)->fat_bits == 32)
-		fat_clusters_flush(sb);
+	fat_clusters_flush(sb);
 	
 	unlock_fat(sb);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-04-25 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-25 14:51 [PATCH] fat_clusters_flush() cleanup (4/5) OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox