public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fat_clusters_flush() cleanup (4/5)
Date: Thu, 25 Apr 2002 23:51:12 +0900	[thread overview]
Message-ID: <87vgafn867.fsf@devron.myhome.or.jp> (raw)

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);
 

                 reply	other threads:[~2002-04-25 14:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vgafn867.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox