- /*-
- * Copy the mounted on and mounted from names into
- * the passed in stat block, if it is not the one
- * in the mount structure.
- */
- if (sbp != &mp->mnt_stat) {
- bcopy((caddr_t)mp->mnt_stat.f_mntonname,
- (caddr_t)&sbp->f_mntonname[0], MNAMELEN);
- bcopy((caddr_t)mp->mnt_stat.f_mntfromname,
- (caddr_t)&sbp->f_mntfromname[0], MNAMELEN);
+ return 0;
+}
+
+static int
+devfs_vfs_getattr(mount_t mp, struct vfs_attr *fsap, vfs_context_t context)
+{
+ VFSATTR_RETURN(fsap, f_objcount, devfs_stats.nodes);
+ VFSATTR_RETURN(fsap, f_maxobjcount, devfs_stats.nodes);
+ VFSATTR_RETURN(fsap, f_bsize, 512);
+ VFSATTR_RETURN(fsap, f_iosize, 512);
+ if (VFSATTR_IS_ACTIVE(fsap, f_blocks) || VFSATTR_IS_ACTIVE(fsap, f_bused)) {
+ fsap->f_blocks = (devfs_stats.mounts * sizeof(struct devfsmount)
+ + devfs_stats.nodes * sizeof(devnode_t)
+ + devfs_stats.entries * sizeof(devdirent_t)
+ + devfs_stats.stringspace
+ ) / fsap->f_bsize;
+ fsap->f_bused = fsap->f_blocks;
+ VFSATTR_SET_SUPPORTED(fsap, f_blocks);
+ VFSATTR_SET_SUPPORTED(fsap, f_bused);