Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/makefs/msdos/msdosfs_vfsops.c
Show First 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | msdosfs_root(struct msdosfsmount *pmp, struct vnode *vp) { | ||||
*vp = *pmp->pm_devvp; | *vp = *pmp->pm_devvp; | ||||
if ((error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, &ndep)) != 0) { | if ((error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, &ndep)) != 0) { | ||||
errno = error; | errno = error; | ||||
return -1; | return -1; | ||||
} | } | ||||
vp->v_data = ndep; | vp->v_data = ndep; | ||||
return 0; | return 0; | ||||
} | } | ||||
/* | |||||
* If we have an FSInfo block, update it. | |||||
*/ | |||||
int | |||||
msdosfs_fsiflush(struct msdosfsmount *pmp) | |||||
{ | |||||
struct fsinfo *fp; | |||||
struct buf *bp; | |||||
int error; | |||||
if (pmp->pm_fsinfo == 0 || (pmp->pm_flags & MSDOSFS_FSIMOD) == 0) { | |||||
error = 0; | |||||
goto out; | |||||
} | |||||
error = bread(pmp->pm_devvp, pmp->pm_fsinfo, pmp->pm_BytesPerSec, | |||||
NOCRED, &bp); | |||||
if (error != 0) { | |||||
brelse(bp); | |||||
goto out; | |||||
} | |||||
fp = (struct fsinfo *)bp->b_data; | |||||
putulong(fp->fsinfree, pmp->pm_freeclustercount); | |||||
putulong(fp->fsinxtfree, pmp->pm_nxtfree); | |||||
pmp->pm_flags &= ~MSDOSFS_FSIMOD; | |||||
error = bwrite(bp); | |||||
out: | |||||
return (error); | |||||
} |