Re: [e2fsprogs] ext2_dir_entry To ext2_dir_entry_2 Casting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 03, 2012 at 10:39:55AM -0700, Wade Cline wrote:
> >I would think that using (name_len&  0xFF) is a much simpler solution,
> >and my suggestion is to not depend on the file type in the directory
> >entry (since there might be some very old ext2 file systems that don't
> >set the file type), and to use the inode's mode bits as authoratative
> >for the file type of the inode.
> >
>
> Interesting compatibility issue. Will keep it in mind.

To clarify, the EXT2_FEATURE_INCOMPAT_FILETYPE flag indicates that
there _may_ be file type information in the directory entry (and so
only the low 8 bits of name_len should be considered part of the name
length), but it does not guarantee that it will be present in the high
8 bits of name_len.

If it is not there, then readdir will simply return DT_UNKNOWN in the
d_type field of the directory entry returned by readdir(2).  This is
something all application programs have to be prepared to deal with
--- if they need the file type information, and they get DT_UNKNOWN,
then they will need to stat the file to get the information.

	     	     	      	     - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux