+int cd9660_vfs_getattr(struct mount *mp, struct vfs_attr *fsap, __unused vfs_context_t context)
+{
+ struct iso_mnt *imp;
+ struct vfsstatfs *stats = vfs_statfs(mp);
+
+ imp = VFSTOISOFS(mp);
+
+ /*
+ * We don't know reasonable values for f_objcount, f_filecount,
+ * f_dircount, f_maxobjcount so don't bother making up (poor)
+ * numbers like 10.3.x and earlier did.
+ */
+
+ VFSATTR_RETURN(fsap, f_iosize, stats->f_iosize);
+ VFSATTR_RETURN(fsap, f_blocks, stats->f_blocks);
+ VFSATTR_RETURN(fsap, f_bfree, stats->f_bfree);
+ VFSATTR_RETURN(fsap, f_bavail, stats->f_bavail);
+ VFSATTR_RETURN(fsap, f_bused, stats->f_blocks);
+
+ /* We don't have file counts, so don't return them */
+
+ /* f_fsid and f_owner should be handled by VFS */
+
+ /* We don't have a value for f_uuid */
+
+ if (VFSATTR_IS_ACTIVE(fsap, f_capabilities)) {
+ fsap->f_capabilities.capabilities[VOL_CAPABILITIES_FORMAT] =
+ (imp->iso_ftype == ISO_FTYPE_RRIP ? VOL_CAP_FMT_SYMBOLICLINKS : 0) |
+ (imp->iso_ftype == ISO_FTYPE_RRIP ? VOL_CAP_FMT_HARDLINKS : 0) |
+ (imp->iso_ftype == ISO_FTYPE_RRIP || imp->iso_ftype == ISO_FTYPE_JOLIET
+ ? VOL_CAP_FMT_CASE_SENSITIVE : 0) |
+ VOL_CAP_FMT_CASE_PRESERVING |
+ VOL_CAP_FMT_FAST_STATFS;
+ fsap->f_capabilities.capabilities[VOL_CAPABILITIES_INTERFACES] =
+ VOL_CAP_INT_ATTRLIST |
+ VOL_CAP_INT_NFSEXPORT;
+ 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;
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_INTERFACES] =
+ VOL_CAP_INT_SEARCHFS |
+ VOL_CAP_INT_ATTRLIST |
+ VOL_CAP_INT_NFSEXPORT |
+ VOL_CAP_INT_ALLOCATE |
+ VOL_CAP_INT_ADVLOCK |
+ VOL_CAP_INT_FLOCK;
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_RESERVED1] = 0;
+ fsap->f_capabilities.valid[VOL_CAPABILITIES_RESERVED2] = 0;
+
+ VFSATTR_SET_SUPPORTED(fsap, f_capabilities);
+ }
+
+ if (VFSATTR_IS_ACTIVE(fsap, f_attributes)) {
+ /*
+ * VFS should really set these based on the vfs_attr and vnop_attr
+ * fields the file system supports, combined with the conversions
+ * VFS has implemented.
+ */
+
+#define ISOFS_ATTR_CMN_VALIDMASK (ATTR_CMN_VALIDMASK & ~(ATTR_CMN_PAROBJID | ATTR_CMN_CRTIME | ATTR_CMN_BKUPTIME | ATTR_CMN_PARENTID))
+#define ISOFS_ATTR_VOL_VALIDMASK (ATTR_VOL_VALIDMASK & ~(ATTR_VOL_OBJCOUNT | ATTR_VOL_FILECOUNT | ATTR_VOL_DIRCOUNT | ATTR_VOL_MAXOBJCOUNT | ATTR_VOL_NAME))
+#define ISOFS_ATTR_DIR_VALIDMASK (ATTR_DIR_VALIDMASK & ~(ATTR_DIR_ENTRYCOUNT))
+
+ fsap->f_attributes.validattr.commonattr = ISOFS_ATTR_CMN_VALIDMASK;
+ fsap->f_attributes.validattr.volattr = ISOFS_ATTR_VOL_VALIDMASK;
+ fsap->f_attributes.validattr.dirattr = ISOFS_ATTR_DIR_VALIDMASK;
+ fsap->f_attributes.validattr.fileattr = ATTR_FILE_VALIDMASK;
+ fsap->f_attributes.validattr.forkattr = ATTR_FORK_VALIDMASK;
+
+ fsap->f_attributes.nativeattr.commonattr = ISOFS_ATTR_CMN_VALIDMASK;
+ fsap->f_attributes.nativeattr.volattr = ISOFS_ATTR_VOL_VALIDMASK;
+ fsap->f_attributes.nativeattr.dirattr = ISOFS_ATTR_DIR_VALIDMASK;
+ fsap->f_attributes.nativeattr.fileattr = ATTR_FILE_VALIDMASK;
+ fsap->f_attributes.nativeattr.forkattr = ATTR_FORK_VALIDMASK;
+
+ VFSATTR_SET_SUPPORTED(fsap, f_attributes);
+ }
+
+ VFSATTR_RETURN(fsap, f_create_time, imp->creation_date);
+ VFSATTR_RETURN(fsap, f_modify_time, imp->modification_date);
+ /* No explicit access time, so let VFS pick a default value */
+ /* No explicit backup time, so let VFS pick a default value */
+
+ return 0;
+}
+