add -lminixfs with fs support routines

. move cache size heuristic from mfs there
	  so mfs and ext2 can share it
	. add vfs credentials retrieving function, with
	  backwards compatability from previous struct
	  format, to be used by both ext2 and mfs
	. fix for ext2 - STATICINIT was fed no.
	  of bytes instead of no. of elements, overallocating
	  memory by a megabyte or two for the superblock
This commit is contained in:
Ben Gras
2011-09-08 16:49:54 +00:00
parent ce1a2793f9
commit 4857d5d554
19 changed files with 202 additions and 91 deletions

View File

@@ -18,7 +18,7 @@ INCS+= minix/acpi.h minix/ansi.h minix/audio_fw.h minix/bitmap.h \
minix/sound.h minix/spin.h minix/sys_config.h minix/sysinfo.h \
minix/syslib.h minix/sysutil.h minix/timers.h minix/type.h \
minix/tty.h minix/u64.h minix/usb.h minix/usb_ch9.h minix/vm.h \
minix/vfsif.h minix/vtreefs.h
minix/vfsif.h minix/vtreefs.h minix/libminixfs.h
INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \

View File

@@ -0,0 +1,16 @@
/* Prototypes for -lminixfs. */
#ifndef _MINIX_FSLIB_H
#define _MINIX_FSLIB_H
#include <minix/safecopies.h>
#include <minix/sef.h>
#include <minix/vfsif.h>
int fs_lookup_credentials(vfs_ucred_t *credentials,
uid_t *caller_uid, gid_t *caller_gid, cp_grant_id_t grant2, size_t cred_size);
u32_t fs_bufs_heuristic(int minbufs, u32_t btotal, u32_t bfree,
int blocksize, dev_t majordev);
#endif /* _MINIX_FSLIB_H */

View File

@@ -82,6 +82,16 @@ typedef struct {
gid_t vu_sgroups[NGROUPS_MAX];
} vfs_ucred_t;
#define NGROUPS_MAX_OLD 8
/* User credential structure before increasing
* uid_t and gid_t u8_t */
typedef struct {
short vu_uid;
char vu_gid;
int vu_ngroups;
char vu_sgroups[NGROUPS_MAX_OLD];
} vfs_ucred_old_t;
/* Request numbers */
#define REQ_GETNODE (VFS_BASE + 1) /* Should be removed */
#define REQ_PUTNODE (VFS_BASE + 2)