]> git.hungrycats.org Git - linux/commitdiff
[PATCH] FAT: Fix ->prev_free of fat (6/10)
authorAndrew Morton <akpm@osdl.org>
Tue, 30 Dec 2003 07:45:40 +0000 (23:45 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 30 Dec 2003 07:45:40 +0000 (23:45 -0800)
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

The -1 was documented as "there is no hint", so this patch uses -1 instead
of 0 for FAT32 fsinfo.

fs/fat/inode.c
fs/fat/misc.c
include/linux/msdos_fs_sb.h

index 23837158cde2937df625d94cae01da25f3b98d0a..c67e488178722e23cf34273d1724889900017ff6 100644 (file)
@@ -885,7 +885,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
        sbi->fat_length = CF_LE_W(b->fat_length);
        sbi->root_cluster = 0;
        sbi->free_clusters = -1;        /* Don't know yet */
-       sbi->prev_free = 0;
+       sbi->prev_free = -1;
 
        if (!sbi->fat_length && b->fat32_length) {
                struct fat_boot_fsinfo *fsinfo;
index c3a7785d8381dc0fc0f7047ebb14685daafe90e6..ab744357b815f45171b3684d9121c465ba1f6e2f 100644 (file)
@@ -74,7 +74,7 @@ void fat_clusters_flush(struct super_block *sb)
        } else {
                if (sbi->free_clusters != -1)
                        fsinfo->free_clusters = CF_LE_L(sbi->free_clusters);
-               if (sbi->prev_free)
+               if (sbi->prev_free != -1)
                        fsinfo->next_cluster = CF_LE_L(sbi->prev_free);
                mark_buffer_dirty(bh);
        }
index 546458d82ece7620d985e0459eae5a11bc010580..26d64203f08663c4a014022fe4b5d6b12b3884cd 100644 (file)
@@ -49,7 +49,7 @@ struct msdos_sb_info {
        unsigned long root_cluster;  /* first cluster of the root directory */
        unsigned long fsinfo_sector; /* FAT32 fsinfo offset from start of disk */
        struct semaphore fat_lock;
-       int prev_free;               /* previously returned free cluster number */
+       int prev_free;               /* previously allocated cluster number */
        int free_clusters;           /* -1 if undefined */
        struct fat_mount_options options;
        struct nls_table *nls_disk;  /* Codepage used on disk */