aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/makefs/ffs
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/makefs/ffs')
-rw-r--r--usr.sbin/makefs/ffs/Makefile.inc5
-rw-r--r--usr.sbin/makefs/ffs/buf.c45
-rw-r--r--usr.sbin/makefs/ffs/buf.h2
-rw-r--r--usr.sbin/makefs/ffs/ffs_alloc.c7
-rw-r--r--usr.sbin/makefs/ffs/ffs_balloc.c5
-rw-r--r--usr.sbin/makefs/ffs/ffs_bswap.c5
-rw-r--r--usr.sbin/makefs/ffs/ffs_extern.h3
-rw-r--r--usr.sbin/makefs/ffs/ffs_subr.c5
-rw-r--r--usr.sbin/makefs/ffs/mkfs.c48
-rw-r--r--usr.sbin/makefs/ffs/newfs_extern.h4
-rw-r--r--usr.sbin/makefs/ffs/ufs_bmap.c5
-rw-r--r--usr.sbin/makefs/ffs/ufs_bswap.h4
-rw-r--r--usr.sbin/makefs/ffs/ufs_inode.h86
13 files changed, 105 insertions, 119 deletions
diff --git a/usr.sbin/makefs/ffs/Makefile.inc b/usr.sbin/makefs/ffs/Makefile.inc
index a1e839fd7ab6..0db1750ab282 100644
--- a/usr.sbin/makefs/ffs/Makefile.inc
+++ b/usr.sbin/makefs/ffs/Makefile.inc
@@ -1,9 +1,8 @@
-# $FreeBSD$
-#
-
.PATH: ${SRCDIR}/ffs ${SRCTOP}/sys/ufs/ffs
SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c
SRCS+= buf.c mkfs.c
# Reach-over source from sys/ufs/ffs
SRCS+= ffs_tables.c
+
+CWARNFLAGS.ffs_balloc.c+= -Wno-sign-compare
diff --git a/usr.sbin/makefs/ffs/buf.c b/usr.sbin/makefs/ffs/buf.c
index 13f3099c4491..5fdb517208f9 100644
--- a/usr.sbin/makefs/ffs/buf.c
+++ b/usr.sbin/makefs/ffs/buf.c
@@ -37,9 +37,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/time.h>
@@ -78,7 +75,7 @@ bread(struct m_vnode *vp, daddr_t blkno, int size, struct ucred *u1 __unused,
if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1)
err(1, "%s: lseek %lld (%lld)", __func__,
(long long)(*bpp)->b_blkno, (long long)offset);
- rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (*bpp)->b_bcount);
+ rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount);
if (debug & DEBUG_BUF_BREAD)
printf("%s: read %ld (%lld) returned %d\n", __func__,
(*bpp)->b_bcount, (long long)offset, (int)rv);
@@ -127,26 +124,31 @@ bwrite(struct m_buf *bp)
{
off_t offset;
ssize_t rv;
+ size_t bytes;
+ int e;
fsinfo_t *fs = bp->b_fs;
assert (bp != NULL);
offset = (off_t)bp->b_blkno * fs->sectorsize + fs->offset;
+ bytes = (size_t)bp->b_bcount;
if (debug & DEBUG_BUF_BWRITE)
- printf("bwrite: blkno %lld offset %lld bcount %ld\n",
- (long long)bp->b_blkno, (long long) offset,
- bp->b_bcount);
- if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1)
+ printf("%s: blkno %lld offset %lld bcount %zu\n", __func__,
+ (long long)bp->b_blkno, (long long) offset, bytes);
+ if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1) {
+ brelse(bp);
return (errno);
- rv = write(bp->b_fs->fd, bp->b_data, bp->b_bcount);
+ }
+ rv = write(bp->b_fs->fd, bp->b_data, bytes);
+ e = errno;
if (debug & DEBUG_BUF_BWRITE)
- printf("bwrite: write %ld (offset %lld) returned %lld\n",
+ printf("%s: write %ld (offset %lld) returned %lld\n", __func__,
bp->b_bcount, (long long)offset, (long long)rv);
- if (rv == bp->b_bcount)
+ brelse(bp);
+ if (rv == (ssize_t)bytes)
return (0);
- else if (rv == -1) /* write error */
- return (errno);
- else /* short write ? */
- return (EAGAIN);
+ if (rv == -1) /* write error */
+ return (e);
+ return (EAGAIN);
}
void
@@ -163,13 +165,13 @@ bcleanup(void)
if (TAILQ_EMPTY(&buftail))
return;
- printf("bcleanup: unflushed buffers:\n");
+ printf("%s: unflushed buffers:\n", __func__);
TAILQ_FOREACH(bp, &buftail, b_tailq) {
printf("\tlblkno %10lld blkno %10lld count %6ld bufsize %6ld\n",
(long long)bp->b_lblkno, (long long)bp->b_blkno,
bp->b_bcount, bp->b_bufsize);
}
- printf("bcleanup: done\n");
+ printf("%s: done\n", __func__);
}
struct m_buf *
@@ -181,12 +183,13 @@ getblk(struct m_vnode *vp, daddr_t blkno, int size, int u1 __unused,
void *n;
if (debug & DEBUG_BUF_GETBLK)
- printf("getblk: blkno %lld size %d\n", (long long)blkno, size);
+ printf("%s: blkno %lld size %d\n", __func__, (long long)blkno,
+ size);
bp = NULL;
if (!buftailinitted) {
if (debug & DEBUG_BUF_GETBLK)
- printf("getblk: initialising tailq\n");
+ printf("%s: initialising tailq\n", __func__);
TAILQ_INIT(&buftail);
buftailinitted = 1;
} else {
@@ -206,8 +209,8 @@ getblk(struct m_vnode *vp, daddr_t blkno, int size, int u1 __unused,
}
bp->b_bcount = size;
if (bp->b_data == NULL || bp->b_bcount > bp->b_bufsize) {
- n = erealloc(bp->b_data, size);
- memset(n, 0, size);
+ n = erealloc(bp->b_data, (size_t)size);
+ memset(n, 0, (size_t)size);
bp->b_data = n;
bp->b_bufsize = size;
}
diff --git a/usr.sbin/makefs/ffs/buf.h b/usr.sbin/makefs/ffs/buf.h
index 31196b8b2fbe..dfe7edb3e784 100644
--- a/usr.sbin/makefs/ffs/buf.h
+++ b/usr.sbin/makefs/ffs/buf.h
@@ -35,8 +35,6 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#ifndef _FFS_BUF_H
diff --git a/usr.sbin/makefs/ffs/ffs_alloc.c b/usr.sbin/makefs/ffs/ffs_alloc.c
index ff0e72c56af0..c5aae97928b5 100644
--- a/usr.sbin/makefs/ffs/ffs_alloc.c
+++ b/usr.sbin/makefs/ffs/ffs_alloc.c
@@ -39,13 +39,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)ffs_alloc.c 8.19 (Berkeley) 7/13/95
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/time.h>
@@ -305,7 +300,6 @@ ffs_alloccg(struct inode *ip, int cg, daddr_t bpref, int size)
error = bread((void *)ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NULL, &bp);
if (error) {
- brelse(bp);
return (0);
}
cgp = (struct cg *)bp->b_data;
@@ -449,7 +443,6 @@ ffs_blkfree(struct inode *ip, daddr_t bno, long size)
error = bread((void *)ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),
(int)fs->fs_cgsize, NULL, &bp);
if (error) {
- brelse(bp);
return;
}
cgp = (struct cg *)bp->b_data;
diff --git a/usr.sbin/makefs/ffs/ffs_balloc.c b/usr.sbin/makefs/ffs/ffs_balloc.c
index 275ec4c04471..969a779d0ae8 100644
--- a/usr.sbin/makefs/ffs/ffs_balloc.c
+++ b/usr.sbin/makefs/ffs/ffs_balloc.c
@@ -30,13 +30,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)ffs_balloc.c 8.8 (Berkeley) 6/16/95
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/time.h>
diff --git a/usr.sbin/makefs/ffs/ffs_bswap.c b/usr.sbin/makefs/ffs/ffs_bswap.c
index 43fa60cb0373..50498cb4f259 100644
--- a/usr.sbin/makefs/ffs/ffs_bswap.c
+++ b/usr.sbin/makefs/ffs/ffs_bswap.c
@@ -1,7 +1,7 @@
/* $NetBSD: ffs_bswap.c,v 1.28 2004/05/25 14:54:59 hannken Exp $ */
/*-
- * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 1998 Manuel Bouyer.
*
@@ -27,9 +27,6 @@
*
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#if defined(_KERNEL)
#include <sys/systm.h>
diff --git a/usr.sbin/makefs/ffs/ffs_extern.h b/usr.sbin/makefs/ffs/ffs_extern.h
index 12ba0b77989c..ac0dafaff860 100644
--- a/usr.sbin/makefs/ffs/ffs_extern.h
+++ b/usr.sbin/makefs/ffs/ffs_extern.h
@@ -30,9 +30,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95
- * $FreeBSD$
*/
#include "ffs/buf.h"
diff --git a/usr.sbin/makefs/ffs/ffs_subr.c b/usr.sbin/makefs/ffs/ffs_subr.c
index 53e5b97ada48..3f5b2297389b 100644
--- a/usr.sbin/makefs/ffs/ffs_subr.c
+++ b/usr.sbin/makefs/ffs/ffs_subr.c
@@ -29,13 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)ffs_subr.c 8.5 (Berkeley) 3/21/95
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/types.h>
diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c
index 0f8b040d6997..81e3da5725c8 100644
--- a/usr.sbin/makefs/ffs/mkfs.c
+++ b/usr.sbin/makefs/ffs/mkfs.c
@@ -40,9 +40,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/time.h>
#include <sys/resource.h>
@@ -80,6 +77,23 @@ static int count_digits(int);
#define UMASK 0755
#define POWEROF2(num) (((num) & ((num) - 1)) == 0)
+/*
+ * The definition of "struct cg" used to contain an extra field at the end
+ * to represent the variable-length data that followed the fixed structure.
+ * This had the effect of artificially limiting the number of blocks that
+ * newfs would put in a CG, since newfs thought that the fixed-size header
+ * was bigger than it really was. When we started validating that the CG
+ * header data actually fit into one fs block, the placeholder field caused
+ * a problem because it caused struct cg to be a different size depending on
+ * platform. The placeholder field was later removed, but this caused a
+ * backward compatibility problem with older binaries that still thought
+ * struct cg was larger, and a new file system could fail validation if
+ * viewed by the older binaries. To avoid this compatibility problem, we
+ * now artificially reduce the amount of space that the variable-length data
+ * can use such that new file systems will pass validation by older binaries.
+ */
+#define CGSIZEFUDGE 8
+
static union {
struct fs fs;
char pad[SBLOCKSIZE];
@@ -347,7 +361,8 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp)
sblock.fs_fpg = minfpg;
sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode),
INOPB(&sblock));
- if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize)
+ if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize -
+ CGSIZEFUDGE)
break;
density -= sblock.fs_fsize;
}
@@ -366,9 +381,11 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp)
INOPB(&sblock));
if (sblock.fs_size / sblock.fs_fpg < 1)
break;
- if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize)
+ if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize -
+ CGSIZEFUDGE)
continue;
- if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize)
+ if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize -
+ CGSIZEFUDGE)
break;
sblock.fs_fpg -= sblock.fs_frag;
sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode),
@@ -529,8 +546,9 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp)
initcg(cylno, tstamp, fsopts);
if (cylno % nprintcols == 0)
printf("\n");
- printf(" %*lld,", printcolwidth,
- (long long)fsbtodb(&sblock, cgsblock(&sblock, cylno)));
+ printf(" %*lld%s", printcolwidth,
+ (long long)fsbtodb(&sblock, cgsblock(&sblock, cylno)),
+ cylno == sblock.fs_ncg - 1 ? "" : ",");
fflush(stdout);
}
printf("\n");
@@ -561,13 +579,21 @@ ffs_write_superblock(struct fs *fs, const fsinfo_t *fsopts)
{
int size, blks, i, saveflag;
uint32_t cylno;
- void *space;
+ void *info, *space;
char *wrbuf;
saveflag = fs->fs_flags & FS_INTERNAL;
fs->fs_flags &= ~FS_INTERNAL;
- memcpy(writebuf, &sblock, sbsize);
+ /*
+ * Write out the superblock. Blank out the summary info field, as it's
+ * a random pointer that would make the resulting image unreproducible.
+ */
+ info = fs->fs_si;
+ fs->fs_si = NULL;
+ memcpy(writebuf, fs, sbsize);
+ fs->fs_si = info;
+
if (fsopts->needswap)
ffs_sb_swap(fs, (struct fs*)writebuf);
ffs_wtfs(fs->fs_sblockloc / sectorsize, sbsize, writebuf, fsopts);
@@ -633,7 +659,7 @@ initcg(uint32_t cylno, time_t utime, const fsinfo_t *fsopts)
acg.cg_ndblk = dmax - cbase;
if (sblock.fs_contigsumsize > 0)
acg.cg_nclusterblks = acg.cg_ndblk >> sblock.fs_fragshift;
- start = &acg.cg_space[0] - (u_char *)(&acg.cg_firstfield);
+ start = sizeof(acg);
if (Oflag == 2) {
acg.cg_iusedoff = start;
} else {
diff --git a/usr.sbin/makefs/ffs/newfs_extern.h b/usr.sbin/makefs/ffs/newfs_extern.h
index 636c86b356f5..82a6337a720a 100644
--- a/usr.sbin/makefs/ffs/newfs_extern.h
+++ b/usr.sbin/makefs/ffs/newfs_extern.h
@@ -2,7 +2,7 @@
/* From: NetBSD: extern.h,v 1.3 2000/12/01 12:03:27 simonb Exp $ */
/*-
- * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
*
@@ -25,8 +25,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
*/
/* prototypes */
diff --git a/usr.sbin/makefs/ffs/ufs_bmap.c b/usr.sbin/makefs/ffs/ufs_bmap.c
index 196693587da0..1dc644349d3a 100644
--- a/usr.sbin/makefs/ffs/ufs_bmap.c
+++ b/usr.sbin/makefs/ffs/ufs_bmap.c
@@ -35,13 +35,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)ufs_bmap.c 8.8 (Berkeley) 8/11/95
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
#include <sys/time.h>
diff --git a/usr.sbin/makefs/ffs/ufs_bswap.h b/usr.sbin/makefs/ffs/ufs_bswap.h
index 49b96990ccb2..36f9b88a5686 100644
--- a/usr.sbin/makefs/ffs/ufs_bswap.h
+++ b/usr.sbin/makefs/ffs/ufs_bswap.h
@@ -1,7 +1,7 @@
/* $NetBSD: ufs_bswap.h,v 1.13 2003/10/05 17:48:50 bouyer Exp $ */
/*-
- * SPDX-License-Identifier: BSD-2-Clause-NetBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 1998 Manuel Bouyer.
*
@@ -24,8 +24,6 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#ifndef _UFS_UFS_BSWAP_H_
diff --git a/usr.sbin/makefs/ffs/ufs_inode.h b/usr.sbin/makefs/ffs/ufs_inode.h
index 2b30b801b36e..c960caea5c1e 100644
--- a/usr.sbin/makefs/ffs/ufs_inode.h
+++ b/usr.sbin/makefs/ffs/ufs_inode.h
@@ -35,63 +35,55 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * @(#)inode.h 8.9 (Berkeley) 5/14/95
- * $FreeBSD$
*/
-union dinode {
- struct ufs1_dinode ffs1_din;
- struct ufs2_dinode ffs2_din;
-};
-
struct inode {
- ino_t i_number; /* The identity of the inode. */
+ ino_t i_number; /* The identity of the inode. */
struct vnode *i_devvp; /* vnode pointer (contains fsopts) */
struct fs *i_fs; /* File system */
union dinode i_din;
uint64_t i_size;
};
-#define i_ffs1_atime i_din.ffs1_din.di_atime
-#define i_ffs1_atimensec i_din.ffs1_din.di_atimensec
-#define i_ffs1_blocks i_din.ffs1_din.di_blocks
-#define i_ffs1_ctime i_din.ffs1_din.di_ctime
-#define i_ffs1_ctimensec i_din.ffs1_din.di_ctimensec
-#define i_ffs1_db i_din.ffs1_din.di_db
-#define i_ffs1_flags i_din.ffs1_din.di_flags
-#define i_ffs1_gen i_din.ffs1_din.di_gen
-#define i_ffs11_gid i_din.ffs1_din.di_gid
-#define i_ffs1_ib i_din.ffs1_din.di_ib
-#define i_ffs1_mode i_din.ffs1_din.di_mode
-#define i_ffs1_mtime i_din.ffs1_din.di_mtime
-#define i_ffs1_mtimensec i_din.ffs1_din.di_mtimensec
-#define i_ffs1_nlink i_din.ffs1_din.di_nlink
-#define i_ffs1_rdev i_din.ffs1_din.di_rdev
-#define i_ffs1_shortlink i_din.ffs1_din.di_shortlink
-#define i_ffs1_size i_din.ffs1_din.di_size
-#define i_ffs1_uid i_din.ffs1_din.di_uid
+#define i_ffs1_atime i_din.dp1.di_atime
+#define i_ffs1_atimensec i_din.dp1.di_atimensec
+#define i_ffs1_blocks i_din.dp1.di_blocks
+#define i_ffs1_ctime i_din.dp1.di_ctime
+#define i_ffs1_ctimensec i_din.dp1.di_ctimensec
+#define i_ffs1_db i_din.dp1.di_db
+#define i_ffs1_flags i_din.dp1.di_flags
+#define i_ffs1_gen i_din.dp1.di_gen
+#define i_ffs11_gid i_din.dp1.di_gid
+#define i_ffs1_ib i_din.dp1.di_ib
+#define i_ffs1_mode i_din.dp1.di_mode
+#define i_ffs1_mtime i_din.dp1.di_mtime
+#define i_ffs1_mtimensec i_din.dp1.di_mtimensec
+#define i_ffs1_nlink i_din.dp1.di_nlink
+#define i_ffs1_rdev i_din.dp1.di_rdev
+#define i_ffs1_shortlink i_din.dp1.di_shortlink
+#define i_ffs1_size i_din.dp1.di_size
+#define i_ffs1_uid i_din.dp1.di_uid
-#define i_ffs2_atime i_din.ffs2_din.di_atime
-#define i_ffs2_atimensec i_din.ffs2_din.di_atimensec
-#define i_ffs2_blocks i_din.ffs2_din.di_blocks
-#define i_ffs2_ctime i_din.ffs2_din.di_ctime
-#define i_ffs2_ctimensec i_din.ffs2_din.di_ctimensec
-#define i_ffs2_birthtime i_din.ffs2_din.di_birthtime
-#define i_ffs2_birthnsec i_din.ffs2_din.di_birthnsec
-#define i_ffs2_db i_din.ffs2_din.di_db
-#define i_ffs2_flags i_din.ffs2_din.di_flags
-#define i_ffs2_gen i_din.ffs2_din.di_gen
-#define i_ffs21_gid i_din.ffs2_din.di_gid
-#define i_ffs2_ib i_din.ffs2_din.di_ib
-#define i_ffs2_mode i_din.ffs2_din.di_mode
-#define i_ffs2_mtime i_din.ffs2_din.di_mtime
-#define i_ffs2_mtimensec i_din.ffs2_din.di_mtimensec
-#define i_ffs2_nlink i_din.ffs2_din.di_nlink
-#define i_ffs2_rdev i_din.ffs2_din.di_rdev
-#define i_ffs2_shortlink i_din.ffs2_din.di_shortlink
-#define i_ffs2_size i_din.ffs2_din.di_size
-#define i_ffs2_uid i_din.ffs2_din.di_uid
+#define i_ffs2_atime i_din.dp2.di_atime
+#define i_ffs2_atimensec i_din.dp2.di_atimensec
+#define i_ffs2_blocks i_din.dp2.di_blocks
+#define i_ffs2_ctime i_din.dp2.di_ctime
+#define i_ffs2_ctimensec i_din.dp2.di_ctimensec
+#define i_ffs2_birthtime i_din.dp2.di_birthtime
+#define i_ffs2_birthnsec i_din.dp2.di_birthnsec
+#define i_ffs2_db i_din.dp2.di_db
+#define i_ffs2_flags i_din.dp2.di_flags
+#define i_ffs2_gen i_din.dp2.di_gen
+#define i_ffs21_gid i_din.dp2.di_gid
+#define i_ffs2_ib i_din.dp2.di_ib
+#define i_ffs2_mode i_din.dp2.di_mode
+#define i_ffs2_mtime i_din.dp2.di_mtime
+#define i_ffs2_mtimensec i_din.dp2.di_mtimensec
+#define i_ffs2_nlink i_din.dp2.di_nlink
+#define i_ffs2_rdev i_din.dp2.di_rdev
+#define i_ffs2_shortlink i_din.dp2.di_shortlink
+#define i_ffs2_size i_din.dp2.di_size
+#define i_ffs2_uid i_din.dp2.di_uid
#undef DIP
#define DIP(ip, field) \