pass2.c (1558) | pass2.c (7585) |
---|---|
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 --- 18 unchanged lines hidden (view full) --- 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 | 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 --- 18 unchanged lines hidden (view full) --- 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 |
35static char sccsid[] = "@(#)pass2.c 8.2 (Berkeley) 2/27/94"; | 35static const char sccsid[] = "@(#)pass2.c 8.2 (Berkeley) 2/27/94"; |
36#endif /* not lint */ 37 38#include <sys/param.h> 39#include <sys/time.h> 40#include <ufs/ufs/dinode.h> 41#include <ufs/ufs/dir.h> 42#include <ufs/ffs/fs.h> | 36#endif /* not lint */ 37 38#include <sys/param.h> 39#include <sys/time.h> 40#include <ufs/ufs/dinode.h> 41#include <ufs/ufs/dir.h> 42#include <ufs/ffs/fs.h> |
43#include <stdio.h> |
|
43#include <stdlib.h> 44#include <string.h> 45#include "fsck.h" 46 47#define MINDIRSIZE (sizeof (struct dirtemplate)) 48 49int pass2check(), blksort(); 50 | 44#include <stdlib.h> 45#include <string.h> 46#include "fsck.h" 47 48#define MINDIRSIZE (sizeof (struct dirtemplate)) 49 50int pass2check(), blksort(); 51 |
52void |
|
51pass2() 52{ 53 register struct dinode *dp; 54 register struct inoinfo **inpp, *inp; 55 struct inoinfo **inpend; 56 struct inodesc curino; 57 struct dinode dino; 58 char pathbuf[MAXPATHLEN + 1]; --- 125 unchanged lines hidden (view full) --- 184 (void)changeino(inp->i_number, "..", inp->i_parent); 185 } 186 /* 187 * Mark all the directories that can be found from the root. 188 */ 189 propagate(); 190} 191 | 53pass2() 54{ 55 register struct dinode *dp; 56 register struct inoinfo **inpp, *inp; 57 struct inoinfo **inpend; 58 struct inodesc curino; 59 struct dinode dino; 60 char pathbuf[MAXPATHLEN + 1]; --- 125 unchanged lines hidden (view full) --- 186 (void)changeino(inp->i_number, "..", inp->i_parent); 187 } 188 /* 189 * Mark all the directories that can be found from the root. 190 */ 191 propagate(); 192} 193 |
194int |
|
192pass2check(idesc) 193 struct inodesc *idesc; 194{ 195 register struct direct *dirp = idesc->id_dirp; 196 register struct inoinfo *inp; 197 int n, entrysize, ret = 0; 198 struct dinode *dp; 199 char *errmsg; --- 217 unchanged lines hidden (view full) --- 417 return (ret|KEEPON); 418 dirp->d_ino = 0; 419 return (ret|KEEPON|ALTERED); 420} 421 422/* 423 * Routine to sort disk blocks. 424 */ | 195pass2check(idesc) 196 struct inodesc *idesc; 197{ 198 register struct direct *dirp = idesc->id_dirp; 199 register struct inoinfo *inp; 200 int n, entrysize, ret = 0; 201 struct dinode *dp; 202 char *errmsg; --- 217 unchanged lines hidden (view full) --- 420 return (ret|KEEPON); 421 dirp->d_ino = 0; 422 return (ret|KEEPON|ALTERED); 423} 424 425/* 426 * Routine to sort disk blocks. 427 */ |
428int |
|
425blksort(inpp1, inpp2) 426 struct inoinfo **inpp1, **inpp2; 427{ 428 429 return ((*inpp1)->i_blks[0] - (*inpp2)->i_blks[0]); 430} | 429blksort(inpp1, inpp2) 430 struct inoinfo **inpp1, **inpp2; 431{ 432 433 return ((*inpp1)->i_blks[0] - (*inpp2)->i_blks[0]); 434} |