eaf126a437e1c80d5432621849e9678f8002f6b6
* Copyright (c) 1982, 1988 The Regents of the University of California.
* %sccs.include.proprietary.c%
* @(#)bmap.c 7.4 (Berkeley) %G%
#include <stand.att/saio.h>
static char b
[NBUFS
][MAXBSIZE
];
static daddr_t blknos
[NBUFS
];
register struct dinode
*ip
;
/* The first NDADDR blocks are direct blocks. */
/* Determine the number of levels of indirection. */
for (j
= NIADDR
; j
> 0; j
--) {
printf("bn ovf %ld\n", bn
);
/* Get the first indirect block address. */
nb
= ip
->di_ib
[NIADDR
- j
];
printf("bn void %ld\n",bn
);
/* Get the indirect blocks. */
for (; j
<= NIADDR
; j
++) {
io
->i_bn
= fsbtodb(&io
->i_fs
, nb
) + io
->i_boff
;
io
->i_cc
= io
->i_fs
.fs_bsize
;
if (devread(io
) != io
->i_fs
.fs_bsize
) {
printf("bn %ld: read error\n", io
->i_bn
);
i
= (bn
/ sh
) % NINDIR(&io
->i_fs
);
printf("bn void %ld\n",bn
);