minix/include/minix/vtreefs.h
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00

57 lines
2 KiB
C

#ifndef _MINIX_VTREEFS_H
#define _MINIX_VTREEFS_H
struct inode;
typedef int index_t;
typedef void *cbdata_t;
#define NO_INDEX ((index_t) -1)
/* Maximum file name length, excluding terminating null character. It is set
* to a low value to limit memory usage, but can be changed to any value.
*/
#define PNAME_MAX 24
struct inode_stat {
mode_t mode; /* file mode (type and permissions) */
uid_t uid; /* user ID */
gid_t gid; /* group ID */
off_t size; /* file size */
dev_t dev; /* device number (for char/block type files) */
};
struct fs_hooks {
void (*init_hook)(void);
void (*cleanup_hook)(void);
int (*lookup_hook)(struct inode *inode, char *name, cbdata_t cbdata);
int (*getdents_hook)(struct inode *inode, cbdata_t cbdata);
int (*read_hook)(struct inode *inode, off_t offset, char **ptr,
size_t *len, cbdata_t cbdata);
int (*rdlink_hook)(struct inode *inode, char *ptr, size_t max,
cbdata_t cbdata);
int (*message_hook)(message *m);
};
extern struct inode *add_inode(struct inode *parent, char *name, index_t index,
struct inode_stat *stat, index_t nr_indexed_entries, cbdata_t cbdata);
extern void delete_inode(struct inode *inode);
extern struct inode *get_inode_by_name(struct inode *parent, char *name);
extern struct inode *get_inode_by_index(struct inode *parent, index_t index);
extern char const *get_inode_name(struct inode *inode);
extern index_t get_inode_index(struct inode *inode);
extern cbdata_t get_inode_cbdata(struct inode *inode);
extern struct inode *get_root_inode(void);
extern struct inode *get_parent_inode(struct inode *inode);
extern struct inode *get_first_inode(struct inode *parent);
extern struct inode *get_next_inode(struct inode *previous);
extern void get_inode_stat(struct inode *inode, struct inode_stat *stat);
extern void set_inode_stat(struct inode *inode, struct inode_stat *stat);
extern void start_vtreefs(struct fs_hooks *hooks, unsigned int nr_inodes,
struct inode_stat *stat, index_t nr_indexed_entries);
#endif /* _MINIX_VTREEFS_H */