From owner-freebsd-fs Mon Sep 23 08:59:07 1996 Return-Path: owner-fs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA18960 for fs-outgoing; Mon, 23 Sep 1996 08:59:07 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA18935 for ; Mon, 23 Sep 1996 08:58:57 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id BAA24393 for fs@freebsd.org; Tue, 24 Sep 1996 01:56:37 +1000 Date: Tue, 24 Sep 1996 01:56:37 +1000 From: Bruce Evans Message-Id: <199609231556.BAA24393@godzilla.zeta.org.au> To: fs@FreeBSD.org Subject: untangling dirent macros Sender: owner-fs@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk I found that cd96660_vnops.c and devfs_vnops.c use the deprecated compatibility header . Several other places include it but don't actually use it. attempts to include the application header , but because of the bogus -I$S/sys in the kernel Makefile, it actually includes . This works because kernel sources really want anyway. When I removed -I$S/sys, started including the application header. This worked too. cd96660_vnops.c and devfs_vnops.c only need the DIRSIZ() macro from . ufs avoids by having its own copy of the macro in , where the macro describes the on-disk layout. The on-disk layout happens to be suitable for returning almost directly in ufs_readdir(), at least on 32-bit machines (I think there might be alignment problems for future(?) 64-bit machines). I think a version of the macro that gives minimal padding of the name for readdir() should be defined in and all the names should be unique. Maybe rename the ufs version UFS_DIRSIZ(). Maybe is required to sometimes specify 64-bit alignment. There is a similar problem with DIRBLKSIZE. It is defined as 1024 in , but the kernel normally never sees or uses that. ufs uses DEV_BSIZE=512. nfs_serv.c and nfs_vnops.c include so that they can misuse the ufs value. ext2fs_lookup.c includes so that it can misuse the ufs value and lots more ufs stuff. I think a generic value for this should be defined in . Bruce