Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Make the inode fields in the 64-bit superblock 64 bits wide.
details: https://anonhg.NetBSD.org/src/rev/a5e531a3c995
branches: trunk
changeset: 340336:a5e531a3c995
user: dholland <dholland%NetBSD.org@localhost>
date: Tue Sep 01 06:11:06 2015 +0000
description:
Make the inode fields in the 64-bit superblock 64 bits wide.
Reasoning as before.
Note that I am not going through and checking for 64->32 truncations
in inode numbers; I'm sure there are quite a few, but that's a project
for later.
diffstat:
sbin/fsck_lfs/pass0.c | 6 +-
sys/ufs/lfs/lfs.h | 102 ++++++++++++++++++++++----------------------
sys/ufs/lfs/lfs_accessors.h | 6 +-
sys/ufs/lfs/lfs_debug.c | 12 ++--
sys/ufs/lfs/lfs_vfsops.c | 7 ++-
usr.sbin/dumplfs/dumplfs.c | 14 +++---
6 files changed, 75 insertions(+), 72 deletions(-)
diffs (268 lines):
diff -r d34dd10894b6 -r a5e531a3c995 sbin/fsck_lfs/pass0.c
--- a/sbin/fsck_lfs/pass0.c Tue Sep 01 06:10:16 2015 +0000
+++ b/sbin/fsck_lfs/pass0.c Tue Sep 01 06:11:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass0.c,v 1.41 2015/08/23 16:00:23 christos Exp $ */
+/* $NetBSD: pass0.c,v 1.42 2015/09/01 06:11:06 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -200,8 +200,8 @@
writeit = 1;
}
if (freehd != lfs_sb_getfreehd(fs)) {
- pwarn("FREE LIST HEAD IN SUPERBLOCK SHOULD BE %ju (WAS %u)\n",
- (uintmax_t)freehd, lfs_sb_getfreehd(fs));
+ pwarn("FREE LIST HEAD IN SUPERBLOCK SHOULD BE %ju (WAS %ju)\n",
+ (uintmax_t)freehd, (uintmax_t)lfs_sb_getfreehd(fs));
if (preen || reply("FIX")) {
lfs_sb_setfreehd(fs, freehd);
sbdirty();
diff -r d34dd10894b6 -r a5e531a3c995 sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Tue Sep 01 06:10:16 2015 +0000
+++ b/sys/ufs/lfs/lfs.h Tue Sep 01 06:11:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.h,v 1.181 2015/09/01 06:10:16 dholland Exp $ */
+/* $NetBSD: lfs.h,v 1.182 2015/09/01 06:11:06 dholland Exp $ */
/* from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp */
/* from NetBSD: dir.h,v 1.21 2009/07/22 04:49:19 dholland Exp */
@@ -789,63 +789,63 @@
u_int32_t dlfs_frag; /* 36: number of frags in a block in fs */
/* Checkpoint region. */
- u_int32_t dlfs_freehd; /* 40: start of the free inode list */
- u_int32_t dlfs_nfiles; /* 44: number of allocated inodes */
- int64_t dlfs_bfree; /* 48: number of free frags */
- int64_t dlfs_avail; /* 56: blocks available for writing */
- int64_t dlfs_idaddr; /* 64: inode file disk address */
- int32_t dlfs_uinodes; /* 72: inodes in cache not yet on disk */
- u_int32_t dlfs_ifile; /* 76: inode file inode number */
- int64_t dlfs_lastseg; /* 80: address of last segment written */
- int64_t dlfs_nextseg; /* 88: address of next segment to write */
- int64_t dlfs_curseg; /* 96: current segment being written */
- int64_t dlfs_offset; /* 104: offset in curseg for next partial */
- int64_t dlfs_lastpseg; /* 112: address of last partial written */
- u_int32_t dlfs_inopf; /* 120: inodes per frag */
+ u_int64_t dlfs_freehd; /* 40: start of the free inode list */
+ u_int64_t dlfs_nfiles; /* 48: number of allocated inodes */
+ int64_t dlfs_bfree; /* 56: number of free frags */
+ int64_t dlfs_avail; /* 64: blocks available for writing */
+ int64_t dlfs_idaddr; /* 72: inode file disk address */
+ int32_t dlfs_uinodes; /* 80: inodes in cache not yet on disk */
+ u_int32_t dlfs_ifile; /* 84: inode file inode number */
+ int64_t dlfs_lastseg; /* 88: address of last segment written */
+ int64_t dlfs_nextseg; /* 96: address of next segment to write */
+ int64_t dlfs_curseg; /* 104: current segment being written */
+ int64_t dlfs_offset; /* 112: offset in curseg for next partial */
+ int64_t dlfs_lastpseg; /* 120: address of last partial written */
+ u_int32_t dlfs_inopf; /* 128: inodes per frag */
/* These are configuration parameters. */
- u_int32_t dlfs_minfree; /* 124: minimum percentage of free blocks */
+ u_int32_t dlfs_minfree; /* 132: minimum percentage of free blocks */
/* These fields can be computed from the others. */
- u_int64_t dlfs_maxfilesize; /* 128: maximum representable file size */
- u_int32_t dlfs_fsbpseg; /* 136: frags (fsb) per segment */
- u_int32_t dlfs_inopb; /* 140: inodes per block */
- u_int32_t dlfs_ifpb; /* 144: IFILE entries per block */
- u_int32_t dlfs_sepb; /* 148: SEGUSE entries per block */
- u_int32_t dlfs_nindir; /* 152: indirect pointers per block */
- u_int32_t dlfs_nseg; /* 156: number of segments */
- u_int32_t dlfs_nspf; /* 160: number of sectors per fragment */
- u_int32_t dlfs_cleansz; /* 164: cleaner info size in blocks */
- u_int32_t dlfs_segtabsz; /* 168: segment table size in blocks */
- u_int32_t dlfs_bshift; /* 172: calc block number from file offset */
- u_int32_t dlfs_ffshift; /* 176: fast mult/div for frag from file */
- u_int32_t dlfs_fbshift; /* 180: fast mult/div for frag from block */
- u_int64_t dlfs_bmask; /* 184: calc block offset from file offset */
- u_int64_t dlfs_ffmask; /* 192: calc frag offset from file offset */
- u_int64_t dlfs_fbmask; /* 200: calc frag offset from block offset */
- u_int32_t dlfs_blktodb; /* 208: blktodb and dbtoblk shift constant */
- u_int32_t dlfs_sushift; /* 212: fast mult/div for segusage table */
+ u_int64_t dlfs_maxfilesize; /* 136: maximum representable file size */
+ u_int32_t dlfs_fsbpseg; /* 144: frags (fsb) per segment */
+ u_int32_t dlfs_inopb; /* 148: inodes per block */
+ u_int32_t dlfs_ifpb; /* 152: IFILE entries per block */
+ u_int32_t dlfs_sepb; /* 156: SEGUSE entries per block */
+ u_int32_t dlfs_nindir; /* 160: indirect pointers per block */
+ u_int32_t dlfs_nseg; /* 164: number of segments */
+ u_int32_t dlfs_nspf; /* 168: number of sectors per fragment */
+ u_int32_t dlfs_cleansz; /* 172: cleaner info size in blocks */
+ u_int32_t dlfs_segtabsz; /* 176: segment table size in blocks */
+ u_int32_t dlfs_bshift; /* 180: calc block number from file offset */
+ u_int32_t dlfs_ffshift; /* 184: fast mult/div for frag from file */
+ u_int32_t dlfs_fbshift; /* 188: fast mult/div for frag from block */
+ u_int64_t dlfs_bmask; /* 192: calc block offset from file offset */
+ u_int64_t dlfs_ffmask; /* 200: calc frag offset from file offset */
+ u_int64_t dlfs_fbmask; /* 208: calc frag offset from block offset */
+ u_int32_t dlfs_blktodb; /* 216: blktodb and dbtoblk shift constant */
+ u_int32_t dlfs_sushift; /* 220: fast mult/div for segusage table */
- /* 216: superblock disk offsets */
+ /* 224: superblock disk offsets */
int64_t dlfs_sboffs[LFS_MAXNUMSB];
- int32_t dlfs_maxsymlinklen; /* 296: max len of an internal symlink */
- u_int32_t dlfs_nclean; /* 300: Number of clean segments */
- u_char dlfs_fsmnt[MNAMELEN]; /* 304: name mounted on */
- u_int16_t dlfs_pflags; /* 394: file system persistent flags */
- int32_t dlfs_dmeta; /* 396: total number of dirty summaries */
- u_int32_t dlfs_minfreeseg; /* 400: segments not counted in bfree */
- u_int32_t dlfs_sumsize; /* 404: size of summary blocks */
- u_int32_t dlfs_ibsize; /* 408: size of inode blocks */
- u_int32_t dlfs_inodefmt; /* 412: inode format version */
- u_int64_t dlfs_serial; /* 416: serial number */
- int64_t dlfs_s0addr; /* 424: start of segment 0 */
- u_int64_t dlfs_tstamp; /* 432: time stamp */
- u_int32_t dlfs_interleave; /* 440: segment interleave */
- u_int32_t dlfs_ident; /* 444: per-fs identifier */
- u_int32_t dlfs_fsbtodb; /* 448: fsbtodb and dbtodsb shift constant */
- u_int32_t dlfs_resvseg; /* 452: segments reserved for the cleaner */
- int8_t dlfs_pad[52]; /* 456: round to 512 bytes */
+ int32_t dlfs_maxsymlinklen; /* 304: max len of an internal symlink */
+ u_int32_t dlfs_nclean; /* 308: Number of clean segments */
+ u_char dlfs_fsmnt[MNAMELEN]; /* 312: name mounted on */
+ u_int16_t dlfs_pflags; /* 402: file system persistent flags */
+ int32_t dlfs_dmeta; /* 404: total number of dirty summaries */
+ u_int32_t dlfs_minfreeseg; /* 408: segments not counted in bfree */
+ u_int32_t dlfs_sumsize; /* 412: size of summary blocks */
+ u_int32_t dlfs_ibsize; /* 416: size of inode blocks */
+ u_int32_t dlfs_inodefmt; /* 420: inode format version */
+ u_int64_t dlfs_serial; /* 424: serial number */
+ int64_t dlfs_s0addr; /* 432: start of segment 0 */
+ u_int64_t dlfs_tstamp; /* 440: time stamp */
+ u_int32_t dlfs_interleave; /* 448: segment interleave */
+ u_int32_t dlfs_ident; /* 452: per-fs identifier */
+ u_int32_t dlfs_fsbtodb; /* 456: fsbtodb and dbtodsb shift constant */
+ u_int32_t dlfs_resvseg; /* 460: segments reserved for the cleaner */
+ int8_t dlfs_pad[44]; /* 464: round to 512 bytes */
/* Checksum -- last valid disk field. */
u_int32_t dlfs_cksum; /* 508: checksum for superblock checking */
};
diff -r d34dd10894b6 -r a5e531a3c995 sys/ufs/lfs/lfs_accessors.h
--- a/sys/ufs/lfs/lfs_accessors.h Tue Sep 01 06:10:16 2015 +0000
+++ b/sys/ufs/lfs/lfs_accessors.h Tue Sep 01 06:11:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_accessors.h,v 1.17 2015/09/01 06:10:16 dholland Exp $ */
+/* $NetBSD: lfs_accessors.h,v 1.18 2015/09/01 06:11:06 dholland Exp $ */
/* from NetBSD: lfs.h,v 1.165 2015/07/24 06:59:32 dholland Exp */
/* from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp */
@@ -919,9 +919,9 @@
LFS_DEF_SB_ACCESSOR(u_int32_t, bsize);
LFS_DEF_SB_ACCESSOR(u_int32_t, fsize);
LFS_DEF_SB_ACCESSOR(u_int32_t, frag);
-LFS_DEF_SB_ACCESSOR(u_int32_t, freehd);
+LFS_DEF_SB_ACCESSOR_FULL(uint64_t, uint32_t, freehd);
LFS_DEF_SB_ACCESSOR_FULL(int64_t, int32_t, bfree);
-LFS_DEF_SB_ACCESSOR(u_int32_t, nfiles);
+LFS_DEF_SB_ACCESSOR_FULL(uint64_t, uint32_t, nfiles);
LFS_DEF_SB_ACCESSOR_FULL(int64_t, int32_t, avail);
LFS_DEF_SB_ACCESSOR(int32_t, uinodes);
LFS_DEF_SB_ACCESSOR_FULL(int64_t, int32_t, idaddr);
diff -r d34dd10894b6 -r a5e531a3c995 sys/ufs/lfs/lfs_debug.c
--- a/sys/ufs/lfs/lfs_debug.c Tue Sep 01 06:10:16 2015 +0000
+++ b/sys/ufs/lfs/lfs_debug.c Tue Sep 01 06:11:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_debug.c,v 1.52 2015/08/12 18:28:01 dholland Exp $ */
+/* $NetBSD: lfs_debug.c,v 1.53 2015/09/01 06:11:06 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_debug.c,v 1.52 2015/08/12 18:28:01 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_debug.c,v 1.53 2015/09/01 06:11:06 dholland Exp $");
#ifdef DEBUG
@@ -176,13 +176,13 @@
printf("\n");
printf("Checkpoint Info\n");
- printf("%s%d\t%s%jx\t%s%d\n",
- "freehd ", lfs_sb_getfreehd(lfsp),
+ printf("%s%ju\t%s%jx\t%s%d\n",
+ "freehd ", (uintmax_t)lfs_sb_getfreehd(lfsp),
"idaddr ", (intmax_t)lfs_sb_getidaddr(lfsp),
"ifile ", lfs_sb_getifile(lfsp));
- printf("%s%jx\t%s%d\t%s%jx\t%s%jx\t%s%jx\t%s%jx\n",
+ printf("%s%jx\t%s%ju\t%s%jx\t%s%jx\t%s%jx\t%s%jx\n",
"bfree ", (intmax_t)lfs_sb_getbfree(lfsp),
- "nfiles ", lfs_sb_getnfiles(lfsp),
+ "nfiles ", (uintmax_t)lfs_sb_getnfiles(lfsp),
"lastseg ", (intmax_t)lfs_sb_getlastseg(lfsp),
"nextseg ", (intmax_t)lfs_sb_getnextseg(lfsp),
"curseg ", (intmax_t)lfs_sb_getcurseg(lfsp),
diff -r d34dd10894b6 -r a5e531a3c995 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c Tue Sep 01 06:10:16 2015 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c Tue Sep 01 06:11:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vfsops.c,v 1.343 2015/09/01 06:10:16 dholland Exp $ */
+/* $NetBSD: lfs_vfsops.c,v 1.344 2015/09/01 06:11:06 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.343 2015/09/01 06:10:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.344 2015/09/01 06:11:06 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_lfs.h"
@@ -843,6 +843,9 @@
cred = l ? l->l_cred : NOCRED;
+ /* The superblock is supposed to be 512 bytes. */
+ __CTASSERT(sizeof(struct dlfs) == DEV_BSIZE);
+
/*
* Flush out any old buffers remaining from a previous use.
*/
diff -r d34dd10894b6 -r a5e531a3c995 usr.sbin/dumplfs/dumplfs.c
--- a/usr.sbin/dumplfs/dumplfs.c Tue Sep 01 06:10:16 2015 +0000
+++ b/usr.sbin/dumplfs/dumplfs.c Tue Sep 01 06:11:06 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dumplfs.c,v 1.55 2015/08/29 05:33:20 dholland Exp $ */
+/* $NetBSD: dumplfs.c,v 1.56 2015/09/01 06:11:06 dholland Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)dumplfs.c 8.5 (Berkeley) 5/24/95";
#else
-__RCSID("$NetBSD: dumplfs.c,v 1.55 2015/08/29 05:33:20 dholland Exp $");
+__RCSID("$NetBSD: dumplfs.c,v 1.56 2015/09/01 06:11:06 dholland Exp $");
#endif
#endif /* not lint */
@@ -816,16 +816,16 @@
(void)printf("\n");
(void)printf(" Checkpoint Info\n");
- (void)printf(" %s%-10d %s0x%-8jx %s%-10d\n",
- "freehd ", lfs_sb_getfreehd(lfsp),
+ (void)printf(" %s%-10ju %s0x%-8jx %s%-10ju\n",
+ "freehd ", (uintmax_t)lfs_sb_getfreehd(lfsp),
"idaddr ", (intmax_t)lfs_sb_getidaddr(lfsp),
- "ifile ", lfs_sb_getifile(lfsp));
+ "ifile ", (uintmax_t)lfs_sb_getifile(lfsp));
(void)printf(" %s%-10d %s%-10jd %s%-10jd\n",
"uinodes ", lfs_sb_getuinodes(lfsp),
"bfree ", (intmax_t)lfs_sb_getbfree(lfsp),
"avail ", (intmax_t)lfs_sb_getavail(lfsp));
- (void)printf(" %s%-10d %s0x%-8jx %s0x%-8jx\n",
- "nfiles ", lfs_sb_getnfiles(lfsp),
+ (void)printf(" %s%-10ju %s0x%-8jx %s0x%-8jx\n",
+ "nfiles ", (uintmax_t)lfs_sb_getnfiles(lfsp),
"lastseg ", (uintmax_t)lfs_sb_getlastseg(lfsp),
"nextseg ", (uintmax_t)lfs_sb_getnextseg(lfsp));
(void)printf(" %s0x%-8jx %s0x%-8jx %s%-10ju\n",
Home |
Main Index |
Thread Index |
Old Index