FreeBSD/sys/fs/msdosfs/msdosfs_vfsops.c
/*
 * If we have an FSInfo block, update it.
 */
If we have an FSInfo block, update it.
If we have an FSInfo block update it .
static int
msdosfs_fsiflush(struct msdosfsmount *pmp, int waitfor)
{
	struct fsinfo *fp;
	struct buf *bp;
	int error;
	MSDOSFS_LOCK_MP(pmp);
	if (pmp->pm_fsinfo == 0 || (pmp->pm_flags & MSDOSFS_FSIMOD) == 0) {
		error = 0;
		goto unlock;
	}
	error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec,
	    NOCRED, &bp);
	if (error != 0) {
		brelse(bp);
		goto unlock;
	}
	fp = (struct fsinfo *)bp->b_data;
	putulong(fp->fsinfree, pmp->pm_freeclustercount);
	putulong(fp->fsinxtfree, pmp->pm_nxtfree);
	pmp->pm_flags &= ~MSDOSFS_FSIMOD;
	if (waitfor == MNT_WAIT)
		error = bwrite(bp);
	else
		bawrite(bp);
unlock:
	MSDOSFS_UNLOCK_MP(pmp);
	return (error);
}
static int msdosfs_fsiflush ( struct msdosfsmount * pmp , int waitfor ) { struct fsinfo * fp ; struct buf * bp ; int error ; MSDOSFS_LOCK_MP ( pmp ) ; if ( pmp -> pm_fsinfo == 0 || ( pmp -> pm_flags & MSDOSFS_FSIMOD ) == 0 ) { error = 0 ; goto unlock ; } error = bread ( pmp -> pm_devvp , pmp -> pm_fsinfo , pmp -> pm_BytesPerSec , NOCRED , & bp ) ; if ( error != 0 ) { brelse ( bp ) ; goto unlock ; } fp = ( struct fsinfo * ) bp -> b_data ; putulong ( fp -> fsinfree , pmp -> pm_freeclustercount ) ; putulong ( fp -> fsinxtfree , pmp -> pm_nxtfree ) ; pmp -> pm_flags &= ~ MSDOSFS_FSIMOD ; if ( waitfor == MNT_WAIT ) error = bwrite ( bp ) ; else bawrite ( bp ) ; unlock : MSDOSFS_UNLOCK_MP ( pmp ) ; return ( error ) ; }
If we have an FSInfo block, update it.
If we have an FSInfo block update it .