pass2.c (101037) | pass2.c (102411) |
---|---|
1/* 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 | 1/* 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 |
34#ifndef lint | |
35#if 0 | 34#if 0 |
35#ifndef lint |
|
36static const char sccsid[] = "@(#)pass2.c 8.9 (Berkeley) 4/28/95"; | 36static const char sccsid[] = "@(#)pass2.c 8.9 (Berkeley) 4/28/95"; |
37#endif 38static const char rcsid[] = 39 "$FreeBSD: head/sbin/fsck_ffs/pass2.c 101037 2002-07-31 12:01:14Z mux $"; | |
40#endif /* not lint */ | 37#endif /* not lint */ |
38#endif |
|
41 | 39 |
40#include <sys/cdefs.h> 41__FBSDID("$FreeBSD: head/sbin/fsck_ffs/pass2.c 102411 2002-08-25 13:10:45Z charnier $"); 42 |
|
42#include <sys/param.h> 43 44#include <ufs/ufs/dinode.h> 45#include <ufs/ufs/dir.h> 46#include <ufs/ffs/fs.h> 47 48#include <err.h> 49#include <stdint.h> --- 351 unchanged lines hidden (view full) --- 401 inoinfo(dirp->d_ino)->ino_state = 402 (DIP(dp, di_mode) & IFMT) == IFDIR ? DSTATE : FSTATE; 403 inoinfo(dirp->d_ino)->ino_linkcnt = DIP(dp, di_nlink); 404 goto again; 405 406 case DSTATE: 407 if (inoinfo(idesc->id_number)->ino_state == DFOUND) 408 inoinfo(dirp->d_ino)->ino_state = DFOUND; | 43#include <sys/param.h> 44 45#include <ufs/ufs/dinode.h> 46#include <ufs/ufs/dir.h> 47#include <ufs/ffs/fs.h> 48 49#include <err.h> 50#include <stdint.h> --- 351 unchanged lines hidden (view full) --- 402 inoinfo(dirp->d_ino)->ino_state = 403 (DIP(dp, di_mode) & IFMT) == IFDIR ? DSTATE : FSTATE; 404 inoinfo(dirp->d_ino)->ino_linkcnt = DIP(dp, di_nlink); 405 goto again; 406 407 case DSTATE: 408 if (inoinfo(idesc->id_number)->ino_state == DFOUND) 409 inoinfo(dirp->d_ino)->ino_state = DFOUND; |
409 /* fall through */ | 410 /* FALLTHROUGH */ |
410 411 case DFOUND: 412 inp = getinoinfo(dirp->d_ino); 413 if (inp->i_parent != 0 && idesc->id_entryno > 2) { 414 getpathname(pathbuf, idesc->id_number, 415 idesc->id_number); 416 getpathname(namebuf, dirp->d_ino, dirp->d_ino); 417 pwarn("%s%s%s %s %s\n", pathbuf, --- 8 unchanged lines hidden (view full) --- 426 n = 1; 427 break; 428 } 429 if ((n = reply("REMOVE")) == 1) 430 break; 431 } 432 if (idesc->id_entryno > 2) 433 inp->i_parent = idesc->id_number; | 411 412 case DFOUND: 413 inp = getinoinfo(dirp->d_ino); 414 if (inp->i_parent != 0 && idesc->id_entryno > 2) { 415 getpathname(pathbuf, idesc->id_number, 416 idesc->id_number); 417 getpathname(namebuf, dirp->d_ino, dirp->d_ino); 418 pwarn("%s%s%s %s %s\n", pathbuf, --- 8 unchanged lines hidden (view full) --- 427 n = 1; 428 break; 429 } 430 if ((n = reply("REMOVE")) == 1) 431 break; 432 } 433 if (idesc->id_entryno > 2) 434 inp->i_parent = idesc->id_number; |
434 /* fall through */ | 435 /* FALLTHROUGH */ |
435 436 case FSTATE: 437 if (dirp->d_type != inoinfo(dirp->d_ino)->ino_type) { 438 fileerror(idesc->id_number, dirp->d_ino, 439 "BAD TYPE VALUE"); 440 dirp->d_type = inoinfo(dirp->d_ino)->ino_type; 441 if (reply("FIX") == 1) 442 ret |= ALTERED; --- 25 unchanged lines hidden --- | 436 437 case FSTATE: 438 if (dirp->d_type != inoinfo(dirp->d_ino)->ino_type) { 439 fileerror(idesc->id_number, dirp->d_ino, 440 "BAD TYPE VALUE"); 441 dirp->d_type = inoinfo(dirp->d_ino)->ino_type; 442 if (reply("FIX") == 1) 443 ret |= ALTERED; --- 25 unchanged lines hidden --- |