Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ffs/ffs_vfsops.c
Show First 20 Lines • Show All 1,425 Lines • ▼ Show 20 Lines | ffs_statfs(mp, sbp) | ||||
sbp->f_bsize = fs->fs_fsize; | sbp->f_bsize = fs->fs_fsize; | ||||
sbp->f_iosize = fs->fs_bsize; | sbp->f_iosize = fs->fs_bsize; | ||||
sbp->f_blocks = fs->fs_dsize; | sbp->f_blocks = fs->fs_dsize; | ||||
UFS_LOCK(ump); | UFS_LOCK(ump); | ||||
sbp->f_bfree = fs->fs_cstotal.cs_nbfree * fs->fs_frag + | sbp->f_bfree = fs->fs_cstotal.cs_nbfree * fs->fs_frag + | ||||
fs->fs_cstotal.cs_nffree + dbtofsb(fs, fs->fs_pendingblocks); | fs->fs_cstotal.cs_nffree + dbtofsb(fs, fs->fs_pendingblocks); | ||||
sbp->f_bavail = freespace(fs, fs->fs_minfree) + | sbp->f_bavail = freespace(fs, fs->fs_minfree) + | ||||
dbtofsb(fs, fs->fs_pendingblocks); | dbtofsb(fs, fs->fs_pendingblocks); | ||||
sbp->f_files = fs->fs_ncg * fs->fs_ipg - ROOTINO; | sbp->f_files = fs->fs_ncg * fs->fs_ipg - UFS_ROOTINO; | ||||
sbp->f_ffree = fs->fs_cstotal.cs_nifree + fs->fs_pendinginodes; | sbp->f_ffree = fs->fs_cstotal.cs_nifree + fs->fs_pendinginodes; | ||||
UFS_UNLOCK(ump); | UFS_UNLOCK(ump); | ||||
sbp->f_namemax = NAME_MAX; | sbp->f_namemax = NAME_MAX; | ||||
return (0); | return (0); | ||||
} | } | ||||
static bool | static bool | ||||
sync_doupdate(struct inode *ip) | sync_doupdate(struct inode *ip) | ||||
▲ Show 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | ffs_fhtovp(mp, fhp, flags, vpp) | ||||
ino_t ino; | ino_t ino; | ||||
u_int cg; | u_int cg; | ||||
int error; | int error; | ||||
ufhp = (struct ufid *)fhp; | ufhp = (struct ufid *)fhp; | ||||
ino = ufhp->ufid_ino; | ino = ufhp->ufid_ino; | ||||
ump = VFSTOUFS(mp); | ump = VFSTOUFS(mp); | ||||
fs = ump->um_fs; | fs = ump->um_fs; | ||||
if (ino < ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) | if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg) | ||||
return (ESTALE); | return (ESTALE); | ||||
/* | /* | ||||
* Need to check if inode is initialized because UFS2 does lazy | * Need to check if inode is initialized because UFS2 does lazy | ||||
* initialization and nfs_fhtovp can offer arbitrary inode numbers. | * initialization and nfs_fhtovp can offer arbitrary inode numbers. | ||||
*/ | */ | ||||
if (fs->fs_magic != FS_UFS2_MAGIC) | if (fs->fs_magic != FS_UFS2_MAGIC) | ||||
return (ufs_fhtovp(mp, ufhp, flags, vpp)); | return (ufs_fhtovp(mp, ufhp, flags, vpp)); | ||||
cg = ino_to_cg(fs, ino); | cg = ino_to_cg(fs, ino); | ||||
▲ Show 20 Lines • Show All 425 Lines • Show Last 20 Lines |