Deleted Added
full compact
inode.c (217769) inode.c (221110)
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[] = "@(#)inode.c 8.8 (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[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sbin/fsck_ffs/inode.c 217769 2011-01-24 06:17:05Z mckusick $");
36__FBSDID("$FreeBSD: head/sbin/fsck_ffs/inode.c 221110 2011-04-27 02:55:03Z des $");
37
38#include <sys/param.h>
39#include <sys/stdint.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>

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

86 numfrags(&sblock, fragroundup(&sblock, offset));
87 else
88 idesc->id_numfrags = sblock.fs_frag;
89 if (DIP(&dino, di_db[i]) == 0) {
90 if (idesc->id_type == DATA && ndb >= 0) {
91 /* An empty block in a directory XXX */
92 getpathname(pathbuf, idesc->id_number,
93 idesc->id_number);
37
38#include <sys/param.h>
39#include <sys/stdint.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>

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

86 numfrags(&sblock, fragroundup(&sblock, offset));
87 else
88 idesc->id_numfrags = sblock.fs_frag;
89 if (DIP(&dino, di_db[i]) == 0) {
90 if (idesc->id_type == DATA && ndb >= 0) {
91 /* An empty block in a directory XXX */
92 getpathname(pathbuf, idesc->id_number,
93 idesc->id_number);
94 pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
94 pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
95 pathbuf);
95 pathbuf);
96 if (reply("ADJUST LENGTH") == 1) {
96 if (reply("ADJUST LENGTH") == 1) {
97 dp = ginode(idesc->id_number);
97 dp = ginode(idesc->id_number);
98 DIP_SET(dp, di_size,
98 DIP_SET(dp, di_size,
99 i * sblock.fs_bsize);
100 printf(
101 "YOU MUST RERUN FSCK AFTERWARDS\n");
102 rerun = 1;
99 i * sblock.fs_bsize);
100 printf(
101 "YOU MUST RERUN FSCK AFTERWARDS\n");
102 rerun = 1;
103 inodirty();
104
105 }
103 inodirty();
104
105 }
106 }
107 continue;
108 }
109 idesc->id_blkno = DIP(&dino, di_db[i]);
110 if (idesc->id_type != DATA)
111 ret = (*idesc->id_func)(idesc);
112 else
113 ret = dirscan(idesc);

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

125 if (ret & STOP)
126 return (ret);
127 } else {
128 idesc->id_lbn += sizepb / sblock.fs_bsize;
129 if (idesc->id_type == DATA && remsize > 0) {
130 /* An empty block in a directory XXX */
131 getpathname(pathbuf, idesc->id_number,
132 idesc->id_number);
106 }
107 continue;
108 }
109 idesc->id_blkno = DIP(&dino, di_db[i]);
110 if (idesc->id_type != DATA)
111 ret = (*idesc->id_func)(idesc);
112 else
113 ret = dirscan(idesc);

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

125 if (ret & STOP)
126 return (ret);
127 } else {
128 idesc->id_lbn += sizepb / sblock.fs_bsize;
129 if (idesc->id_type == DATA && remsize > 0) {
130 /* An empty block in a directory XXX */
131 getpathname(pathbuf, idesc->id_number,
132 idesc->id_number);
133 pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
133 pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
134 pathbuf);
134 pathbuf);
135 if (reply("ADJUST LENGTH") == 1) {
135 if (reply("ADJUST LENGTH") == 1) {
136 dp = ginode(idesc->id_number);
136 dp = ginode(idesc->id_number);
137 DIP_SET(dp, di_size,
137 DIP_SET(dp, di_size,
138 DIP(dp, di_size) - remsize);
139 remsize = 0;
140 printf(
141 "YOU MUST RERUN FSCK AFTERWARDS\n");
142 rerun = 1;
138 DIP(dp, di_size) - remsize);
139 remsize = 0;
140 printf(
141 "YOU MUST RERUN FSCK AFTERWARDS\n");
142 rerun = 1;
143 inodirty();
143 inodirty();
144 break;
144 break;
145 }
145 }
146 }
147 }
148 remsize -= sizepb;
149 }
150 return (KEEPON);
151}
152
153static int

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

204 bp->b_flags &= ~B_INUSE;
205 return (n);
206 }
207 } else {
208 if (idesc->id_type == DATA && isize > 0) {
209 /* An empty block in a directory XXX */
210 getpathname(pathbuf, idesc->id_number,
211 idesc->id_number);
146 }
147 }
148 remsize -= sizepb;
149 }
150 return (KEEPON);
151}
152
153static int

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

204 bp->b_flags &= ~B_INUSE;
205 return (n);
206 }
207 } else {
208 if (idesc->id_type == DATA && isize > 0) {
209 /* An empty block in a directory XXX */
210 getpathname(pathbuf, idesc->id_number,
211 idesc->id_number);
212 pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
212 pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
213 pathbuf);
213 pathbuf);
214 if (reply("ADJUST LENGTH") == 1) {
214 if (reply("ADJUST LENGTH") == 1) {
215 dp = ginode(idesc->id_number);
215 dp = ginode(idesc->id_number);
216 DIP_SET(dp, di_size,
216 DIP_SET(dp, di_size,
217 DIP(dp, di_size) - isize);
218 isize = 0;
219 printf(
220 "YOU MUST RERUN FSCK AFTERWARDS\n");
221 rerun = 1;
217 DIP(dp, di_size) - isize);
218 isize = 0;
219 printf(
220 "YOU MUST RERUN FSCK AFTERWARDS\n");
221 rerun = 1;
222 inodirty();
222 inodirty();
223 bp->b_flags &= ~B_INUSE;
224 return(STOP);
223 bp->b_flags &= ~B_INUSE;
224 return(STOP);
225 }
225 }
226 }
227 }
228 isize -= sizepb;
229 }
230 bp->b_flags &= ~B_INUSE;
231 return (KEEPON);
232}
233

--- 495 unchanged lines hidden ---
226 }
227 }
228 isize -= sizepb;
229 }
230 bp->b_flags &= ~B_INUSE;
231 return (KEEPON);
232}
233

--- 495 unchanged lines hidden ---