-dev_t lastdev;
-ino_t lastino;
-
-struct dinode ino;
-struct fs fs;
-off_t offset;
-int device_fd;
-
-int *sindir, *dindir, *tindir;
-int sindirblk, dindirblk, tindirblk;
-
-read_raw_file (fd, buf, len)
- int fd;
- char *buf;
- int len;
-{
- struct stat st;
- off_t ntoread;
- int log_blkno, phys_blkno;
-
- fstat (fd, &st);
- if (st.st_dev != lastdev)
- new_device (st.st_dev);
-
- if (st.st_ino != lastino)
- new_inode (st.st_ino);
-
- /* Only read single blocks at a time */
- if (len > fs.fs_bsize)
- len = fs.fs_bsize;
-
- /* Prune to the length of the file */
- if (offset + len > ino.di_size)
- len = ino.di_size - offset;
-
- log_blkno = lblkno (&fs, blkno);
-