minix/boot/rawfs.h

52 lines
1.6 KiB
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/* rawfs.h - Raw Minix file system support. Author: Kees J. Bot
*
* off_t r_super(int *block_size);
* Initialize variables, returns the size of a valid Minix
* file system blocks, but zero on error.
*
* void r_stat(ino_t file, struct stat *stp);
* Return information about a file like stat(2) and
* remembers file for the next two calls.
*
* off_t r_vir2abs(off_t virblockno);
* Translate virtual block number in file to absolute
* disk block number. Returns 0 if the file contains
* a hole, or -1 if the block lies past the end of file.
*
* ino_t r_readdir(char *name);
* Return next directory entry or 0 if there are no more.
* Returns -1 and sets errno on error.
*
2010-03-27 15:31:00 +01:00
* ino_t r_lookup(ino_t cwd, const char *path);
2005-04-21 16:53:53 +02:00
* A utility function that translates a pathname to an
* inode number. It starts from directory "cwd" unless
* path starts with a '/', then from ROOT_INO.
* Returns 0 and sets errno on error.
*
* One function needs to be provided by the outside world:
*
* void readblock(off_t blockno, char *buf, int block_size);
* Read a block into the buffer. Outside world handles
* errors.
*/
2010-02-17 21:30:29 +01:00
#ifndef INC_RAWFS_H
#define INC_RAWFS_H
#include <minix/dirent.h>
#include <servers/mfs/mfsdir.h>
2005-04-21 16:53:53 +02:00
#define ROOT_INO ((ino_t) 1) /* Inode nr of root dir. */
2010-02-17 21:30:29 +01:00
extern off_t r_super(int *);
extern void r_stat(Ino_t file, struct stat *stp);
extern off_t r_vir2abs(off_t virblockno);
extern ino_t r_readdir(char *name);
2010-03-27 15:31:00 +01:00
extern ino_t r_lookup(Ino_t cwd, const char *path);
2005-04-21 16:53:53 +02:00
/*
* $PchId: rawfs.h,v 1.4 1996/04/19 08:16:36 philip Exp $
*/
2010-02-17 21:30:29 +01:00
#endif