[PATCH] fat_clusters_flush() cleanup (4/5)

From: OGAWA Hirofumi (hirofumi@mail.parknet.co.jp)
Date: Thu Apr 25 2002 - 09:51:12 EST


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); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 30 2002 - 22:00:11 EST