inode.c (63231) | inode.c (74556) |
---|---|
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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static const char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95"; 37#endif 38static const char rcsid[] = | 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 --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static const char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/sbin/fsck_ffs/inode.c 63231 2000-07-15 18:28:36Z mckusick $"; | 39 "$FreeBSD: head/sbin/fsck_ffs/inode.c 74556 2001-03-21 09:48:03Z mckusick $"; |
40#endif /* not lint */ 41 42#include <sys/param.h> 43#include <sys/time.h> | 40#endif /* not lint */ 41 42#include <sys/param.h> 43#include <sys/time.h> |
44#include <sys/sysctl.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 <pwd.h> 51#include <string.h> --- 130 unchanged lines hidden (view full) --- 182 nif = NINDIR(&sblock); 183 if (idesc->id_func == pass1check && nif < NINDIR(&sblock)) { 184 aplim = &bp->b_un.b_indir[NINDIR(&sblock)]; 185 for (ap = &bp->b_un.b_indir[nif]; ap < aplim; ap++) { 186 if (*ap == 0) 187 continue; 188 (void)sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu", 189 (u_long)idesc->id_number); | 45 46#include <ufs/ufs/dinode.h> 47#include <ufs/ufs/dir.h> 48#include <ufs/ffs/fs.h> 49 50#include <err.h> 51#include <pwd.h> 52#include <string.h> --- 130 unchanged lines hidden (view full) --- 183 nif = NINDIR(&sblock); 184 if (idesc->id_func == pass1check && nif < NINDIR(&sblock)) { 185 aplim = &bp->b_un.b_indir[NINDIR(&sblock)]; 186 for (ap = &bp->b_un.b_indir[nif]; ap < aplim; ap++) { 187 if (*ap == 0) 188 continue; 189 (void)sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu", 190 (u_long)idesc->id_number); |
190 if (dofix(idesc, buf)) { | 191 if (usedsoftdep) { 192 pfatal(buf); 193 } else if (dofix(idesc, buf)) { |
191 *ap = 0; 192 dirty(bp); 193 } 194 } 195 flush(fswritefd, bp); 196 } 197 aplim = &bp->b_un.b_indir[nif]; 198 for (ap = bp->b_un.b_indir; ap < aplim; ap++) { --- 277 unchanged lines hidden (view full) --- 476 pwarn("%s %s", type, 477 (dp->di_mode & IFMT) == IFDIR ? "DIR" : "FILE"); 478 pinode(idesc->id_number); 479 } 480 if (preen || reply("CLEAR") == 1) { 481 if (preen) 482 printf(" (CLEARED)\n"); 483 n_files--; | 194 *ap = 0; 195 dirty(bp); 196 } 197 } 198 flush(fswritefd, bp); 199 } 200 aplim = &bp->b_un.b_indir[nif]; 201 for (ap = bp->b_un.b_indir; ap < aplim; ap++) { --- 277 unchanged lines hidden (view full) --- 479 pwarn("%s %s", type, 480 (dp->di_mode & IFMT) == IFDIR ? "DIR" : "FILE"); 481 pinode(idesc->id_number); 482 } 483 if (preen || reply("CLEAR") == 1) { 484 if (preen) 485 printf(" (CLEARED)\n"); 486 n_files--; |
484 (void)ckinode(dp, idesc); 485 clearinode(dp); 486 inoinfo(idesc->id_number)->ino_state = USTATE; 487 inodirty(); | 487 if (bkgrdflag == 0) { 488 (void)ckinode(dp, idesc); 489 inoinfo(idesc->id_number)->ino_state = USTATE; 490 clearinode(dp); 491 inodirty(); 492 } else { 493 cmd.value = idesc->id_number; 494 cmd.size = -dp->di_nlink; 495 if (debug) 496 printf("adjrefcnt ino %d amt %d\n", 497 (long)cmd.value, cmd.size); 498 if (sysctl(adjrefcnt, MIBSIZE, 0, 0, 499 &cmd, sizeof cmd) == -1) 500 rwerror("ADJUST INODE", cmd.value); 501 } |
488 } 489} 490 491int 492findname(idesc) 493 struct inodesc *idesc; 494{ 495 register struct direct *dirp = idesc->id_dirp; --- 177 unchanged lines hidden --- | 502 } 503} 504 505int 506findname(idesc) 507 struct inodesc *idesc; 508{ 509 register struct direct *dirp = idesc->id_dirp; --- 177 unchanged lines hidden --- |