Remove the types Dev_t, _mnx_Gui, _mnx_Uid, and similar.
Use ANSI-style function declarations where necessary.
This commit is contained in:
@@ -10,7 +10,7 @@ FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t, cp_grant_id_t *,
|
||||
FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *,
|
||||
int));
|
||||
FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op,
|
||||
Dev_t dev, int proc_e, int flags));
|
||||
dev_t dev, int proc_e, int flags));
|
||||
FORWARD _PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr));
|
||||
|
||||
|
||||
@@ -136,11 +136,12 @@ int gids_size;
|
||||
/*===========================================================================*
|
||||
* dev_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_open(driver_e, dev, proc, flags)
|
||||
endpoint_t driver_e;
|
||||
dev_t dev; /* device to open */
|
||||
int proc; /* process to open for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int dev_open(
|
||||
endpoint_t driver_e,
|
||||
dev_t dev, /* device to open */
|
||||
int proc, /* process to open for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
int major, r;
|
||||
|
||||
@@ -159,14 +160,15 @@ int flags; /* mode bits and flags */
|
||||
/*===========================================================================*
|
||||
* block_dev_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int block_dev_io(op, dev, proc_e, buf, pos, bytes, flags)
|
||||
int op; /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */
|
||||
dev_t dev; /* major-minor device number */
|
||||
int proc_e; /* in whose address space is buf? */
|
||||
void *buf; /* virtual address of the buffer */
|
||||
u64_t pos; /* byte position */
|
||||
int bytes; /* how many bytes to transfer */
|
||||
int flags; /* special flags, like O_NONBLOCK */
|
||||
PUBLIC int block_dev_io(
|
||||
int op, /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */
|
||||
dev_t dev, /* major-minor device number */
|
||||
int proc_e, /* in whose address space is buf? */
|
||||
void *buf, /* virtual address of the buffer */
|
||||
u64_t pos, /* byte position */
|
||||
int bytes, /* how many bytes to transfer */
|
||||
int flags /* special flags, like O_NONBLOCK */
|
||||
)
|
||||
{
|
||||
/* Read or write from a device. The parameter 'dev' tells which one. */
|
||||
int r, safe;
|
||||
@@ -258,12 +260,13 @@ int flags; /* special flags, like O_NONBLOCK */
|
||||
/*===========================================================================*
|
||||
* gen_opcl *
|
||||
*===========================================================================*/
|
||||
PRIVATE int gen_opcl(driver_e, op, dev, proc_e, flags)
|
||||
endpoint_t driver_e;
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc_e; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PRIVATE int gen_opcl(
|
||||
endpoint_t driver_e,
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
int proc_e, /* process to open/close for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* Called from the dmap struct in table.c on opens & closes of special files.*/
|
||||
message dev_mess;
|
||||
|
||||
@@ -14,9 +14,9 @@ _PROTOTYPE(struct buf *get_block,(block_t block));
|
||||
_PROTOTYPE(void put_block,(struct buf *bp));
|
||||
|
||||
/* device.c */
|
||||
_PROTOTYPE( int block_dev_io, (int op, Dev_t dev, int proc, void *buf,
|
||||
_PROTOTYPE( int block_dev_io, (int op, dev_t dev, int proc, void *buf,
|
||||
u64_t pos, int bytes, int flags) );
|
||||
_PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc,
|
||||
_PROTOTYPE( int dev_open, (endpoint_t driver_e, dev_t dev, int proc,
|
||||
int flags) );
|
||||
_PROTOTYPE( void dev_close, (endpoint_t driver_e, dev_t dev) );
|
||||
_PROTOTYPE( int fs_new_driver, (void) );
|
||||
@@ -66,7 +66,7 @@ _PROTOTYPE( int fs_fstatfs, (void) );
|
||||
|
||||
/* super.c */
|
||||
_PROTOTYPE(int release_v_pri, (struct iso9660_vd_pri *v_pri) );
|
||||
_PROTOTYPE(int read_vds, (struct iso9660_vd_pri *v_pri, Dev_t dev) );
|
||||
_PROTOTYPE(int read_vds, (struct iso9660_vd_pri *v_pri, dev_t dev) );
|
||||
_PROTOTYPE(int create_v_pri, (struct iso9660_vd_pri *v_pri, char *buffer,
|
||||
unsigned long address) );
|
||||
|
||||
|
||||
@@ -79,9 +79,10 @@ PUBLIC int create_v_pri(v_pri,buf,address)
|
||||
|
||||
/* This function reads from a ISO9660 filesystem (in the device dev) the
|
||||
* super block and saves it in v_pri. */
|
||||
PUBLIC int read_vds(v_pri,dev)
|
||||
register struct iso9660_vd_pri *v_pri;
|
||||
register dev_t dev;
|
||||
PUBLIC int read_vds(
|
||||
register struct iso9660_vd_pri *v_pri,
|
||||
register dev_t dev
|
||||
)
|
||||
{
|
||||
u64_t offset;
|
||||
int vol_ok = FALSE;
|
||||
|
||||
@@ -28,10 +28,11 @@ FORWARD _PROTOTYPE( int rw_block, (struct buf *, int) );
|
||||
/*===========================================================================*
|
||||
* get_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *get_block(dev, block, only_search)
|
||||
register dev_t dev; /* on which device is the block? */
|
||||
register block_t block; /* which block is wanted? */
|
||||
int only_search; /* if NO_READ, don't read, else act normal */
|
||||
PUBLIC struct buf *get_block(
|
||||
register dev_t dev, /* on which device is the block? */
|
||||
register block_t block, /* which block is wanted? */
|
||||
int only_search /* if NO_READ, don't read, else act normal */
|
||||
)
|
||||
{
|
||||
/* Check to see if the requested block is in the block cache. If so, return
|
||||
* a pointer to it. If not, evict some other block and fetch it (unless
|
||||
@@ -214,9 +215,10 @@ int block_type; /* INODE_BLOCK, DIRECTORY_BLOCK, or whatever */
|
||||
/*===========================================================================*
|
||||
* alloc_zone *
|
||||
*===========================================================================*/
|
||||
PUBLIC zone_t alloc_zone(dev, z)
|
||||
dev_t dev; /* device where zone wanted */
|
||||
zone_t z; /* try to allocate new zone near this one */
|
||||
PUBLIC zone_t alloc_zone(
|
||||
dev_t dev, /* device where zone wanted */
|
||||
zone_t z /* try to allocate new zone near this one */
|
||||
)
|
||||
{
|
||||
/* Allocate a new zone on the indicated device and return its number. */
|
||||
|
||||
@@ -254,9 +256,10 @@ zone_t z; /* try to allocate new zone near this one */
|
||||
/*===========================================================================*
|
||||
* free_zone *
|
||||
*===========================================================================*/
|
||||
PUBLIC void free_zone(dev, numb)
|
||||
dev_t dev; /* device where zone located */
|
||||
zone_t numb; /* zone to be returned */
|
||||
PUBLIC void free_zone(
|
||||
dev_t dev, /* device where zone located */
|
||||
zone_t numb /* zone to be returned */
|
||||
)
|
||||
{
|
||||
/* Return a zone. */
|
||||
|
||||
@@ -313,8 +316,9 @@ int rw_flag; /* READING or WRITING */
|
||||
/*===========================================================================*
|
||||
* invalidate *
|
||||
*===========================================================================*/
|
||||
PUBLIC void invalidate(device)
|
||||
dev_t device; /* device whose blocks are to be purged */
|
||||
PUBLIC void invalidate(
|
||||
dev_t device /* device whose blocks are to be purged */
|
||||
)
|
||||
{
|
||||
/* Remove all the blocks belonging to some device from the cache. */
|
||||
|
||||
@@ -327,8 +331,9 @@ dev_t device; /* device whose blocks are to be purged */
|
||||
/*===========================================================================*
|
||||
* flushall *
|
||||
*===========================================================================*/
|
||||
PUBLIC void flushall(dev)
|
||||
dev_t dev; /* device to flush */
|
||||
PUBLIC void flushall(
|
||||
dev_t dev /* device to flush */
|
||||
)
|
||||
{
|
||||
/* Flush all dirty blocks for one device. */
|
||||
|
||||
@@ -346,11 +351,12 @@ dev_t dev; /* device to flush */
|
||||
/*===========================================================================*
|
||||
* rw_scattered *
|
||||
*===========================================================================*/
|
||||
PUBLIC void rw_scattered(dev, bufq, bufqsize, rw_flag)
|
||||
dev_t dev; /* major-minor device number */
|
||||
struct buf **bufq; /* pointer to array of buffers */
|
||||
int bufqsize; /* number of buffers */
|
||||
int rw_flag; /* READING or WRITING */
|
||||
PUBLIC void rw_scattered(
|
||||
dev_t dev, /* major-minor device number */
|
||||
struct buf **bufq, /* pointer to array of buffers */
|
||||
int bufqsize, /* number of buffers */
|
||||
int rw_flag /* READING or WRITING */
|
||||
)
|
||||
{
|
||||
/* Read or write scattered data from a device. */
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ FORWARD _PROTOTYPE( int safe_io_conversion, (endpoint_t,
|
||||
FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *,
|
||||
int));
|
||||
FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op,
|
||||
Dev_t dev, int proc_e, int flags) );
|
||||
dev_t dev, int proc_e, int flags) );
|
||||
FORWARD _PROTOTYPE( int gen_io, (endpoint_t task_nr, message *mess_ptr) );
|
||||
|
||||
|
||||
@@ -147,14 +147,15 @@ int gids_size;
|
||||
/*===========================================================================*
|
||||
* block_dev_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int block_dev_io(op, dev, proc_e, buf, pos, bytes, flags)
|
||||
int op; /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */
|
||||
dev_t dev; /* major-minor device number */
|
||||
int proc_e; /* in whose address space is buf? */
|
||||
void *buf; /* virtual address of the buffer */
|
||||
u64_t pos; /* byte position */
|
||||
int bytes; /* how many bytes to transfer */
|
||||
int flags; /* special flags, like O_NONBLOCK */
|
||||
PUBLIC int block_dev_io(
|
||||
int op, /* MFS_DEV_READ, MFS_DEV_WRITE, etc. */
|
||||
dev_t dev, /* major-minor device number */
|
||||
int proc_e, /* in whose address space is buf? */
|
||||
void *buf, /* virtual address of the buffer */
|
||||
u64_t pos, /* byte position */
|
||||
int bytes, /* how many bytes to transfer */
|
||||
int flags /* special flags, like O_NONBLOCK */
|
||||
)
|
||||
{
|
||||
/* Read or write from a device. The parameter 'dev' tells which one. */
|
||||
int r, safe;
|
||||
@@ -253,11 +254,12 @@ int flags; /* special flags, like O_NONBLOCK */
|
||||
/*===========================================================================*
|
||||
* dev_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_open(driver_e, dev, proc, flags)
|
||||
endpoint_t driver_e;
|
||||
dev_t dev; /* device to open */
|
||||
int proc; /* process to open for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int dev_open(
|
||||
endpoint_t driver_e,
|
||||
dev_t dev, /* device to open */
|
||||
int proc, /* process to open for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
int major, r;
|
||||
|
||||
@@ -276,9 +278,10 @@ int flags; /* mode bits and flags */
|
||||
/*===========================================================================*
|
||||
* dev_close *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dev_close(driver_e, dev)
|
||||
endpoint_t driver_e;
|
||||
dev_t dev; /* device to close */
|
||||
PUBLIC void dev_close(
|
||||
endpoint_t driver_e,
|
||||
dev_t dev /* device to close */
|
||||
)
|
||||
{
|
||||
(void) gen_opcl(driver_e, DEV_CLOSE, dev, 0, 0);
|
||||
}
|
||||
@@ -287,12 +290,13 @@ dev_t dev; /* device to close */
|
||||
/*===========================================================================*
|
||||
* gen_opcl *
|
||||
*===========================================================================*/
|
||||
PRIVATE int gen_opcl(driver_e, op, dev, proc_e, flags)
|
||||
endpoint_t driver_e;
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc_e; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PRIVATE int gen_opcl(
|
||||
endpoint_t driver_e,
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
int proc_e, /* process to open/close for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* Called from the dmap struct in table.c on opens & closes of special files.*/
|
||||
message dev_mess;
|
||||
|
||||
@@ -33,7 +33,7 @@ FORWARD _PROTOTYPE( int unhash_inode, (struct inode *node) );
|
||||
/*===========================================================================*
|
||||
* fs_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_putnode()
|
||||
PUBLIC int fs_putnode(void)
|
||||
{
|
||||
/* Find the inode specified by the request message and decrease its counter.*/
|
||||
|
||||
@@ -121,9 +121,10 @@ PRIVATE int unhash_inode(struct inode *node)
|
||||
/*===========================================================================*
|
||||
* get_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *get_inode(dev, numb)
|
||||
dev_t dev; /* device on which inode resides */
|
||||
int numb; /* inode number (ANSI: may not be unshort) */
|
||||
PUBLIC struct inode *get_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
int numb /* inode number (ANSI: may not be unshort) */
|
||||
)
|
||||
{
|
||||
/* Find the inode in the hash table. If it is not there, get a free inode
|
||||
* load it from the disk if it's necessary and put on the hash list
|
||||
@@ -181,9 +182,10 @@ int numb; /* inode number (ANSI: may not be unshort) */
|
||||
/*===========================================================================*
|
||||
* find_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *find_inode(dev, numb)
|
||||
dev_t dev; /* device on which inode resides */
|
||||
int numb; /* inode number (ANSI: may not be unshort) */
|
||||
PUBLIC struct inode *find_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
int numb /* inode number (ANSI: may not be unshort) */
|
||||
)
|
||||
{
|
||||
/* Find the inode specified by the inode and device number.
|
||||
*/
|
||||
@@ -323,9 +325,10 @@ register struct inode *rip; /* the inode to be erased */
|
||||
/*===========================================================================*
|
||||
* free_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void free_inode(dev, inumb)
|
||||
dev_t dev; /* on which device is the inode */
|
||||
ino_t inumb; /* number of inode to be freed */
|
||||
PUBLIC void free_inode(
|
||||
dev_t dev, /* on which device is the inode? */
|
||||
ino_t inumb /* number of the inode to be freed */
|
||||
)
|
||||
{
|
||||
/* Return an inode to the pool of unallocated inodes. */
|
||||
|
||||
|
||||
@@ -8,35 +8,35 @@ struct super_block;
|
||||
|
||||
|
||||
/* cache.c */
|
||||
_PROTOTYPE( zone_t alloc_zone, (Dev_t dev, zone_t z) );
|
||||
_PROTOTYPE( zone_t alloc_zone, (dev_t dev, zone_t z) );
|
||||
_PROTOTYPE( void buf_pool, (void) );
|
||||
_PROTOTYPE( void flushall, (Dev_t dev) );
|
||||
_PROTOTYPE( void free_zone, (Dev_t dev, zone_t numb) );
|
||||
_PROTOTYPE( struct buf *get_block, (Dev_t dev, block_t block,int only_search));
|
||||
_PROTOTYPE( void invalidate, (Dev_t device) );
|
||||
_PROTOTYPE( void flushall, (dev_t dev) );
|
||||
_PROTOTYPE( void free_zone, (dev_t dev, zone_t numb) );
|
||||
_PROTOTYPE( struct buf *get_block, (dev_t dev, block_t block,int only_search));
|
||||
_PROTOTYPE( void invalidate, (dev_t device) );
|
||||
_PROTOTYPE( void put_block, (struct buf *bp, int block_type) );
|
||||
_PROTOTYPE( void set_blocksize, (int blocksize) );
|
||||
_PROTOTYPE( void rw_scattered, (Dev_t dev,
|
||||
_PROTOTYPE( void rw_scattered, (dev_t dev,
|
||||
struct buf **bufq, int bufqsize, int rw_flag) );
|
||||
|
||||
/* device.c */
|
||||
_PROTOTYPE( int block_dev_io, (int op, Dev_t dev, int proc, void *buf,
|
||||
_PROTOTYPE( int block_dev_io, (int op, dev_t dev, int proc, void *buf,
|
||||
u64_t pos, int bytes, int flags) );
|
||||
_PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc,
|
||||
_PROTOTYPE( int dev_open, (endpoint_t driver_e, dev_t dev, int proc,
|
||||
int flags) );
|
||||
_PROTOTYPE( void dev_close, (endpoint_t driver_e, Dev_t dev) );
|
||||
_PROTOTYPE( void dev_close, (endpoint_t driver_e, dev_t dev) );
|
||||
_PROTOTYPE( int fs_clone_opcl, (void) );
|
||||
_PROTOTYPE( int fs_new_driver, (void) );
|
||||
|
||||
/* inode.c */
|
||||
_PROTOTYPE( struct inode *alloc_inode, (dev_t dev, mode_t bits) );
|
||||
_PROTOTYPE( void dup_inode, (struct inode *ip) );
|
||||
_PROTOTYPE( struct inode *find_inode, (Dev_t dev, int numb) );
|
||||
_PROTOTYPE( void free_inode, (Dev_t dev, Ino_t numb) );
|
||||
_PROTOTYPE( struct inode *find_inode, (dev_t dev, int numb) );
|
||||
_PROTOTYPE( void free_inode, (dev_t dev, Ino_t numb) );
|
||||
_PROTOTYPE( int fs_getnode, (void) );
|
||||
_PROTOTYPE( int fs_putnode, (void) );
|
||||
_PROTOTYPE( void init_inode_cache, (void) );
|
||||
_PROTOTYPE( struct inode *get_inode, (Dev_t dev, int numb) );
|
||||
_PROTOTYPE( struct inode *get_inode, (dev_t dev, int numb) );
|
||||
_PROTOTYPE( void put_inode, (struct inode *rip) );
|
||||
_PROTOTYPE( void update_times, (struct inode *rip) );
|
||||
_PROTOTYPE( void rw_inode, (struct inode *rip, int rw_flag) );
|
||||
@@ -104,7 +104,7 @@ _PROTOTYPE( bit_t alloc_bit, (struct super_block *sp, int map, bit_t origin));
|
||||
_PROTOTYPE( void free_bit, (struct super_block *sp, int map,
|
||||
bit_t bit_returned) );
|
||||
_PROTOTYPE( int get_block_size, (dev_t dev) );
|
||||
_PROTOTYPE( struct super_block *get_super, (Dev_t dev) );
|
||||
_PROTOTYPE( struct super_block *get_super, (dev_t dev) );
|
||||
_PROTOTYPE( int mounted, (struct inode *rip) );
|
||||
_PROTOTYPE( int read_super, (struct super_block *sp) );
|
||||
|
||||
|
||||
@@ -145,8 +145,9 @@ bit_t bit_returned; /* number of bit to insert into the map */
|
||||
/*===========================================================================*
|
||||
* get_super *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct super_block *get_super(dev)
|
||||
dev_t dev; /* device number whose super_block is sought */
|
||||
PUBLIC struct super_block *get_super(
|
||||
dev_t dev /* device number whose super_block is sought */
|
||||
)
|
||||
{
|
||||
if (dev == NO_DEV)
|
||||
panic("request for super_block of NO_DEV");
|
||||
|
||||
@@ -23,13 +23,10 @@ PUBLIC void buf_pool(void)
|
||||
/*===========================================================================*
|
||||
* get_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *get_block(dev, inum)
|
||||
Dev_t dev;
|
||||
ino_t inum;
|
||||
PUBLIC struct buf *get_block(dev_t dev, ino_t inum)
|
||||
{
|
||||
struct buf *bp;
|
||||
struct buf *bp = front;
|
||||
|
||||
bp = front;
|
||||
while(bp != NIL_BUF) {
|
||||
if (bp->b_dev == dev && bp->b_num == inum) {
|
||||
bp->b_count++;
|
||||
@@ -46,9 +43,7 @@ ino_t inum;
|
||||
/*===========================================================================*
|
||||
* new_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct buf *new_block(dev, inum)
|
||||
Dev_t dev;
|
||||
ino_t inum;
|
||||
PUBLIC struct buf *new_block(dev_t dev, ino_t inum)
|
||||
{
|
||||
/* Allocate a new buffer and add it to the double linked buffer list */
|
||||
struct buf *bp;
|
||||
@@ -82,9 +77,7 @@ ino_t inum;
|
||||
/*===========================================================================*
|
||||
* put_block *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_block(dev, inum)
|
||||
dev_t dev;
|
||||
ino_t inum;
|
||||
PUBLIC void put_block(dev_t dev, ino_t inum)
|
||||
{
|
||||
struct buf *bp;
|
||||
|
||||
|
||||
@@ -120,9 +120,10 @@ PRIVATE int unhash_inode(struct inode *node)
|
||||
/*===========================================================================*
|
||||
* get_inode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct inode *get_inode(dev, numb)
|
||||
dev_t dev; /* device on which inode resides */
|
||||
int numb; /* inode number (ANSI: may not be unshort) */
|
||||
PUBLIC struct inode *get_inode(
|
||||
dev_t dev, /* device on which inode resides */
|
||||
int numb /* inode number (ANSI: may not be unshort) */
|
||||
)
|
||||
{
|
||||
/* Find the inode in the hash table. If it is not there, get a free inode
|
||||
* load it from the disk if it's necessary and put on the hash list
|
||||
|
||||
@@ -6,9 +6,9 @@ struct filp;
|
||||
struct inode;
|
||||
|
||||
/* buffer.c */
|
||||
_PROTOTYPE( struct buf *get_block, (Dev_t dev, ino_t inum) );
|
||||
_PROTOTYPE( struct buf *new_block, (Dev_t dev, ino_t inum) );
|
||||
_PROTOTYPE( void put_block, (Dev_t dev, ino_t inum) );
|
||||
_PROTOTYPE( struct buf *get_block, (dev_t dev, ino_t inum) );
|
||||
_PROTOTYPE( struct buf *new_block, (dev_t dev, ino_t inum) );
|
||||
_PROTOTYPE( void put_block, (dev_t dev, ino_t inum) );
|
||||
|
||||
/* cache.c */
|
||||
_PROTOTYPE( void buf_pool, (void) );
|
||||
@@ -20,7 +20,7 @@ _PROTOTYPE( struct inode *find_inode, (int numb) );
|
||||
_PROTOTYPE( void free_inode, (struct inode *rip) );
|
||||
_PROTOTYPE( int fs_putnode, (void) );
|
||||
_PROTOTYPE( void init_inode_cache, (void) );
|
||||
_PROTOTYPE( struct inode *get_inode, (Dev_t dev, int numb) );
|
||||
_PROTOTYPE( struct inode *get_inode, (dev_t dev, int numb) );
|
||||
_PROTOTYPE( void put_inode, (struct inode *rip) );
|
||||
_PROTOTYPE( void update_times, (struct inode *rip) );
|
||||
_PROTOTYPE( void wipe_inode, (struct inode *rip) );
|
||||
|
||||
@@ -12,7 +12,7 @@ FORWARD _PROTOTYPE( int read_header, (char *exec, size_t exec_len, int *sep_id,
|
||||
FORWARD _PROTOTYPE( int exec_newmem, (int proc_e, vir_bytes text_bytes,
|
||||
vir_bytes data_bytes, vir_bytes bss_bytes, vir_bytes tot_bytes,
|
||||
vir_bytes frame_len, int sep_id,
|
||||
Dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname,
|
||||
dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname,
|
||||
int new_uid, int new_gid,
|
||||
vir_bytes *stack_topp, int *load_textp, int *allow_setuidp) );
|
||||
FORWARD _PROTOTYPE( int exec_restart, (int proc_e, int result) );
|
||||
@@ -203,25 +203,24 @@ fail:
|
||||
/*===========================================================================*
|
||||
* exec_newmem *
|
||||
*===========================================================================*/
|
||||
PRIVATE int exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes,
|
||||
frame_len, sep_id, st_dev, st_ino, st_ctime, progname,
|
||||
new_uid, new_gid, stack_topp, load_textp, allow_setuidp)
|
||||
int proc_e;
|
||||
vir_bytes text_bytes;
|
||||
vir_bytes data_bytes;
|
||||
vir_bytes bss_bytes;
|
||||
vir_bytes tot_bytes;
|
||||
vir_bytes frame_len;
|
||||
int sep_id;
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
time_t st_ctime;
|
||||
int new_uid;
|
||||
int new_gid;
|
||||
char *progname;
|
||||
vir_bytes *stack_topp;
|
||||
int *load_textp;
|
||||
int *allow_setuidp;
|
||||
PRIVATE int exec_newmem(
|
||||
int proc_e,
|
||||
vir_bytes text_bytes,
|
||||
vir_bytes data_bytes,
|
||||
vir_bytes bss_bytes,
|
||||
vir_bytes tot_bytes,
|
||||
vir_bytes frame_len,
|
||||
int sep_id,
|
||||
dev_t st_dev,
|
||||
ino_t st_ino,
|
||||
time_t st_ctime,
|
||||
char *progname,
|
||||
int new_uid,
|
||||
int new_gid,
|
||||
vir_bytes *stack_topp,
|
||||
int *load_textp,
|
||||
int *allow_setuidp
|
||||
)
|
||||
{
|
||||
int r;
|
||||
struct exec_newmem e;
|
||||
|
||||
@@ -49,10 +49,11 @@ PRIVATE int dummyproc;
|
||||
/*===========================================================================*
|
||||
* dev_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_open(dev, proc, flags)
|
||||
dev_t dev; /* device to open */
|
||||
int proc; /* process to open for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int dev_open(
|
||||
dev_t dev, /* device to open */
|
||||
int proc, /* process to open for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
int major, r;
|
||||
struct dmap *dp;
|
||||
@@ -73,10 +74,11 @@ int flags; /* mode bits and flags */
|
||||
/*===========================================================================*
|
||||
* dev_reopen *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_reopen(dev, filp_no, flags)
|
||||
dev_t dev; /* device to open */
|
||||
int filp_no; /* filp to reopen for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int dev_reopen(
|
||||
dev_t dev, /* device to open */
|
||||
int filp_no, /* filp to reopen for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
int major, r;
|
||||
struct dmap *dp;
|
||||
@@ -99,9 +101,10 @@ int flags; /* mode bits and flags */
|
||||
/*===========================================================================*
|
||||
* dev_close *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_close(dev, filp_no)
|
||||
dev_t dev; /* device to close */
|
||||
int filp_no;
|
||||
PUBLIC int dev_close(
|
||||
dev_t dev, /* device to close */
|
||||
int filp_no
|
||||
)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -325,15 +328,16 @@ int gids_size;
|
||||
/*===========================================================================*
|
||||
* dev_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_io(op, dev, proc_e, buf, pos, bytes, flags, suspend_reopen)
|
||||
int op; /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */
|
||||
dev_t dev; /* major-minor device number */
|
||||
int proc_e; /* in whose address space is buf? */
|
||||
void *buf; /* virtual address of the buffer */
|
||||
u64_t pos; /* byte position */
|
||||
int bytes; /* how many bytes to transfer */
|
||||
int flags; /* special flags, like O_NONBLOCK */
|
||||
int suspend_reopen; /* Just suspend the process */
|
||||
PUBLIC int dev_io(
|
||||
int op, /* DEV_READ, DEV_WRITE, DEV_IOCTL, etc. */
|
||||
dev_t dev, /* major-minor device number */
|
||||
int proc_e, /* in whose address space is buf? */
|
||||
void *buf, /* virtual address of the buffer */
|
||||
u64_t pos, /* byte position */
|
||||
int bytes, /* how many bytes to transfer */
|
||||
int flags, /* special flags, like O_NONBLOCK */
|
||||
int suspend_reopen /* Just suspend the process */
|
||||
)
|
||||
{
|
||||
/* Read or write from a device. The parameter 'dev' tells which one. */
|
||||
struct dmap *dp;
|
||||
@@ -471,11 +475,12 @@ int suspend_reopen; /* Just suspend the process */
|
||||
/*===========================================================================*
|
||||
* gen_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int gen_opcl(op, dev, proc_e, flags)
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc_e; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int gen_opcl(
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
int proc_e, /* process to open/close for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* Called from the dmap struct in table.c on opens & closes of special files.*/
|
||||
int r;
|
||||
@@ -505,11 +510,12 @@ int flags; /* mode bits and flags */
|
||||
/*===========================================================================*
|
||||
* tty_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int tty_opcl(op, dev, proc_e, flags)
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc_e; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int tty_opcl(
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
int proc_e, /* process to open/close for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* This procedure is called from the dmap struct on tty open/close. */
|
||||
|
||||
@@ -543,11 +549,12 @@ int flags; /* mode bits and flags */
|
||||
/*===========================================================================*
|
||||
* ctty_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int ctty_opcl(op, dev, proc_e, flags)
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc_e; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int ctty_opcl(
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
int proc_e, /* process to open/close for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* This procedure is called from the dmap struct in table.c on opening/closing
|
||||
* /dev/tty, the magic device that translates to the controlling tty.
|
||||
@@ -707,11 +714,12 @@ message *mess_ptr; /* pointer to message for task */
|
||||
/*===========================================================================*
|
||||
* no_dev *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_dev(op, dev, proc, flags)
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int no_dev(
|
||||
int UNUSED(op), /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t UNUSED(dev), /* device to open or close */
|
||||
int UNUSED(proc), /* process to open/close for */
|
||||
int UNUSED(flags) /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* Called when opening a nonexistent device. */
|
||||
return(ENODEV);
|
||||
@@ -731,11 +739,12 @@ PUBLIC int no_dev_io(int proc, message *m)
|
||||
/*===========================================================================*
|
||||
* clone_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int clone_opcl(op, dev, proc_e, flags)
|
||||
int op; /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev; /* device to open or close */
|
||||
int proc_e; /* process to open/close for */
|
||||
int flags; /* mode bits and flags */
|
||||
PUBLIC int clone_opcl(
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
int proc_e, /* process to open/close for */
|
||||
int flags /* mode bits and flags */
|
||||
)
|
||||
{
|
||||
/* Some devices need special processing upon open. Such a device is "cloned",
|
||||
* i.e. on a succesful open it is replaced by a new device with a new unique
|
||||
|
||||
@@ -84,7 +84,7 @@ PUBLIC int do_mapdriver()
|
||||
* map_driver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int map_driver(label, major, proc_nr_e, style, flags)
|
||||
char *label; /* name of the driver */
|
||||
const char *label; /* name of the driver */
|
||||
int major; /* major number of the device */
|
||||
endpoint_t proc_nr_e; /* process number of the driver */
|
||||
int style; /* style of the device */
|
||||
|
||||
@@ -13,7 +13,7 @@ dmap.h
|
||||
*/
|
||||
|
||||
extern struct dmap {
|
||||
int _PROTOTYPE ((*dmap_opcl), (int, Dev_t, int, int) );
|
||||
int _PROTOTYPE ((*dmap_opcl), (int, dev_t, int, int) );
|
||||
int _PROTOTYPE ((*dmap_io), (int, message *) );
|
||||
endpoint_t dmap_driver;
|
||||
char dmap_label[LABEL_MAX];
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
FORWARD _PROTOTYPE( int exec_newmem, (int proc_e, vir_bytes text_bytes,
|
||||
vir_bytes data_bytes, vir_bytes bss_bytes, vir_bytes tot_bytes,
|
||||
vir_bytes frame_len, int sep_id,
|
||||
Dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname,
|
||||
dev_t st_dev, ino_t st_ino, time_t st_ctime, char *progname,
|
||||
int new_uid, int new_gid,
|
||||
vir_bytes *stack_topp, int *load_textp, int *allow_setuidp) );
|
||||
FORWARD _PROTOTYPE( int read_header, (struct vnode *vp, int *sep_id,
|
||||
@@ -200,25 +200,24 @@ vir_bytes frame_len;
|
||||
/*===========================================================================*
|
||||
* exec_newmem *
|
||||
*===========================================================================*/
|
||||
PRIVATE int exec_newmem(proc_e, text_bytes, data_bytes, bss_bytes, tot_bytes,
|
||||
frame_len, sep_id, st_dev, st_ino, st_ctime, progname,
|
||||
new_uid, new_gid, stack_topp, load_textp, allow_setuidp)
|
||||
int proc_e;
|
||||
vir_bytes text_bytes;
|
||||
vir_bytes data_bytes;
|
||||
vir_bytes bss_bytes;
|
||||
vir_bytes tot_bytes;
|
||||
vir_bytes frame_len;
|
||||
int sep_id;
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
time_t st_ctime;
|
||||
int new_uid;
|
||||
int new_gid;
|
||||
char *progname;
|
||||
vir_bytes *stack_topp;
|
||||
int *load_textp;
|
||||
int *allow_setuidp;
|
||||
PRIVATE int exec_newmem(
|
||||
int proc_e,
|
||||
vir_bytes text_bytes,
|
||||
vir_bytes data_bytes,
|
||||
vir_bytes bss_bytes,
|
||||
vir_bytes tot_bytes,
|
||||
vir_bytes frame_len,
|
||||
int sep_id,
|
||||
dev_t st_dev,
|
||||
ino_t st_ino,
|
||||
time_t st_ctime,
|
||||
char *progname,
|
||||
int new_uid,
|
||||
int new_gid,
|
||||
vir_bytes *stack_topp,
|
||||
int *load_textp,
|
||||
int *allow_setuidp
|
||||
)
|
||||
{
|
||||
int r;
|
||||
struct exec_newmem e;
|
||||
|
||||
@@ -11,7 +11,7 @@ EXTERN int susp_count; /* number of procs suspended on pipe */
|
||||
EXTERN int nr_locks; /* number of locks currently in place */
|
||||
EXTERN int reviving; /* number of pipe processes to be revived */
|
||||
|
||||
EXTERN Dev_t root_dev; /* device number of the root device */
|
||||
EXTERN dev_t root_dev; /* device number of the root device */
|
||||
EXTERN int ROOT_FS_E; /* kernel endpoint of the root FS proc */
|
||||
EXTERN int last_login_fs_e; /* endpoint of the FS proc that logged in
|
||||
before the corresponding mount request */
|
||||
|
||||
@@ -40,7 +40,7 @@ PRIVATE bitchunk_t nonedev[BITMAP_CHUNKS(NR_NONEDEVS)] = { 0 };
|
||||
|
||||
FORWARD _PROTOTYPE( dev_t name_to_dev, (int allow_mountpt) );
|
||||
FORWARD _PROTOTYPE( int mount_fs, (endpoint_t fs_e) );
|
||||
FORWARD _PROTOTYPE( int is_nonedev, (Dev_t dev) );
|
||||
FORWARD _PROTOTYPE( int is_nonedev, (dev_t dev) );
|
||||
FORWARD _PROTOTYPE( dev_t find_free_nonedev, (void) );
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -400,9 +400,10 @@ PUBLIC int do_umount()
|
||||
/*===========================================================================*
|
||||
* unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int unmount(dev, label)
|
||||
Dev_t dev; /* block-special device */
|
||||
char *label; /* buffer to retrieve label, or NULL */
|
||||
PUBLIC int unmount(
|
||||
dev_t dev, /* block-special device */
|
||||
char *label /* buffer to retrieve label, or NULL */
|
||||
)
|
||||
{
|
||||
struct vnode *vp;
|
||||
struct vmnt *vmp_i = NULL, *vmp = NULL;
|
||||
@@ -519,7 +520,7 @@ int allow_mountpt;
|
||||
/*===========================================================================*
|
||||
* is_nonedev *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_nonedev(int dev)
|
||||
PRIVATE int is_nonedev(dev_t dev)
|
||||
{
|
||||
/* Return whether the given device is a "none" pseudo device.
|
||||
*/
|
||||
|
||||
@@ -11,19 +11,19 @@ struct vmnt;
|
||||
struct vnode;
|
||||
|
||||
/* device.c */
|
||||
_PROTOTYPE( int dev_open, (Dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int dev_reopen, (Dev_t dev, int filp_no, int flags) );
|
||||
_PROTOTYPE( int dev_close, (Dev_t dev, int filp_no) );
|
||||
_PROTOTYPE( int dev_io, (int op, Dev_t dev, int proc, void *buf,
|
||||
_PROTOTYPE( int dev_open, (dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int dev_reopen, (dev_t dev, int filp_no, int flags) );
|
||||
_PROTOTYPE( int dev_close, (dev_t dev, int filp_no) );
|
||||
_PROTOTYPE( int dev_io, (int op, dev_t dev, int proc, void *buf,
|
||||
u64_t pos, int bytes, int flags, int suspend_reopen) );
|
||||
_PROTOTYPE( int gen_opcl, (int op, Dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int gen_opcl, (int op, dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) );
|
||||
_PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) );
|
||||
_PROTOTYPE( int no_dev, (int op, Dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int no_dev, (int op, dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int no_dev_io, (int, message *) );
|
||||
_PROTOTYPE( int tty_opcl, (int op, Dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int ctty_opcl, (int op, Dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int clone_opcl, (int op, Dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int tty_opcl, (int op, dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int ctty_opcl, (int op, dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int clone_opcl, (int op, dev_t dev, int proc, int flags) );
|
||||
_PROTOTYPE( int ctty_io, (int task_nr, message *mess_ptr) );
|
||||
_PROTOTYPE( int do_ioctl, (void) );
|
||||
_PROTOTYPE( void pm_setsid, (int proc_e) );
|
||||
@@ -37,7 +37,7 @@ _PROTOTYPE( void reopen_reply, (void) );
|
||||
_PROTOTYPE( int do_mapdriver, (void) );
|
||||
_PROTOTYPE( int map_service, (struct rprocpub *rpub) );
|
||||
_PROTOTYPE( void build_dmap, (void) );
|
||||
_PROTOTYPE( int map_driver, (char *label, int major, int proc_nr,
|
||||
_PROTOTYPE( int map_driver, (const char *label, int major, endpoint_t proc_nr,
|
||||
int dev_style, int flags) );
|
||||
_PROTOTYPE( int dmap_driver_match, (endpoint_t proc, int major) );
|
||||
_PROTOTYPE( void dmap_unmap_by_endpt, (int proc_nr) );
|
||||
@@ -94,7 +94,7 @@ _PROTOTYPE( void ds_event, (void) );
|
||||
_PROTOTYPE( int do_fslogin, (void) );
|
||||
_PROTOTYPE( int do_mount, (void) );
|
||||
_PROTOTYPE( int do_umount, (void) );
|
||||
_PROTOTYPE( int unmount, (Dev_t dev, char *label) );
|
||||
_PROTOTYPE( int unmount, (dev_t dev, char *label) );
|
||||
|
||||
/* open.c */
|
||||
_PROTOTYPE( int do_close, (void) );
|
||||
@@ -154,16 +154,16 @@ _PROTOTYPE( int rw_pipe, (int rw_flag, endpoint_t usr,
|
||||
|
||||
/* request.c */
|
||||
_PROTOTYPE( int req_breadwrite, (endpoint_t fs_e, endpoint_t user_e,
|
||||
Dev_t dev, u64_t pos, unsigned int num_of_bytes,
|
||||
dev_t dev, u64_t pos, unsigned int num_of_bytes,
|
||||
char *user_addr, int rw_flag,
|
||||
u64_t *new_posp, unsigned int *cum_iop) );
|
||||
_PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, _mnx_Mode_t rmode,
|
||||
_PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, mode_t rmode,
|
||||
mode_t *new_modep) );
|
||||
_PROTOTYPE( int req_chown, (endpoint_t fs_e, ino_t inode_nr,
|
||||
_mnx_Uid_t newuid, _mnx_Gid_t newgid, mode_t *new_modep) );
|
||||
uid_t newuid, gid_t newgid, mode_t *new_modep) );
|
||||
_PROTOTYPE( int req_create, (int fs_e, ino_t inode_nr, int omode,
|
||||
int uid, int gid, char *path, node_details_t *res) );
|
||||
_PROTOTYPE( int req_flush, (endpoint_t fs_e, Dev_t dev) );
|
||||
uid_t uid, gid_t gid, char *path, node_details_t *res) );
|
||||
_PROTOTYPE( int req_flush, (endpoint_t fs_e, dev_t dev) );
|
||||
_PROTOTYPE( int req_fstatfs, (int fs_e, int who_e, char *buf) );
|
||||
_PROTOTYPE( int req_ftrunc, (endpoint_t fs_e, ino_t inode_nr,
|
||||
off_t start, off_t end) );
|
||||
@@ -173,22 +173,22 @@ _PROTOTYPE( int req_inhibread, (endpoint_t fs_e, ino_t inode_nr) );
|
||||
_PROTOTYPE( int req_link, (endpoint_t fs_e, ino_t link_parent,
|
||||
char *lastc, ino_t linked_file) );
|
||||
_PROTOTYPE( int req_lookup, (endpoint_t fs_e, ino_t dir_ino, ino_t root_ino,
|
||||
_mnx_Uid_t uid, _mnx_Gid_t gid, int flags,
|
||||
uid_t uid, gid_t gid, int flags,
|
||||
lookup_res_t *res) );
|
||||
_PROTOTYPE( int req_mkdir, (endpoint_t fs_e, ino_t inode_nr,
|
||||
char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid, _mnx_Mode_t dmode) );
|
||||
char *lastc, uid_t uid, gid_t gid, mode_t dmode) );
|
||||
_PROTOTYPE( int req_mknod, (endpoint_t fs_e, ino_t inode_nr,
|
||||
char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid,
|
||||
_mnx_Mode_t dmode, Dev_t dev) );
|
||||
char *lastc, uid_t uid, gid_t gid,
|
||||
mode_t dmode, dev_t dev) );
|
||||
_PROTOTYPE( int req_mountpoint, (endpoint_t fs_e, ino_t inode_nr) );
|
||||
_PROTOTYPE( int req_newnode, (endpoint_t fs_e, _mnx_Uid_t uid,
|
||||
_mnx_Gid_t gid, _mnx_Mode_t dmode,
|
||||
Dev_t dev, struct node_details *res) );
|
||||
_PROTOTYPE( int req_newnode, (endpoint_t fs_e, uid_t uid,
|
||||
gid_t gid, mode_t dmode,
|
||||
dev_t dev, struct node_details *res) );
|
||||
_PROTOTYPE( int req_putnode, (int fs_e, ino_t inode_nr, int count) );
|
||||
_PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr,
|
||||
endpoint_t who_e, char *buf, size_t len) );
|
||||
_PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name,
|
||||
Dev_t dev, int readonly, int isroot,
|
||||
dev_t dev, int readonly, int isroot,
|
||||
struct node_details *res_nodep) );
|
||||
_PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr,
|
||||
u64_t pos, int rw_flag,
|
||||
@@ -201,7 +201,7 @@ _PROTOTYPE( int req_rmdir, (endpoint_t fs_e, ino_t inode_nr,
|
||||
char *lastc) );
|
||||
_PROTOTYPE(int req_slink, (endpoint_t fs_e, ino_t inode_nr, char *lastc,
|
||||
endpoint_t who_e, char *path_addr,
|
||||
int path_length, _mnx_Uid_t uid, _mnx_Gid_t gid) );
|
||||
unsigned short path_length, uid_t uid, gid_t gid) );
|
||||
_PROTOTYPE( int req_stat, (int fs_e, ino_t inode_nr, int who_e,
|
||||
char *buf, int pos) );
|
||||
_PROTOTYPE( int req_sync, (endpoint_t fs_e) );
|
||||
@@ -210,7 +210,7 @@ _PROTOTYPE( int req_unlink, (endpoint_t fs_e, ino_t inode_nr,
|
||||
_PROTOTYPE( int req_unmount, (endpoint_t fs_e) );
|
||||
_PROTOTYPE( int req_utime, (endpoint_t fs_e, ino_t inode_nr,
|
||||
time_t actime, time_t modtime) );
|
||||
_PROTOTYPE( int req_newdriver, (endpoint_t fs_e, Dev_t dev,
|
||||
_PROTOTYPE( int req_newdriver, (endpoint_t fs_e, dev_t dev,
|
||||
endpoint_t driver_e) );
|
||||
|
||||
/* stadir.c */
|
||||
|
||||
@@ -32,17 +32,17 @@ FORWARD _PROTOTYPE(int fs_sendrec_f, (char *file, int line, endpoint_t fs_e,
|
||||
/*===========================================================================*
|
||||
* req_breadwrite *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_breadwrite(fs_e, user_e, dev, pos, num_of_bytes, user_addr,
|
||||
rw_flag, new_posp, cum_iop)
|
||||
endpoint_t fs_e;
|
||||
endpoint_t user_e;
|
||||
dev_t dev;
|
||||
u64_t pos;
|
||||
unsigned int num_of_bytes;
|
||||
char *user_addr;
|
||||
int rw_flag;
|
||||
u64_t *new_posp;
|
||||
unsigned int *cum_iop;
|
||||
PUBLIC int req_breadwrite(
|
||||
endpoint_t fs_e,
|
||||
endpoint_t user_e,
|
||||
dev_t dev,
|
||||
u64_t pos,
|
||||
unsigned int num_of_bytes,
|
||||
char *user_addr,
|
||||
int rw_flag,
|
||||
u64_t *new_posp,
|
||||
unsigned int *cum_iop
|
||||
)
|
||||
{
|
||||
int r;
|
||||
cp_grant_id_t grant_id;
|
||||
@@ -77,11 +77,12 @@ unsigned int *cum_iop;
|
||||
/*===========================================================================*
|
||||
* req_chmod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_chmod(fs_e, inode_nr, rmode, new_modep)
|
||||
int fs_e;
|
||||
ino_t inode_nr;
|
||||
mode_t rmode;
|
||||
mode_t *new_modep;
|
||||
PUBLIC int req_chmod(
|
||||
int fs_e,
|
||||
ino_t inode_nr,
|
||||
mode_t rmode,
|
||||
mode_t *new_modep
|
||||
)
|
||||
{
|
||||
message m;
|
||||
int r;
|
||||
@@ -104,12 +105,13 @@ mode_t *new_modep;
|
||||
/*===========================================================================*
|
||||
* req_chown *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_chown(fs_e, inode_nr, newuid, newgid, new_modep)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
uid_t newuid;
|
||||
gid_t newgid;
|
||||
mode_t *new_modep;
|
||||
PUBLIC int req_chown(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
uid_t newuid,
|
||||
gid_t newgid,
|
||||
mode_t *new_modep
|
||||
)
|
||||
{
|
||||
message m;
|
||||
int r;
|
||||
@@ -133,14 +135,15 @@ mode_t *new_modep;
|
||||
/*===========================================================================*
|
||||
* req_create *
|
||||
*===========================================================================*/
|
||||
int req_create(fs_e, inode_nr, omode, uid, gid, path, res)
|
||||
int fs_e;
|
||||
ino_t inode_nr;
|
||||
int omode;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
char *path;
|
||||
node_details_t *res;
|
||||
int req_create(
|
||||
int fs_e,
|
||||
ino_t inode_nr,
|
||||
int omode,
|
||||
uid_t uid,
|
||||
gid_t gid,
|
||||
char *path,
|
||||
node_details_t *res
|
||||
)
|
||||
{
|
||||
int r;
|
||||
cp_grant_id_t grant_id;
|
||||
@@ -185,9 +188,7 @@ node_details_t *res;
|
||||
/*===========================================================================*
|
||||
* req_flush *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_flush(fs_e, dev)
|
||||
endpoint_t fs_e;
|
||||
dev_t dev;
|
||||
PUBLIC int req_flush(endpoint_t fs_e, dev_t dev)
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -346,14 +347,15 @@ ino_t linked_file;
|
||||
/*===========================================================================*
|
||||
* req_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_lookup(fs_e, dir_ino, root_ino, uid, gid, flags, res)
|
||||
endpoint_t fs_e;
|
||||
ino_t dir_ino;
|
||||
ino_t root_ino;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
int flags;
|
||||
lookup_res_t *res;
|
||||
PUBLIC int req_lookup(
|
||||
endpoint_t fs_e,
|
||||
ino_t dir_ino,
|
||||
ino_t root_ino,
|
||||
uid_t uid,
|
||||
gid_t gid,
|
||||
int flags,
|
||||
lookup_res_t *res
|
||||
)
|
||||
{
|
||||
int r;
|
||||
size_t len;
|
||||
@@ -444,13 +446,14 @@ lookup_res_t *res;
|
||||
/*===========================================================================*
|
||||
* req_mkdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_mkdir(fs_e, inode_nr, lastc, uid, gid, dmode)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
char *lastc;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
mode_t dmode;
|
||||
PUBLIC int req_mkdir(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
char *lastc,
|
||||
uid_t uid,
|
||||
gid_t gid,
|
||||
mode_t dmode
|
||||
)
|
||||
{
|
||||
int r;
|
||||
cp_grant_id_t grant_id;
|
||||
@@ -482,14 +485,15 @@ mode_t dmode;
|
||||
/*===========================================================================*
|
||||
* req_mknod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_mknod(fs_e, inode_nr, lastc, uid, gid, dmode, dev)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
char *lastc;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
mode_t dmode;
|
||||
dev_t dev;
|
||||
PUBLIC int req_mknod(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
char *lastc,
|
||||
uid_t uid,
|
||||
gid_t gid,
|
||||
mode_t dmode,
|
||||
dev_t dev
|
||||
)
|
||||
{
|
||||
int r;
|
||||
size_t len;
|
||||
@@ -540,13 +544,14 @@ ino_t inode_nr;
|
||||
/*===========================================================================*
|
||||
* req_newnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_newnode(fs_e, uid, gid, dmode, dev, res)
|
||||
endpoint_t fs_e;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
mode_t dmode;
|
||||
dev_t dev;
|
||||
struct node_details *res;
|
||||
PUBLIC int req_newnode(
|
||||
endpoint_t fs_e,
|
||||
uid_t uid,
|
||||
gid_t gid,
|
||||
mode_t dmode,
|
||||
dev_t dev,
|
||||
struct node_details *res
|
||||
)
|
||||
{
|
||||
int r;
|
||||
message m;
|
||||
@@ -576,10 +581,11 @@ struct node_details *res;
|
||||
/*===========================================================================*
|
||||
* req_newdriver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_newdriver(fs_e, dev, driver_e)
|
||||
endpoint_t fs_e;
|
||||
Dev_t dev;
|
||||
endpoint_t driver_e;
|
||||
PUBLIC int req_newdriver(
|
||||
endpoint_t fs_e,
|
||||
dev_t dev,
|
||||
endpoint_t driver_e
|
||||
)
|
||||
{
|
||||
/* Note: this is the only request function that doesn't use the
|
||||
* fs_sendrec internal routine, since we want to avoid the dead
|
||||
@@ -664,13 +670,14 @@ size_t len;
|
||||
/*===========================================================================*
|
||||
* req_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_readsuper(fs_e, label, dev, readonly, isroot, res_nodep)
|
||||
endpoint_t fs_e;
|
||||
char *label;
|
||||
dev_t dev;
|
||||
int readonly;
|
||||
int isroot;
|
||||
struct node_details *res_nodep;
|
||||
PUBLIC int req_readsuper(
|
||||
endpoint_t fs_e,
|
||||
char *label,
|
||||
dev_t dev,
|
||||
int readonly,
|
||||
int isroot,
|
||||
struct node_details *res_nodep
|
||||
)
|
||||
{
|
||||
int r;
|
||||
cp_grant_id_t grant_id;
|
||||
@@ -836,16 +843,16 @@ char *lastc;
|
||||
/*===========================================================================*
|
||||
* req_slink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_slink(fs_e, inode_nr, lastc, who_e, path_addr, path_length,
|
||||
uid, gid)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
char *lastc;
|
||||
endpoint_t who_e;
|
||||
char *path_addr;
|
||||
unsigned short path_length;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
PUBLIC int req_slink(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
char *lastc,
|
||||
endpoint_t who_e,
|
||||
char *path_addr,
|
||||
unsigned short path_length,
|
||||
uid_t uid,
|
||||
gid_t gid
|
||||
)
|
||||
{
|
||||
int r;
|
||||
size_t len;
|
||||
|
||||
@@ -39,11 +39,12 @@ static int failcount;
|
||||
/*===========================================================================*
|
||||
* find_share *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vmproc *find_share(vmp_ign, ino, dev, ctime)
|
||||
struct vmproc *vmp_ign; /* process that should not be looked at */
|
||||
ino_t ino; /* parameters that uniquely identify a file */
|
||||
dev_t dev;
|
||||
time_t ctime;
|
||||
PUBLIC struct vmproc *find_share(
|
||||
struct vmproc *vmp_ign, /* process that should not be looked at */
|
||||
ino_t ino, /* parameters that uniquely identify a file */
|
||||
dev_t dev,
|
||||
time_t ctime
|
||||
)
|
||||
{
|
||||
/* Look for a process that is the file <ino, dev, ctime> in execution. Don't
|
||||
* accidentally "find" vmp_ign, because it is the process on whose behalf this
|
||||
|
||||
@@ -56,7 +56,7 @@ _PROTOTYPE( int do_fork, (message *msg) );
|
||||
|
||||
/* exec.c */
|
||||
_PROTOTYPE( struct vmproc *find_share, (struct vmproc *vmp_ign, Ino_t ino,
|
||||
Dev_t dev, time_t ctime) );
|
||||
dev_t dev, time_t ctime) );
|
||||
_PROTOTYPE( int do_exec_newmem, (message *msg) );
|
||||
_PROTOTYPE( int proc_new, (struct vmproc *vmp, phys_bytes start,
|
||||
phys_bytes text, phys_bytes data, phys_bytes stack, phys_bytes gap,
|
||||
|
||||
Reference in New Issue
Block a user