+ return 0;
+}
+
+static int
+devfs_vfs_getattr(__unused mount_t mp, struct vfs_attr *fsap, __unused vfs_context_t ctx)
+{
+ 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);
+ }
+ VFSATTR_RETURN(fsap, f_bfree, 0);
+ VFSATTR_RETURN(fsap, f_bavail, 0);
+ VFSATTR_RETURN(fsap, f_files, devfs_stats.nodes);
+ VFSATTR_RETURN(fsap, f_ffree, 0);
+ VFSATTR_RETURN(fsap, f_fssubtype, 0);
+
+ if (VFSATTR_IS_ACTIVE(fsap, f_capabilities)) {
+ fsap->f_capabilities.capabilities[VOL_CAPABILITIES_FORMAT] =
+ VOL_CAP_FMT_SYMBOLICLINKS |
+ VOL_CAP_FMT_HARDLINKS |
+ VOL_CAP_FMT_NO_ROOT_TIMES |
+ VOL_CAP_FMT_CASE_SENSITIVE |
+ VOL_CAP_FMT_CASE_PRESERVING |
+ VOL_CAP_FMT_FAST_STATFS |
+ VOL_CAP_FMT_2TB_FILESIZE |
+ VOL_CAP_FMT_HIDDEN_FILES;
+ fsap->f_capabilities.capabilities[VOL_CAPABILITIES_INTERFACES] =
+ VOL_CAP_INT_ATTRLIST ;
+ fsap->f_capabilities.capabilities[VOL_CAPABILITIES_RESERVED1] = 0;
+ fsap->f_capabilities.capabilities[VOL_CAPABILITIES_RESERVED2] = 0;
+
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_FORMAT] =
+ VOL_CAP_FMT_PERSISTENTOBJECTIDS |
+ VOL_CAP_FMT_SYMBOLICLINKS |
+ VOL_CAP_FMT_HARDLINKS |
+ VOL_CAP_FMT_JOURNAL |
+ VOL_CAP_FMT_JOURNAL_ACTIVE |
+ VOL_CAP_FMT_NO_ROOT_TIMES |
+ VOL_CAP_FMT_SPARSE_FILES |
+ VOL_CAP_FMT_ZERO_RUNS |
+ VOL_CAP_FMT_CASE_SENSITIVE |
+ VOL_CAP_FMT_CASE_PRESERVING |
+ VOL_CAP_FMT_FAST_STATFS |
+ VOL_CAP_FMT_2TB_FILESIZE |
+ VOL_CAP_FMT_OPENDENYMODES |
+ VOL_CAP_FMT_HIDDEN_FILES |
+ VOL_CAP_FMT_PATH_FROM_ID |
+ VOL_CAP_FMT_NO_VOLUME_SIZES;
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_INTERFACES] =
+ VOL_CAP_INT_SEARCHFS |
+ VOL_CAP_INT_ATTRLIST |
+ VOL_CAP_INT_NFSEXPORT |
+ VOL_CAP_INT_READDIRATTR |
+ VOL_CAP_INT_EXCHANGEDATA |
+ VOL_CAP_INT_COPYFILE |
+ VOL_CAP_INT_ALLOCATE |
+ VOL_CAP_INT_VOL_RENAME |
+ VOL_CAP_INT_ADVLOCK |
+ VOL_CAP_INT_FLOCK |
+ VOL_CAP_INT_EXTENDED_SECURITY |
+ VOL_CAP_INT_USERACCESS |
+ VOL_CAP_INT_MANLOCK |
+ VOL_CAP_INT_EXTENDED_ATTR |
+ VOL_CAP_INT_NAMEDSTREAMS;
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_RESERVED1] = 0;
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_RESERVED2] = 0;
+
+ VFSATTR_SET_SUPPORTED(fsap, f_capabilities);