2 * Copyright (c) 2011, 2012 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 #include <sys/param.h>
35 #include <sys/systm.h>
36 #include <sys/kernel.h>
37 #include <sys/nlookup.h>
38 #include <sys/vnode.h>
39 #include <sys/mount.h>
40 #include <sys/fcntl.h>
43 #include <sys/vfsops.h>
44 #include <sys/sysctl.h>
47 #include "hammer2_disk.h"
48 #include "hammer2_mount.h"
50 struct hammer2_sync_info {
56 int hammer2_cluster_enable = 1;
57 long hammer2_iod_file_read;
58 long hammer2_iod_meta_read;
59 long hammer2_iod_indr_read;
60 long hammer2_iod_file_write;
61 long hammer2_iod_meta_write;
62 long hammer2_iod_indr_write;
63 long hammer2_iod_volu_write;
64 long hammer2_ioa_file_read;
65 long hammer2_ioa_meta_read;
66 long hammer2_ioa_indr_read;
67 long hammer2_ioa_file_write;
68 long hammer2_ioa_meta_write;
69 long hammer2_ioa_indr_write;
70 long hammer2_ioa_volu_write;
72 SYSCTL_NODE(_vfs, OID_AUTO, hammer2, CTLFLAG_RW, 0, "HAMMER2 filesystem");
74 SYSCTL_INT(_vfs_hammer2, OID_AUTO, debug, CTLFLAG_RW,
75 &hammer2_debug, 0, "");
76 SYSCTL_INT(_vfs_hammer2, OID_AUTO, cluster_enable, CTLFLAG_RW,
77 &hammer2_cluster_enable, 0, "");
78 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_read, CTLFLAG_RW,
79 &hammer2_iod_file_read, 0, "");
80 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_meta_read, CTLFLAG_RW,
81 &hammer2_iod_meta_read, 0, "");
82 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_indr_read, CTLFLAG_RW,
83 &hammer2_iod_indr_read, 0, "");
84 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_file_write, CTLFLAG_RW,
85 &hammer2_iod_file_write, 0, "");
86 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_meta_write, CTLFLAG_RW,
87 &hammer2_iod_meta_write, 0, "");
88 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_indr_write, CTLFLAG_RW,
89 &hammer2_iod_indr_write, 0, "");
90 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, iod_volu_write, CTLFLAG_RW,
91 &hammer2_iod_volu_write, 0, "");
92 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_file_read, CTLFLAG_RW,
93 &hammer2_ioa_file_read, 0, "");
94 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_meta_read, CTLFLAG_RW,
95 &hammer2_ioa_meta_read, 0, "");
96 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_indr_read, CTLFLAG_RW,
97 &hammer2_ioa_indr_read, 0, "");
98 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_file_write, CTLFLAG_RW,
99 &hammer2_ioa_file_write, 0, "");
100 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_meta_write, CTLFLAG_RW,
101 &hammer2_ioa_meta_write, 0, "");
102 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_indr_write, CTLFLAG_RW,
103 &hammer2_ioa_indr_write, 0, "");
104 SYSCTL_LONG(_vfs_hammer2, OID_AUTO, ioa_volu_write, CTLFLAG_RW,
105 &hammer2_ioa_volu_write, 0, "");
107 static int hammer2_vfs_init(struct vfsconf *conf);
108 static int hammer2_vfs_mount(struct mount *mp, char *path, caddr_t data,
110 static int hammer2_remount(struct mount *, char *, struct vnode *,
112 static int hammer2_vfs_unmount(struct mount *mp, int mntflags);
113 static int hammer2_vfs_root(struct mount *mp, struct vnode **vpp);
114 static int hammer2_vfs_statfs(struct mount *mp, struct statfs *sbp,
116 static int hammer2_vfs_statvfs(struct mount *mp, struct statvfs *sbp,
118 static int hammer2_vfs_sync(struct mount *mp, int waitfor);
119 static int hammer2_vfs_vget(struct mount *mp, struct vnode *dvp,
120 ino_t ino, struct vnode **vpp);
121 static int hammer2_vfs_fhtovp(struct mount *mp, struct vnode *rootvp,
122 struct fid *fhp, struct vnode **vpp);
123 static int hammer2_vfs_vptofh(struct vnode *vp, struct fid *fhp);
124 static int hammer2_vfs_checkexp(struct mount *mp, struct sockaddr *nam,
125 int *exflagsp, struct ucred **credanonp);
127 static int hammer2_install_volume_header(hammer2_mount_t *hmp);
128 static int hammer2_sync_scan1(struct mount *mp, struct vnode *vp, void *data);
129 static int hammer2_sync_scan2(struct mount *mp, struct vnode *vp, void *data);
132 * HAMMER2 vfs operations.
134 static struct vfsops hammer2_vfsops = {
135 .vfs_init = hammer2_vfs_init,
136 .vfs_sync = hammer2_vfs_sync,
137 .vfs_mount = hammer2_vfs_mount,
138 .vfs_unmount = hammer2_vfs_unmount,
139 .vfs_root = hammer2_vfs_root,
140 .vfs_statfs = hammer2_vfs_statfs,
141 .vfs_statvfs = hammer2_vfs_statvfs,
142 .vfs_vget = hammer2_vfs_vget,
143 .vfs_vptofh = hammer2_vfs_vptofh,
144 .vfs_fhtovp = hammer2_vfs_fhtovp,
145 .vfs_checkexp = hammer2_vfs_checkexp
148 MALLOC_DEFINE(M_HAMMER2, "HAMMER2-mount", "");
150 VFS_SET(hammer2_vfsops, hammer2, 0);
151 MODULE_VERSION(hammer2, 1);
155 hammer2_vfs_init(struct vfsconf *conf)
161 if (HAMMER2_BLOCKREF_BYTES != sizeof(struct hammer2_blockref))
163 if (HAMMER2_INODE_BYTES != sizeof(struct hammer2_inode_data))
165 if (HAMMER2_ALLOCREF_BYTES != sizeof(struct hammer2_allocref))
167 if (HAMMER2_VOLUME_BYTES != sizeof(struct hammer2_volume_data))
171 kprintf("HAMMER2 structure size mismatch; cannot continue.\n");
177 * Mount or remount HAMMER2 fileystem from physical media
180 * mp mount point structure
186 * mp mount point structure
187 * path path to mount point
188 * data pointer to argument structure in user space
189 * volume volume path (device@LABEL form)
190 * hflags user mount flags
191 * cred user credentials
198 hammer2_vfs_mount(struct mount *mp, char *path, caddr_t data,
201 struct hammer2_mount_info info;
202 hammer2_mount_t *hmp;
205 struct nlookupdata nd;
206 hammer2_chain_t *parent;
207 hammer2_chain_t *schain;
208 hammer2_chain_t *rchain;
209 char devstr[MNAMELEN];
222 kprintf("hammer2_mount\n");
231 * Non-root mount or updating a mount
233 error = copyin(data, &info, sizeof(info));
237 error = copyinstr(info.volume, devstr, MNAMELEN - 1, &done);
241 /* Extract device and label */
243 label = strchr(devstr, '@');
245 ((label + 1) - dev) > done) {
253 if (mp->mnt_flag & MNT_UPDATE) {
255 /* HAMMER2 implements NFS export via mountctl */
258 error = hammer2_remount(mp, path, devvp, cred);
266 /* Lookup name and verify it refers to a block device */
267 error = nlookup_init(&nd, dev, UIO_SYSSPACE, NLC_FOLLOW);
269 error = nlookup(&nd);
271 error = cache_vref(&nd.nl_nch, nd.nl_cred, &devvp);
275 if (vn_isdisk(devvp, &error))
276 error = vfs_mountedon(devvp);
278 if (error == 0 && vcount(devvp) > 0)
282 * Now open the device
285 ronly = ((mp->mnt_flag & MNT_RDONLY) != 0);
286 vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
287 error = vinvalbuf(devvp, V_SAVE, 0, 0);
289 error = VOP_OPEN(devvp, ronly ? FREAD : FREAD | FWRITE,
294 if (error && devvp) {
302 * Block device opened successfully, finish initializing the
305 * From this point on we have to call hammer2_unmount() on failure.
307 hmp = kmalloc(sizeof(*hmp), M_HAMMER2, M_WAITOK | M_ZERO);
308 mp->mnt_data = (qaddr_t)hmp;
312 kmalloc_create(&hmp->minode, "HAMMER2-inodes");
313 kmalloc_create(&hmp->mchain, "HAMMER2-chains");
315 mp->mnt_flag = MNT_LOCAL;
316 mp->mnt_kern_flag |= MNTK_ALL_MPSAFE; /* all entry pts are SMP */
319 * vchain setup. vchain.data is special cased to NULL. vchain.refs
320 * is initialized and will never drop to 0.
322 hmp->vchain.bref.type = HAMMER2_BREF_TYPE_VOLUME;
323 hmp->vchain.refs = 1;
324 hmp->vchain.data = (void *)&hmp->voldata;
325 hmp->vchain.bref.data_off = 0 | HAMMER2_PBUFRADIX;
326 /* hmp->vchain.u.xxx is left NULL */
327 lockinit(&hmp->vchain.lk, "volume", 0, LK_CANRECURSE);
328 lockinit(&hmp->alloclk, "h2alloc", 0, 0);
331 * Install the volume header
333 error = hammer2_install_volume_header(hmp);
335 hammer2_vfs_unmount(mp, MNT_FORCE);
340 * required mount structure initializations
342 mp->mnt_stat.f_iosize = HAMMER2_PBUFSIZE;
343 mp->mnt_stat.f_bsize = HAMMER2_PBUFSIZE;
345 mp->mnt_vstat.f_frsize = HAMMER2_PBUFSIZE;
346 mp->mnt_vstat.f_bsize = HAMMER2_PBUFSIZE;
349 * First locate the super-root inode, which is key 0 relative to the
350 * volume header's blockset.
352 * Then locate the root inode by scanning the directory keyspace
353 * represented by the label.
355 lhc = hammer2_dirhash(label, strlen(label));
356 parent = &hmp->vchain;
357 hammer2_chain_lock(hmp, parent, HAMMER2_RESOLVE_ALWAYS);
358 schain = hammer2_chain_lookup(hmp, &parent,
359 HAMMER2_SROOT_KEY, HAMMER2_SROOT_KEY, 0);
360 hammer2_chain_unlock(hmp, parent);
361 if (schain == NULL) {
362 kprintf("hammer2_mount: invalid super-root\n");
363 hammer2_vfs_unmount(mp, MNT_FORCE);
367 hammer2_chain_ref(hmp, schain); /* for hmp->schain */
369 rchain = hammer2_chain_lookup(hmp, &parent,
370 lhc, lhc + HAMMER2_DIRHASH_LOMASK,
373 if (rchain->bref.type == HAMMER2_BREF_TYPE_INODE &&
375 strcmp(label, rchain->data->ipdata.filename) == 0) {
378 rchain = hammer2_chain_next(hmp, &parent, rchain,
379 lhc, lhc + HAMMER2_DIRHASH_LOMASK,
382 hammer2_chain_unlock(hmp, parent);
383 if (rchain == NULL) {
384 kprintf("hammer2_mount: root label not found\n");
385 hammer2_chain_drop(hmp, schain);
386 hammer2_vfs_unmount(mp, MNT_FORCE);
389 hammer2_chain_ref(hmp, rchain); /* for hmp->rchain */
390 hammer2_chain_unlock(hmp, rchain);
392 hmp->schain = schain; /* left held & unlocked */
393 hmp->rchain = rchain; /* left held & unlocked */
394 hmp->iroot = rchain->u.ip; /* implied hold from rchain */
395 kprintf("iroot %p\n", rchain->u.ip);
398 vfs_add_vnodeops(mp, &hammer2_vnode_vops, &mp->mnt_vn_norm_ops);
399 vfs_add_vnodeops(mp, &hammer2_spec_vops, &mp->mnt_vn_spec_ops);
400 vfs_add_vnodeops(mp, &hammer2_fifo_vops, &mp->mnt_vn_fifo_ops);
402 copyinstr(info.volume, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &size);
403 bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
404 bzero(mp->mnt_stat.f_mntonname, sizeof(mp->mnt_stat.f_mntonname));
405 copyinstr(path, mp->mnt_stat.f_mntonname,
406 sizeof(mp->mnt_stat.f_mntonname) - 1,
409 hammer2_vfs_statfs(mp, &mp->mnt_stat, cred);
416 hammer2_remount(struct mount *mp, char *path, struct vnode *devvp,
424 hammer2_vfs_unmount(struct mount *mp, int mntflags)
426 hammer2_mount_t *hmp;
429 int ronly = ((mp->mnt_flag & MNT_RDONLY) != 0);
432 kprintf("hammer2_unmount\n");
437 if (mntflags & MNT_FORCE)
440 hammer2_mount_exlock(hmp);
443 * If mount initialization proceeded far enough we must flush
447 error = vflush(mp, 0, flags);
453 * Flush any left over chains
455 if (hmp->vchain.flags & (HAMMER2_CHAIN_MODIFIED1 |
456 HAMMER2_CHAIN_SUBMODIFIED)) {
457 hammer2_vfs_sync(mp, MNT_WAIT);
459 if (hmp->vchain.flags & (HAMMER2_CHAIN_MODIFIED1 |
460 HAMMER2_CHAIN_SUBMODIFIED)) {
461 kprintf("hammer2_unmount: chains left over after final sync\n");
462 if (hammer2_debug & 0x0010)
463 Debugger("entered debugger");
467 * Cleanup the root and super-root chain elements (which should be
472 KKASSERT(hmp->rchain->refs == 1);
473 hammer2_chain_drop(hmp, hmp->rchain);
477 KKASSERT(hmp->schain->refs == 1);
478 hammer2_chain_drop(hmp, hmp->schain);
483 * Finish up with the device vnode
485 if ((devvp = hmp->devvp) != NULL) {
486 vinvalbuf(devvp, (ronly ? 0 : V_SAVE), 0, 0);
488 VOP_CLOSE(devvp, (ronly ? FREAD : FREAD|FWRITE));
493 kmalloc_destroy(&hmp->minode);
494 kmalloc_destroy(&hmp->mchain);
496 hammer2_mount_unlock(hmp);
500 kfree(hmp, M_HAMMER2);
507 hammer2_vfs_vget(struct mount *mp, struct vnode *dvp,
508 ino_t ino, struct vnode **vpp)
510 kprintf("hammer2_vget\n");
516 hammer2_vfs_root(struct mount *mp, struct vnode **vpp)
518 hammer2_mount_t *hmp;
523 hammer2_mount_exlock(hmp);
524 if (hmp->iroot == NULL) {
528 vp = hammer2_igetv(hmp->iroot, &error);
531 kprintf("vnodefail\n");
533 hammer2_mount_unlock(hmp);
540 hammer2_vfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred)
542 hammer2_mount_t *hmp;
546 mp->mnt_stat.f_files = 10;
547 mp->mnt_stat.f_bfree = 10;
548 mp->mnt_stat.f_bavail = mp->mnt_stat.f_bfree;
556 hammer2_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred)
558 hammer2_mount_t *hmp;
562 mp->mnt_vstat.f_bsize = HAMMER2_PBUFSIZE;
563 mp->mnt_vstat.f_files = 0;
564 mp->mnt_vstat.f_bavail = mp->mnt_stat.f_bfree;
566 *sbp = mp->mnt_vstat;
571 * Sync the entire filesystem; this is called from the filesystem syncer
572 * process periodically and whenever a user calls sync(1) on the hammer
575 * Currently is actually called from the syncer! \o/
577 * This task will have to snapshot the state of the dirty inode chain.
578 * From that, it will have to make sure all of the inodes on the dirty
579 * chain have IO initiated. We make sure that io is initiated for the root
582 * If waitfor is set, we wait for media to acknowledge the new rootblock.
584 * THINKS: side A vs side B, to have sync not stall all I/O?
588 hammer2_vfs_sync(struct mount *mp, int waitfor)
590 struct hammer2_sync_info info;
591 hammer2_mount_t *hmp;
599 if (waitfor & MNT_LAZY)
600 flags |= VMSC_ONEPASS;
603 info.waitfor = MNT_NOWAIT;
604 vmntvnodescan(mp, flags | VMSC_NOWAIT,
606 hammer2_sync_scan2, &info);
607 if (info.error == 0 && (waitfor & MNT_WAIT)) {
608 info.waitfor = waitfor;
609 vmntvnodescan(mp, flags,
611 hammer2_sync_scan2, &info);
615 if (waitfor == MNT_WAIT) {
621 hammer2_chain_lock(hmp, &hmp->vchain, HAMMER2_RESOLVE_ALWAYS);
622 if (hmp->vchain.flags &
623 (HAMMER2_CHAIN_MODIFIED1 | HAMMER2_CHAIN_SUBMODIFIED)) {
624 hammer2_chain_flush(hmp, &hmp->vchain);
629 hammer2_chain_unlock(hmp, &hmp->vchain);
633 if ((waitfor & MNT_LAZY) == 0) {
634 waitfor = MNT_NOWAIT;
635 vn_lock(hmp->devvp, LK_EXCLUSIVE | LK_RETRY);
636 error = VOP_FSYNC(hmp->devvp, waitfor, 0);
637 vn_unlock(hmp->devvp);
640 if (error == 0 && haswork) {
643 kprintf("synchronize disk\n");
646 bp->b_bio1.bio_offset = 0;
649 bp->b_cmd = BUF_CMD_FLUSH;
650 bp->b_bio1.bio_done = biodone_sync;
651 bp->b_bio1.bio_flags |= BIO_SYNC;
652 vn_strategy(hmp->devvp, &bp->b_bio1);
653 biowait(&bp->b_bio1, "h2vol");
656 kprintf("flush volume header\n");
658 bp = getblk(hmp->devvp, 0, HAMMER2_PBUFSIZE, 0, 0);
659 bcopy(&hmp->voldata, bp->b_data, HAMMER2_PBUFSIZE);
668 * NOTE: We don't test SUBMODIFIED or MOVED here because the fsync code
669 * won't flush on those flags. The syncer code above will do a
670 * general meta-data flush globally that will catch these flags.
673 hammer2_sync_scan1(struct mount *mp, struct vnode *vp, void *data)
678 if (vp->v_type == VNON || ip == NULL ||
679 ((ip->chain.flags & (HAMMER2_CHAIN_MODIFIED1 |
680 HAMMER2_CHAIN_DIRTYEMBED)) == 0 &&
681 RB_EMPTY(&vp->v_rbdirty_tree))) {
688 hammer2_sync_scan2(struct mount *mp, struct vnode *vp, void *data)
690 struct hammer2_sync_info *info = data;
695 if (vp->v_type == VNON || vp->v_type == VBAD ||
696 ((ip->chain.flags & (HAMMER2_CHAIN_MODIFIED1 |
697 HAMMER2_CHAIN_DIRTYEMBED)) == 0 &&
698 RB_EMPTY(&vp->v_rbdirty_tree))) {
701 error = VOP_FSYNC(vp, MNT_NOWAIT, 0);
709 hammer2_vfs_vptofh(struct vnode *vp, struct fid *fhp)
716 hammer2_vfs_fhtovp(struct mount *mp, struct vnode *rootvp,
717 struct fid *fhp, struct vnode **vpp)
724 hammer2_vfs_checkexp(struct mount *mp, struct sockaddr *nam,
725 int *exflagsp, struct ucred **credanonp)
731 * Support code for hammer2_mount(). Read, verify, and install the volume
732 * header into the HMP
734 * XXX read four volhdrs and use the one with the highest TID whos CRC
739 * XXX For filesystems w/ less than 4 volhdrs, make sure to not write to
740 * nonexistant locations.
742 * XXX Record selected volhdr and ring updates to each of 4 volhdrs
746 hammer2_install_volume_header(hammer2_mount_t *hmp)
748 hammer2_volume_data_t *vd;
750 hammer2_crc32_t crc0, crc, bcrc0, bcrc;
762 * There are up to 4 copies of the volume header (syncs iterate
763 * between them so there is no single master). We don't trust the
764 * volu_size field so we don't know precisely how large the filesystem
765 * is, so depend on the OS to return an error if we go beyond the
766 * block device's EOF.
768 for (i = 0; i < HAMMER2_NUM_VOLHDRS; i++) {
769 error = bread(hmp->devvp, i * HAMMER2_RESERVE_BYTES64,
770 HAMMER2_VOLUME_BYTES, &bp);
777 vd = (struct hammer2_volume_data *) bp->b_data;
778 if ((vd->magic != HAMMER2_VOLUME_ID_HBO) &&
779 (vd->magic != HAMMER2_VOLUME_ID_ABO)) {
785 if (vd->magic == HAMMER2_VOLUME_ID_ABO) {
786 /* XXX: Reversed-endianness filesystem */
787 kprintf("hammer2: reverse-endian filesystem detected");
793 crc = vd->icrc_sects[HAMMER2_VOL_ICRC_SECT0];
794 crc0 = hammer2_icrc32(bp->b_data + HAMMER2_VOLUME_ICRC0_OFF,
795 HAMMER2_VOLUME_ICRC0_SIZE);
796 bcrc = vd->icrc_sects[HAMMER2_VOL_ICRC_SECT1];
797 bcrc0 = hammer2_icrc32(bp->b_data + HAMMER2_VOLUME_ICRC1_OFF,
798 HAMMER2_VOLUME_ICRC1_SIZE);
799 if ((crc0 != crc) || (bcrc0 != bcrc)) {
800 kprintf("hammer2 volume header crc "
801 "mismatch copy #%d\t%08x %08x",
808 if (valid == 0 || hmp->voldata.last_tid < vd->last_tid) {
818 kprintf("hammer2: a valid volume header was found\n");
821 kprintf("hammer2: no valid volume headers found!\n");