2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980, 1986, 1990 The Regents of the University of California.
11 * All rights reserved.
13 * Redistribution and use in source and binary forms are permitted
14 * provided that: (1) source distributions retain this entire copyright
15 * notice and comment, and (2) distributions including binaries display
16 * the following acknowledgement: ``This product includes software
17 * developed by the University of California, Berkeley and its contributors''
18 * in the documentation or other materials provided with the distribution
19 * and in all advertising materials mentioning features or use of this
20 * software. Neither the name of the University nor the names of its
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <sys/param.h>
34 #include <sys/types.h>
35 #include <sys/mntent.h>
36 #include <sys/fs/ufs_fs.h>
37 #include <sys/vnode.h>
38 #include <sys/fs/ufs_inode.h>
41 static int pass1bcheck(struct inodesc
*);
51 * We can get STOP failures from ckinode() that
52 * are completely independent of our dup checks.
53 * If that were not the case, then we could track
54 * when we've seen all of the dups and short-
55 * circuit our search. As it is, we need to
56 * keep going, so there's no point in looking
57 * at what ckinode() returns to us.
60 for (inumber
= UFSROOTINO
; inumber
< maxino
; inumber
++) {
63 idesc
.id_func
= pass1bcheck
;
64 idesc
.id_number
= inumber
;
65 idesc
.id_fix
= DONTKNOW
;
67 if (statemap
[inumber
] != USTATE
)
68 (void) ckinode(dp
, &idesc
, CKI_TRAVERSE
);
73 pass1bcheck(struct inodesc
*idesc
)
78 daddr32_t blkno
= idesc
->id_blkno
;
80 for (nfrags
= 0; nfrags
< idesc
->id_numfrags
; blkno
++, nfrags
++) {
81 if (chkrange(blkno
, 1)) {
85 * Note that we only report additional dup claimants
86 * in this pass, as the first claimant found was
87 * listed during pass 1.
89 lbn
= idesc
->id_lbn
* sblock
.fs_frag
+ nfrags
;
90 if (find_dup_ref(blkno
, idesc
->id_number
, lbn
, DB_INCR
))
91 blkerror(idesc
->id_number
, "DUP", blkno
, lbn
);