Deleted Added
full compact
pass1.c (134589) pass1.c (136281)
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

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
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

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sbin/fsck_ffs/pass1.c 134589 2004-09-01 05:48:06Z scottl $");
36__FBSDID("$FreeBSD: head/sbin/fsck_ffs/pass1.c 136281 2004-10-08 20:44:47Z truckman $");
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <sys/sysctl.h>
41
42#include <ufs/ufs/dinode.h>
43#include <ufs/ufs/dir.h>
44#include <ufs/ffs/fs.h>

--- 139 unchanged lines hidden (view full) ---

184 }
185 freeinodebuf();
186}
187
188static void
189checkinode(ino_t inumber, struct inodesc *idesc)
190{
191 union dinode *dp;
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <sys/sysctl.h>
41
42#include <ufs/ufs/dinode.h>
43#include <ufs/ufs/dir.h>
44#include <ufs/ffs/fs.h>

--- 139 unchanged lines hidden (view full) ---

184 }
185 freeinodebuf();
186}
187
188static void
189checkinode(ino_t inumber, struct inodesc *idesc)
190{
191 union dinode *dp;
192 struct zlncnt *zlnp;
193 off_t kernmaxfilesize;
194 ufs2_daddr_t ndb;
195 mode_t mode;
196 int j, ret, offset;
197
198 dp = getnextinode(inumber);
199 mode = DIP(dp, di_mode) & IFMT;
200 if (mode == 0) {

--- 96 unchanged lines hidden (view full) ---

297 printf("bad indirect addr: %ju\n",
298 (uintmax_t)DIP(dp, di_ib[j]));
299 goto unknown;
300 }
301 if (ftypeok(dp) == 0)
302 goto unknown;
303 n_files++;
304 inoinfo(inumber)->ino_linkcnt = DIP(dp, di_nlink);
192 off_t kernmaxfilesize;
193 ufs2_daddr_t ndb;
194 mode_t mode;
195 int j, ret, offset;
196
197 dp = getnextinode(inumber);
198 mode = DIP(dp, di_mode) & IFMT;
199 if (mode == 0) {

--- 96 unchanged lines hidden (view full) ---

296 printf("bad indirect addr: %ju\n",
297 (uintmax_t)DIP(dp, di_ib[j]));
298 goto unknown;
299 }
300 if (ftypeok(dp) == 0)
301 goto unknown;
302 n_files++;
303 inoinfo(inumber)->ino_linkcnt = DIP(dp, di_nlink);
305 if (DIP(dp, di_nlink) <= 0) {
306 zlnp = (struct zlncnt *)malloc(sizeof *zlnp);
307 if (zlnp == NULL) {
308 pfatal("LINK COUNT TABLE OVERFLOW");
309 if (reply("CONTINUE") == 0) {
310 ckfini(0);
311 exit(EEXIT);
312 }
313 } else {
314 zlnp->zlncnt = inumber;
315 zlnp->next = zlnhead;
316 zlnhead = zlnp;
317 }
318 }
319 if (mode == IFDIR) {
320 if (DIP(dp, di_size) == 0)
321 inoinfo(inumber)->ino_state = DCLEAR;
304 if (mode == IFDIR) {
305 if (DIP(dp, di_size) == 0)
306 inoinfo(inumber)->ino_state = DCLEAR;
307 else if (DIP(dp, di_nlink) <= 0)
308 inoinfo(inumber)->ino_state = DZLINK;
322 else
323 inoinfo(inumber)->ino_state = DSTATE;
324 cacheino(dp, inumber);
325 countdirs++;
309 else
310 inoinfo(inumber)->ino_state = DSTATE;
311 cacheino(dp, inumber);
312 countdirs++;
326 } else
313 } else if (DIP(dp, di_nlink) <= 0)
314 inoinfo(inumber)->ino_state = FZLINK;
315 else
327 inoinfo(inumber)->ino_state = FSTATE;
328 inoinfo(inumber)->ino_type = IFTODT(mode);
329 badblk = dupblk = 0;
330 idesc->id_number = inumber;
331 if (DIP(dp, di_flags) & SF_SNAPSHOT)
332 idesc->id_type = SNAP;
333 else
334 idesc->id_type = ADDR;

--- 144 unchanged lines hidden ---
316 inoinfo(inumber)->ino_state = FSTATE;
317 inoinfo(inumber)->ino_type = IFTODT(mode);
318 badblk = dupblk = 0;
319 idesc->id_number = inumber;
320 if (DIP(dp, di_flags) & SF_SNAPSHOT)
321 idesc->id_type = SNAP;
322 else
323 idesc->id_type = ADDR;

--- 144 unchanged lines hidden ---