0500 /* rawfs.h - Raw Minix
file system support. Author:
Kees J. Bot
0501 *
0502 *
off_t r_super(void);
0503 *
Initialize variables, returns the size of a valid Minix
0504 *
file system blocks, but zero on error.
0505 *
0506 *
void r_stat(ino_t file, struct stat *stp);
0507 *
Return information about a file like stat(2) and
0508 *
remembers file for the next two calls.
0509 *
0510 *
off_t r_vir2abs(off_t virblockno);
0511 *
Translate virtual block number in file to absolute
0512 *
disk block number. Returns 0 if the file contains
0513 *
a hole, or -1 if the block lies past the end of file.
0514 *
0515 *
ino_t r_readdir(char *name);
0516 *
Return next directory entry or 0 if there are no more.
0517 *
Returns -1 and sets errno on error.
0518 *
0519 *
ino_t r_lookup(ino_t cwd, char *path);
0520 *
A utility function that translates a pathname to an
0521 *
inode number. It starts from directory "cwd" unless
0522 *
path starts with a '/', then from ROOT_INO.
0523 *
Returns 0 and sets errno on error.
0524 *
0525 * One function
needs to be provided by the outside world:
0526 *
0527 *
void readblock(off_t blockno, char *buf);
0528 *
Read a block into the buffer. Outside world handles
0529 *
errors.
0530 */
0531
0532 #define ROOT_INO
((ino_t) 1) /* Inode nr of root dir. */
0533
0534 off_t r_super(void);
0535 void r_stat(Ino_t file, struct stat *stp);
0536 off_t r_vir2abs(off_t virblockno);
0537 ino_t r_readdir(char *name);
0538 ino_t r_lookup(Ino_t cwd, char *path);