kernels/linux-2.4.0/fs/fat/misc.c
/* Flushes the number of free clusters on FAT32 */
/* XXX: Need to write one per FSINFO block.  Currently only writes 1 */
Flushes the number of free clusters on FAT32
XXX: Need to write one per FSINFO block.  Currently only writes 1
Flushes the number of free clusters on FAT32 XXX : Need to write one per FSINFO block . Currently only writes 1
void fat_clusters_flush(struct super_block *sb)
{
	int offset;
	struct buffer_head *bh;
	struct fat_boot_fsinfo *fsinfo;
	offset = MSDOS_SB(sb)->fsinfo_offset;
	bh = fat_bread(sb, (offset >> SECTOR_BITS));
	if (bh == NULL) {
		printk("FAT bread failed in fat_clusters_flush\n");
		return;
	}
	fsinfo = (struct fat_boot_fsinfo *)
		&bh->b_data[offset & (SECTOR_SIZE-1)];
	if (CF_LE_L(fsinfo->signature) != 0x61417272) {
		printk("fat_clusters_flush: Did not find valid FSINFO signature. Found 0x%x.  offset=0x%x\n", CF_LE_L(fsinfo->signature), offset);
		fat_brelse(sb, bh);
		return;
	}
	fsinfo->free_clusters = CF_LE_L(MSDOS_SB(sb)->free_clusters);
	fat_mark_buffer_dirty(sb, bh);
	fat_brelse(sb, bh);
}
void fat_clusters_flush ( struct super_block * sb ) { int offset ; struct buffer_head * bh ; struct fat_boot_fsinfo * fsinfo ; offset = MSDOS_SB ( sb ) -> fsinfo_offset ; bh = fat_bread ( sb , ( offset >> SECTOR_BITS ) ) ; if ( bh == NULL ) { printk ( " \n " ) ; return ; } fsinfo = ( struct fat_boot_fsinfo * ) & bh -> b_data [ offset & ( SECTOR_SIZE - 1 ) ] ; if ( CF_LE_L ( fsinfo -> signature ) != 0x61417272 ) { printk ( " \n " , CF_LE_L ( fsinfo -> signature ) , offset ) ; fat_brelse ( sb , bh ) ; return ; } fsinfo -> free_clusters = CF_LE_L ( MSDOS_SB ( sb ) -> free_clusters ) ; fat_mark_buffer_dirty ( sb , bh ) ; fat_brelse ( sb , bh ) ; }
Flushes the number of free clusters on FAT32
XXX: Need to write one per FSINFO block.
Flushes the number of free clusters on FAT32 XXX : Need to write one per FSINFO block .
/* The fat32 boot fs info is at offset 0x3e0 by observation */ /* Sanity check */