minix/lib/libvtreefs/proto.h
Thomas Veerman a9d0ffbd0d Define protocol version of {mode,ino,uid,gid}_t
The next commit will make mode_t 32-bits, ino_t 64-bits, nlink_t
32-bits, and off_t 64-bits. However, in the protocol there is no
room for that.

When analyzing the usage of these data types we can see that of
mode_t we currently use 15 bits and that future flags (if copied
from NetBSD) are only of importance to VFS and not to the actual
file system on disk. Therefore we can get away with keeping the
protocol version of mode_t (pmode_t) 16 bits.

At this point it is unlikely that MINIX will support file systems
that can hold more than 2^32 files. Keeping the protocol version of
ino_t (pino_t) 32-bits and exposing it as 64-bits to the rest of the
system is fine.

uid_t and gid_t are already 32-bits, but in behind the scenes they're
16-bits. This is sufficient since we don't support uid/gids larger
than 2^16-1.

off_t will become 64-bits, but the protocol had room reserved
for that since it was revised years ago.

So to make the difference clear between what the protocol supports
and what is exposed to the system, we define protocol version of
these data types.

Change-Id: Ifb883aafb222142e69d6dcc3049a47170b78b3ee
2013-03-28 19:39:21 +00:00

43 lines
839 B
C

#ifndef _VTREEFS_PROTO_H
#define _VTREEFS_PROTO_H
/* inode.c */
void init_inodes(unsigned int inodes, struct inode_stat *stat, index_t
nr_indexed_entries);
void cleanup_inodes(void);
struct inode *find_inode(pino_t num);
struct inode *get_inode(pino_t num);
void put_inode(struct inode *node);
void ref_inode(struct inode *node);
int get_inode_number(struct inode *node);
int is_inode_deleted(struct inode *node);
int fs_putnode(void);
/* link.c */
int fs_rdlink(void);
/* mount.c */
int fs_readsuper(void);
int fs_unmount(void);
/* path.c */
int fs_lookup(void);
/* read.c */
int fs_read(void);
int fs_getdents(void);
/* sdbm.c */
long sdbm_hash(char *str, int len);
/* stadir.c */
int fs_stat(void);
int fs_fstatfs(void);
int fs_statvfs(void);
/* utility.c */
int no_sys(void);
int do_noop(void);
#endif /* _VTREEFS_PROTO_H */