XFS doesn't support the dt_type member in readdir results, it fills it with DT_UNKNOWN.
These are the filesystems that appear to support the dt_type field:
9p, btrfs, cifs, coda, ext2, ext3, ext4, fat, hfs, hfsplus, jffs2, ntfs, ocfs2, omfs, openpromfs, romfs, squashfs, ubifs, ufs
I would like XFS to support it as well, is there something in XFS's design that prevents it, or was it just not implemented?
It would be useful, because you can skip stat()-ing files, and can traverse directories faster by just looking at the ->dt_type field to know if it is a file/directory/something else.
XFS doesn't have the necessary metadata in it's directory structure
to supply this information. That is, it requires an on-disk format
change to support this. We plan to support this in the future when we
change the directory structure to include CRCs, but that is some time
mkfs.xfs -n ftype=1 (which is now a default-on option) should enable dt_type reporting.