On Sat, 17 Mar 2018, Ed Maste wrote:

Log:
 Prefix UFS symbols with UFS_ to reduce namespace pollution

 Followup to r313780.  Also prefix ext2's and nandfs's versions with
 EXT2_ and NANDFS_.

S_IFMT is already MI.  So this churnge is mostly wrong unless file
systems do the identity translations from their "internal" IFMT to
S_IFMT, etc., everywhere, but they mostly don't.  Using IFMT, etc.,
was correct under the assumption that IFMT is just an old spelling of
S_IFMT.  Now it is assumed that FOOFS_IFMT is just a new spelling of
S_IFMT.  There are many more logically different translations that
have to be physically the identity to work.

UFS_IFMT is a wrong spelling for ffs.  If ffs were actually different from
ufs, then there would be different file systems layered under ufs (or is
it different file systems layered under ffs?).

ext2fs needs a separate set of mode macros less than ffs, since it has
less trivial translation layer that converts from the on-disk inode to
the in-core inode.

Translations are less confusing for file flags since they are only the
identity for ffs.  All file systems use the MI SF_* and convert to that
if necessary.  ffs assumes that SF_* match its disk encoding and will
never change.  ext2fs has to do nontrivial translations of file flags
and does this at low levels so that upper levels can just use SF_*
like ffs, except with no assumptions.  File modes should be handled
similarly.  IFMT is then just a better (shorter) spelling of S_IFMT
like it used to be.

Bruce
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to