In preparation for converting to libufs to read the superblock,
change conflicting function names: getino => getinode bread => blkread No functional change.
This commit is contained in:
parent
e3e70e1e67
commit
a770ae06ed
@ -108,7 +108,7 @@ int mapfiles(ino_t maxino, long *tapesize);
|
|||||||
int mapdirs(ino_t maxino, long *tapesize);
|
int mapdirs(ino_t maxino, long *tapesize);
|
||||||
|
|
||||||
/* file dumping routines */
|
/* file dumping routines */
|
||||||
void bread(ufs2_daddr_t blkno, char *buf, int size);
|
void blkread(ufs2_daddr_t blkno, char *buf, int size);
|
||||||
ssize_t cread(int fd, void *buf, size_t nbytes, off_t offset);
|
ssize_t cread(int fd, void *buf, size_t nbytes, off_t offset);
|
||||||
void dumpino(union dinode *dp, ino_t ino);
|
void dumpino(union dinode *dp, ino_t ino);
|
||||||
void dumpmap(char *map, int type, ino_t ino);
|
void dumpmap(char *map, int type, ino_t ino);
|
||||||
@ -127,7 +127,7 @@ void dumpabort(int signo) __dead2;
|
|||||||
void dump_getfstab(void);
|
void dump_getfstab(void);
|
||||||
|
|
||||||
char *rawname(char *cp);
|
char *rawname(char *cp);
|
||||||
union dinode *getino(ino_t inum, int *mode);
|
union dinode *getinode(ino_t inum, int *mode);
|
||||||
|
|
||||||
/* rdump routines */
|
/* rdump routines */
|
||||||
#ifdef RDUMP
|
#ifdef RDUMP
|
||||||
|
@ -439,8 +439,8 @@ main(int argc, char *argv[])
|
|||||||
sync();
|
sync();
|
||||||
sblock = (struct fs *)sblock_buf;
|
sblock = (struct fs *)sblock_buf;
|
||||||
for (i = 0; sblock_try[i] != -1; i++) {
|
for (i = 0; sblock_try[i] != -1; i++) {
|
||||||
sblock->fs_fsize = SBLOCKSIZE; /* needed in bread */
|
sblock->fs_fsize = SBLOCKSIZE; /* needed in blkread */
|
||||||
bread(sblock_try[i] >> dev_bshift, (char *) sblock, SBLOCKSIZE);
|
blkread(sblock_try[i]>>dev_bshift, (char *) sblock, SBLOCKSIZE);
|
||||||
if ((sblock->fs_magic == FS_UFS1_MAGIC ||
|
if ((sblock->fs_magic == FS_UFS1_MAGIC ||
|
||||||
(sblock->fs_magic == FS_UFS2_MAGIC &&
|
(sblock->fs_magic == FS_UFS2_MAGIC &&
|
||||||
sblock->fs_sblockloc == sblock_try[i])) &&
|
sblock->fs_sblockloc == sblock_try[i])) &&
|
||||||
@ -556,7 +556,7 @@ main(int argc, char *argv[])
|
|||||||
/*
|
/*
|
||||||
* Skip directory inodes deleted and maybe reallocated
|
* Skip directory inodes deleted and maybe reallocated
|
||||||
*/
|
*/
|
||||||
dp = getino(ino, &mode);
|
dp = getinode(ino, &mode);
|
||||||
if (mode != IFDIR)
|
if (mode != IFDIR)
|
||||||
continue;
|
continue;
|
||||||
(void)dumpino(dp, ino);
|
(void)dumpino(dp, ino);
|
||||||
@ -575,7 +575,7 @@ main(int argc, char *argv[])
|
|||||||
/*
|
/*
|
||||||
* Skip inodes deleted and reallocated as directories.
|
* Skip inodes deleted and reallocated as directories.
|
||||||
*/
|
*/
|
||||||
dp = getino(ino, &mode);
|
dp = getinode(ino, &mode);
|
||||||
if (mode == IFDIR)
|
if (mode == IFDIR)
|
||||||
continue;
|
continue;
|
||||||
(void)dumpino(dp, ino);
|
(void)dumpino(dp, ino);
|
||||||
|
@ -786,7 +786,7 @@ doslave(int cmd, int slave_number)
|
|||||||
for (trecno = 0; trecno < ntrec;
|
for (trecno = 0; trecno < ntrec;
|
||||||
trecno += p->count, p += p->count) {
|
trecno += p->count, p += p->count) {
|
||||||
if (p->dblk) {
|
if (p->dblk) {
|
||||||
bread(p->dblk, slp->tblock[trecno],
|
blkread(p->dblk, slp->tblock[trecno],
|
||||||
p->count * TP_BSIZE);
|
p->count * TP_BSIZE);
|
||||||
} else {
|
} else {
|
||||||
if (p->count != 1 || atomic(read, cmd,
|
if (p->count != 1 || atomic(read, cmd,
|
||||||
|
@ -162,7 +162,7 @@ mapfiles(ino_t maxino, long *tapesize)
|
|||||||
quit("mapfiles: cannot allocate memory.\n");
|
quit("mapfiles: cannot allocate memory.\n");
|
||||||
for (cg = 0; cg < sblock->fs_ncg; cg++) {
|
for (cg = 0; cg < sblock->fs_ncg; cg++) {
|
||||||
ino = cg * sblock->fs_ipg;
|
ino = cg * sblock->fs_ipg;
|
||||||
bread(fsbtodb(sblock, cgtod(sblock, cg)), (char *)cgp,
|
blkread(fsbtodb(sblock, cgtod(sblock, cg)), (char *)cgp,
|
||||||
sblock->fs_cgsize);
|
sblock->fs_cgsize);
|
||||||
if (sblock->fs_magic == FS_UFS2_MAGIC)
|
if (sblock->fs_magic == FS_UFS2_MAGIC)
|
||||||
inosused = cgp->cg_initediblk;
|
inosused = cgp->cg_initediblk;
|
||||||
@ -194,7 +194,7 @@ mapfiles(ino_t maxino, long *tapesize)
|
|||||||
}
|
}
|
||||||
for (i = 0; i < inosused; i++, ino++) {
|
for (i = 0; i < inosused; i++, ino++) {
|
||||||
if (ino < UFS_ROOTINO ||
|
if (ino < UFS_ROOTINO ||
|
||||||
(dp = getino(ino, &mode)) == NULL ||
|
(dp = getinode(ino, &mode)) == NULL ||
|
||||||
(mode & IFMT) == 0)
|
(mode & IFMT) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (ino >= maxino) {
|
if (ino >= maxino) {
|
||||||
@ -276,7 +276,7 @@ mapdirs(ino_t maxino, long *tapesize)
|
|||||||
nodump = !nonodump && (TSTINO(ino, usedinomap) == 0);
|
nodump = !nonodump && (TSTINO(ino, usedinomap) == 0);
|
||||||
if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump))
|
if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump))
|
||||||
continue;
|
continue;
|
||||||
dp = getino(ino, &i);
|
dp = getinode(ino, &i);
|
||||||
/*
|
/*
|
||||||
* inode buf may change in searchdir().
|
* inode buf may change in searchdir().
|
||||||
*/
|
*/
|
||||||
@ -342,7 +342,7 @@ dirindir(
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
bread(fsbtodb(sblock, blkno), (char *)&idblk, (int)sblock->fs_bsize);
|
blkread(fsbtodb(sblock, blkno), (char *)&idblk, (int)sblock->fs_bsize);
|
||||||
if (ind_level <= 0) {
|
if (ind_level <= 0) {
|
||||||
for (i = 0; *filesize > 0 && i < NINDIR(sblock); i++) {
|
for (i = 0; *filesize > 0 && i < NINDIR(sblock); i++) {
|
||||||
if (sblock->fs_magic == FS_UFS1_MAGIC)
|
if (sblock->fs_magic == FS_UFS1_MAGIC)
|
||||||
@ -395,7 +395,7 @@ searchdir(
|
|||||||
|
|
||||||
if (dblk == NULL && (dblk = malloc(sblock->fs_bsize)) == NULL)
|
if (dblk == NULL && (dblk = malloc(sblock->fs_bsize)) == NULL)
|
||||||
quit("searchdir: cannot allocate indirect memory.\n");
|
quit("searchdir: cannot allocate indirect memory.\n");
|
||||||
bread(fsbtodb(sblock, blkno), dblk, (int)size);
|
blkread(fsbtodb(sblock, blkno), dblk, (int)size);
|
||||||
if (filesize < size)
|
if (filesize < size)
|
||||||
size = filesize;
|
size = filesize;
|
||||||
for (loc = 0; loc < size; ) {
|
for (loc = 0; loc < size; ) {
|
||||||
@ -420,7 +420,7 @@ searchdir(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (nodump) {
|
if (nodump) {
|
||||||
ip = getino(dp->d_ino, &mode);
|
ip = getinode(dp->d_ino, &mode);
|
||||||
if (TSTINO(dp->d_ino, dumpinomap)) {
|
if (TSTINO(dp->d_ino, dumpinomap)) {
|
||||||
CLRINO(dp->d_ino, dumpinomap);
|
CLRINO(dp->d_ino, dumpinomap);
|
||||||
*tapesize -= blockest(ip);
|
*tapesize -= blockest(ip);
|
||||||
@ -591,7 +591,7 @@ dmpindir(union dinode *dp, ino_t ino, ufs2_daddr_t blk, int ind_level,
|
|||||||
int i, cnt, last;
|
int i, cnt, last;
|
||||||
|
|
||||||
if (blk != 0)
|
if (blk != 0)
|
||||||
bread(fsbtodb(sblock, blk), (char *)&idblk,
|
blkread(fsbtodb(sblock, blk), (char *)&idblk,
|
||||||
(int)sblock->fs_bsize);
|
(int)sblock->fs_bsize);
|
||||||
else
|
else
|
||||||
memset(&idblk, 0, sblock->fs_bsize);
|
memset(&idblk, 0, sblock->fs_bsize);
|
||||||
@ -871,7 +871,7 @@ writeheader(ino_t ino)
|
|||||||
}
|
}
|
||||||
|
|
||||||
union dinode *
|
union dinode *
|
||||||
getino(ino_t inum, int *modep)
|
getinode(ino_t inum, int *modep)
|
||||||
{
|
{
|
||||||
static ino_t minino, maxino;
|
static ino_t minino, maxino;
|
||||||
static caddr_t inoblock;
|
static caddr_t inoblock;
|
||||||
@ -883,7 +883,7 @@ getino(ino_t inum, int *modep)
|
|||||||
curino = inum;
|
curino = inum;
|
||||||
if (inum >= minino && inum < maxino)
|
if (inum >= minino && inum < maxino)
|
||||||
goto gotit;
|
goto gotit;
|
||||||
bread(fsbtodb(sblock, ino_to_fsba(sblock, inum)), inoblock,
|
blkread(fsbtodb(sblock, ino_to_fsba(sblock, inum)), inoblock,
|
||||||
(int)sblock->fs_bsize);
|
(int)sblock->fs_bsize);
|
||||||
minino = inum - (inum % INOPB(sblock));
|
minino = inum - (inum % INOPB(sblock));
|
||||||
maxino = minino + INOPB(sblock);
|
maxino = minino + INOPB(sblock);
|
||||||
@ -908,7 +908,7 @@ int breaderrors = 0;
|
|||||||
#define BREADEMAX 32
|
#define BREADEMAX 32
|
||||||
|
|
||||||
void
|
void
|
||||||
bread(ufs2_daddr_t blkno, char *buf, int size)
|
blkread(ufs2_daddr_t blkno, char *buf, int size)
|
||||||
{
|
{
|
||||||
int secsize, bytes, resid, xfer, base, cnt, i;
|
int secsize, bytes, resid, xfer, base, cnt, i;
|
||||||
static char *tmpbuf;
|
static char *tmpbuf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user