Deleted Added
full compact
inode.c (81911) inode.c (86514)
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 81911 2001-08-19 08:19:37Z kris $";
39 "$FreeBSD: head/sbin/fsck_ffs/inode.c 86514 2001-11-17 23:48:21Z iedowse $";
40#endif /* not lint */
41
42#include <sys/param.h>
43#include <sys/time.h>
44#include <sys/sysctl.h>
45
46#include <ufs/ufs/dinode.h>
47#include <ufs/ufs/dir.h>

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

249 register int c;
250
251 if (cnt <= 0 || blk <= 0 || blk > maxfsblock ||
252 cnt - 1 > maxfsblock - blk)
253 return (1);
254 if (cnt > sblock.fs_frag ||
255 fragnum(&sblock, blk) + cnt > sblock.fs_frag) {
256 if (debug)
40#endif /* not lint */
41
42#include <sys/param.h>
43#include <sys/time.h>
44#include <sys/sysctl.h>
45
46#include <ufs/ufs/dinode.h>
47#include <ufs/ufs/dir.h>

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

249 register int c;
250
251 if (cnt <= 0 || blk <= 0 || blk > maxfsblock ||
252 cnt - 1 > maxfsblock - blk)
253 return (1);
254 if (cnt > sblock.fs_frag ||
255 fragnum(&sblock, blk) + cnt > sblock.fs_frag) {
256 if (debug)
257 printf("bad size: blk %ld, offset %ld, size %ld\n",
258 blk, fragnum(&sblock, blk), cnt);
257 printf("bad size: blk %ld, offset %i, size %d\n",
258 (long)blk, (int)fragnum(&sblock, blk), cnt);
259 return (1);
260 }
261 c = dtog(&sblock, blk);
262 if (blk < cgdmin(&sblock, c)) {
263 if ((blk + cnt) > cgsblock(&sblock, c)) {
264 if (debug) {
265 printf("blk %ld < cgdmin %ld;",
266 (long)blk, (long)cgdmin(&sblock, c));

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

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)
259 return (1);
260 }
261 c = dtog(&sblock, blk);
262 if (blk < cgdmin(&sblock, c)) {
263 if ((blk + cnt) > cgsblock(&sblock, c)) {
264 if (debug) {
265 printf("blk %ld < cgdmin %ld;",
266 (long)blk, (long)cgdmin(&sblock, c));

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

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",
496 printf("adjrefcnt ino %ld amt %ld\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 }
502 }
503}
504

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

575
576void
577blkerror(ino, type, blk)
578 ino_t ino;
579 char *type;
580 ufs_daddr_t blk;
581{
582
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 }
502 }
503}
504

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

575
576void
577blkerror(ino, type, blk)
578 ino_t ino;
579 char *type;
580 ufs_daddr_t blk;
581{
582
583 pfatal("%ld %s I=%lu", blk, type, ino);
583 pfatal("%ld %s I=%lu", (long)blk, type, (u_long)ino);
584 printf("\n");
585 switch (inoinfo(ino)->ino_state) {
586
587 case FSTATE:
588 inoinfo(ino)->ino_state = FCLEAR;
589 return;
590
591 case DSTATE:

--- 95 unchanged lines hidden ---
584 printf("\n");
585 switch (inoinfo(ino)->ino_state) {
586
587 case FSTATE:
588 inoinfo(ino)->ino_state = FCLEAR;
589 return;
590
591 case DSTATE:

--- 95 unchanged lines hidden ---