svn commit: r331083 - in head: lib/libufs sbin/dump sbin/fsck_ffs sbin/fsdb sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs stand/libsa sys/fs/ext2fs sys/fs/nandfs sys/ufs/ffs sys/ufs/ufs usr.s...

Bruce Evans brde at optusnet.com.au
Sat Mar 17 07:23:51 UTC 2018


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


More information about the svn-src-all mailing list