Date: Sat, 17 Mar 2018 18:23:39 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Ed Maste <emaste@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: 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... Message-ID: <20180317161131.W962@besplex.bde.org> In-Reply-To: <201803170148.w2H1mR46082991@repo.freebsd.org> References: <201803170148.w2H1mR46082991@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180317161131.W962>