SCCS-vsn: sbin/dump/traverse.c 5.10
SCCS-vsn: sbin/dump/main.c 5.14
SCCS-vsn: sbin/dump/dump.h 5.14
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)dump.h 5.13 (Berkeley) %G%
+ * @(#)dump.h 5.14 (Berkeley) %G%
#define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
#define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
#define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
#define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
-static char sccsid[] = "@(#)main.c 5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.14 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
char **argv;
{
register ino_t ino;
char **argv;
{
register ino_t ino;
register struct dinode *dp;
register struct fstab *dt;
register char *map;
register struct dinode *dp;
register struct fstab *dt;
register char *map;
if (argc < 1)
break;
bflag++;
if (argc < 1)
break;
bflag++;
if (ntrec < 1) {
fprintf(stderr, "%s \"%s\"\n",
"bad number of blocks per write ", *argv);
if (ntrec < 1) {
fprintf(stderr, "%s \"%s\"\n",
"bad number of blocks per write ", *argv);
msg("dumping (Pass III) [directories]\n");
for (map = dumpdirmap, ino = 0; ino < maxino; ) {
if ((ino % NBBY) == 0)
msg("dumping (Pass III) [directories]\n");
for (map = dumpdirmap, ino = 0; ino < maxino; ) {
if ((ino % NBBY) == 0)
continue;
/*
* Skip directory inodes deleted and maybe reallocated
continue;
/*
* Skip directory inodes deleted and maybe reallocated
msg("dumping (Pass IV) [regular files]\n");
for (map = dumpinomap, ino = 0; ino < maxino; ) {
if ((ino % NBBY) == 0)
msg("dumping (Pass IV) [regular files]\n");
for (map = dumpinomap, ino = 0; ino < maxino; ) {
if ((ino % NBBY) == 0)
continue;
/*
* Skip inodes deleted and reallocated as directories.
continue;
/*
* Skip inodes deleted and reallocated as directories.
-static char sccsid[] = "@(#)traverse.c 5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)traverse.c 5.10 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
* hence the estimate may be high.
*/
long
* hence the estimate may be high.
*/
long
-blockest(ip)
- struct dinode *ip;
+blockest(dp)
+ register struct dinode *dp;
{
long blkest, sizeest;
/*
{
long blkest, sizeest;
/*
- * ip->di_size is the size of the file in bytes.
- * ip->di_blocks stores the number of sectors actually in the file.
+ * dp->di_size is the size of the file in bytes.
+ * dp->di_blocks stores the number of sectors actually in the file.
* If there are more sectors than the size would indicate, this just
* means that there are indirect blocks in the file or unused
* sectors in the last file block; we can safely ignore these
* If there are more sectors than the size would indicate, this just
* means that there are indirect blocks in the file or unused
* sectors in the last file block; we can safely ignore these
* dump blocks (sizeest vs. blkest in the indirect block
* calculation).
*/
* dump blocks (sizeest vs. blkest in the indirect block
* calculation).
*/
- blkest = howmany(dbtob(ip->di_blocks), TP_BSIZE);
- sizeest = howmany(ip->di_size, TP_BSIZE);
+ blkest = howmany(dbtob(dp->di_blocks), TP_BSIZE);
+ sizeest = howmany(dp->di_size, TP_BSIZE);
if (blkest > sizeest)
blkest = sizeest;
if (blkest > sizeest)
blkest = sizeest;
- if (ip->di_size > sblock->fs_bsize * NDADDR) {
+ if (dp->di_size > sblock->fs_bsize * NDADDR) {
/* calculate the number of indirect blocks on the dump tape */
blkest +=
howmany(sizeest - NDADDR * sblock->fs_bsize / TP_BSIZE,
/* calculate the number of indirect blocks on the dump tape */
blkest +=
howmany(sizeest - NDADDR * sblock->fs_bsize / TP_BSIZE,
long *tapesize;
{
register struct dinode *dp;
long *tapesize;
{
register struct dinode *dp;
register char *map;
register ino_t ino;
long filesize, blkcnt = 0;
register char *map;
register ino_t ino;
long filesize, blkcnt = 0;
for (map = dumpdirmap, ino = 0; ino < maxino; ) {
if ((ino % NBBY) == 0)
for (map = dumpdirmap, ino = 0; ino < maxino; ) {
if ((ino % NBBY) == 0)
- if ((bits & 1) == 0 || TSTINO(ino, dumpinomap))
+ if ((dirty & 1) == 0 || TSTINO(ino, dumpinomap))
continue;
dp = getino(ino);
filesize = dp->di_size;
continue;
dp = getino(ino);
filesize = dp->di_size;
* Dump the contents of an inode to tape.
*/
void
* Dump the contents of an inode to tape.
*/
void
-dumpino(ip, ino)
- struct dinode *ip;
+dumpino(dp, ino)
+ register struct dinode *dp;
ino_t ino;
{
int mode, level, cnt;
ino_t ino;
{
int mode, level, cnt;
dumpmap(dumpinomap, TS_BITS, ino);
}
CLRINO(ino, dumpinomap);
dumpmap(dumpinomap, TS_BITS, ino);
}
CLRINO(ino, dumpinomap);
spcl.c_type = TS_INODE;
spcl.c_count = 0;
/*
* Check for freed inode.
*/
spcl.c_type = TS_INODE;
spcl.c_count = 0;
/*
* Check for freed inode.
*/
- if ((mode = (ip->di_mode & IFMT)) == 0)
+ if ((mode = (dp->di_mode & IFMT)) == 0)
return;
if ((mode != IFDIR && mode != IFREG && mode != IFLNK) ||
return;
if ((mode != IFDIR && mode != IFREG && mode != IFLNK) ||
writeheader(ino);
return;
}
writeheader(ino);
return;
}
- if (ip->di_size > NDADDR * sblock->fs_bsize)
+ if (dp->di_size > NDADDR * sblock->fs_bsize)
cnt = NDADDR * sblock->fs_frag;
else
cnt = NDADDR * sblock->fs_frag;
else
- cnt = howmany(ip->di_size, sblock->fs_fsize);
- blksout(&ip->di_db[0], cnt, ino);
- if ((size = ip->di_size - NDADDR * sblock->fs_bsize) <= 0)
+ cnt = howmany(dp->di_size, sblock->fs_fsize);
+ blksout(&dp->di_db[0], cnt, ino);
+ if ((size = dp->di_size - NDADDR * sblock->fs_bsize) <= 0)
return;
for (level = 0; level < NIADDR; level++) {
return;
for (level = 0; level < NIADDR; level++) {
- dmpindir(ino, ip->di_ib[level], level, &size);
+ dmpindir(ino, dp->di_ib[level], level, &size);