Bug 12688 - XFS support for dt_type in readdir results
Summary: XFS support for dt_type in readdir results
Status: RESOLVED WILL_FIX_LATER
Alias: None
Product: File System
Classification: Unclassified
Component: XFS (show other bugs)
Hardware: All Linux
: P1 enhancement
Assignee: XFS Guru
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-11 04:47 UTC by Török Edwin
Modified: 2016-12-15 17:40 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.28.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Török Edwin 2009-02-11 04:47:25 UTC
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.
Comment 1 Dave Chinner 2009-02-12 14:05:00 UTC
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
off....
Comment 2 Darrick J. Wong 2016-12-15 17:40:52 UTC
mkfs.xfs -n ftype=1 (which is now a default-on option) should enable dt_type reporting.

Note You need to log in before you can comment on or make changes to this bug.