retire PUBLIC, PRIVATE and FORWARD
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
#include <minix/vfsif.h>
|
||||
#include <assert.h>
|
||||
|
||||
FORWARD int sendmsg(struct vmnt *vmp, struct fproc *rfp);
|
||||
FORWARD int queuemsg(struct vmnt *vmp);
|
||||
static int sendmsg(struct vmnt *vmp, struct fproc *rfp);
|
||||
static int queuemsg(struct vmnt *vmp);
|
||||
|
||||
/*===========================================================================*
|
||||
* sendmsg *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sendmsg(vmp, rfp)
|
||||
static int sendmsg(vmp, rfp)
|
||||
struct vmnt *vmp;
|
||||
struct fproc *rfp;
|
||||
{
|
||||
@@ -39,7 +39,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* send_work *
|
||||
*===========================================================================*/
|
||||
PUBLIC void send_work(void)
|
||||
void send_work(void)
|
||||
{
|
||||
/* Try to send out as many requests as possible */
|
||||
struct vmnt *vmp;
|
||||
@@ -52,7 +52,7 @@ PUBLIC void send_work(void)
|
||||
/*===========================================================================*
|
||||
* fs_cancel *
|
||||
*===========================================================================*/
|
||||
PUBLIC void fs_cancel(struct vmnt *vmp)
|
||||
void fs_cancel(struct vmnt *vmp)
|
||||
{
|
||||
/* Cancel all pending requests for this vmp */
|
||||
struct worker_thread *worker;
|
||||
@@ -68,7 +68,7 @@ PUBLIC void fs_cancel(struct vmnt *vmp)
|
||||
/*===========================================================================*
|
||||
* fs_sendmore *
|
||||
*===========================================================================*/
|
||||
PUBLIC void fs_sendmore(struct vmnt *vmp)
|
||||
void fs_sendmore(struct vmnt *vmp)
|
||||
{
|
||||
struct worker_thread *worker;
|
||||
|
||||
@@ -91,7 +91,7 @@ PUBLIC void fs_sendmore(struct vmnt *vmp)
|
||||
/*===========================================================================*
|
||||
* fs_sendrec *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fs_sendrec(endpoint_t fs_e, message *reqmp)
|
||||
int fs_sendrec(endpoint_t fs_e, message *reqmp)
|
||||
{
|
||||
struct vmnt *vmp;
|
||||
int r;
|
||||
@@ -156,7 +156,7 @@ PUBLIC int fs_sendrec(endpoint_t fs_e, message *reqmp)
|
||||
/*===========================================================================*
|
||||
* queuemsg *
|
||||
*===========================================================================*/
|
||||
PRIVATE int queuemsg(struct vmnt *vmp)
|
||||
static int queuemsg(struct vmnt *vmp)
|
||||
{
|
||||
/* Put request on queue for vmnt */
|
||||
|
||||
|
||||
@@ -10,27 +10,27 @@
|
||||
/* Include ELF headers */
|
||||
#include <sys/elf_core.h>
|
||||
|
||||
FORWARD void fill_elf_header(Elf32_Ehdr *elf_header, int phnum);
|
||||
FORWARD void fill_prog_header(Elf32_Phdr *prog_header, Elf32_Word
|
||||
static void fill_elf_header(Elf32_Ehdr *elf_header, int phnum);
|
||||
static void fill_prog_header(Elf32_Phdr *prog_header, Elf32_Word
|
||||
p_type, Elf32_Off p_offset, Elf32_Addr p_vaddr, Elf32_Word p_flags,
|
||||
Elf32_Word p_filesz, Elf32_Word p_memsz);
|
||||
FORWARD int get_memory_regions(Elf32_Phdr phdrs[]);
|
||||
FORWARD void fill_note_segment_and_entries_hdrs(Elf32_Phdr phdrs[],
|
||||
static int get_memory_regions(Elf32_Phdr phdrs[]);
|
||||
static void fill_note_segment_and_entries_hdrs(Elf32_Phdr phdrs[],
|
||||
Elf32_Nhdr nhdrs[]);
|
||||
FORWARD void adjust_offsets(Elf32_Phdr phdrs[], int phnum);
|
||||
FORWARD void dump_elf_header(struct filp *f, Elf32_Ehdr elf_header);
|
||||
FORWARD void dump_notes(struct filp *f, Elf32_Nhdr nhdrs[], int csig,
|
||||
static void adjust_offsets(Elf32_Phdr phdrs[], int phnum);
|
||||
static void dump_elf_header(struct filp *f, Elf32_Ehdr elf_header);
|
||||
static void dump_notes(struct filp *f, Elf32_Nhdr nhdrs[], int csig,
|
||||
char *proc_name);
|
||||
FORWARD void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int
|
||||
static void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int
|
||||
phnum);
|
||||
FORWARD void dump_segments(struct filp *f, Elf32_Phdr phdrs[], int
|
||||
static void dump_segments(struct filp *f, Elf32_Phdr phdrs[], int
|
||||
phnum);
|
||||
FORWARD void write_buf(struct filp *f, char *buf, size_t size);
|
||||
static void write_buf(struct filp *f, char *buf, size_t size);
|
||||
|
||||
/*===========================================================================*
|
||||
* write_elf_core_file *
|
||||
*===========================================================================*/
|
||||
PUBLIC void write_elf_core_file(struct filp *f, int csig, char *proc_name)
|
||||
void write_elf_core_file(struct filp *f, int csig, char *proc_name)
|
||||
{
|
||||
/* First, fill in all the required headers, second, adjust the offsets,
|
||||
* third, dump everything into the core file
|
||||
@@ -76,7 +76,7 @@ PUBLIC void write_elf_core_file(struct filp *f, int csig, char *proc_name)
|
||||
/*===========================================================================*
|
||||
* fill_elf_header *
|
||||
*===========================================================================*/
|
||||
PRIVATE void fill_elf_header (Elf_Ehdr *elf_header, int phnum)
|
||||
static void fill_elf_header (Elf_Ehdr *elf_header, int phnum)
|
||||
{
|
||||
memset((void *) elf_header, 0, sizeof(Elf_Ehdr));
|
||||
|
||||
@@ -100,7 +100,7 @@ PRIVATE void fill_elf_header (Elf_Ehdr *elf_header, int phnum)
|
||||
/*===========================================================================*
|
||||
* fill_prog_header *
|
||||
*===========================================================================*/
|
||||
PRIVATE void fill_prog_header (Elf_Phdr *prog_header, Elf_Word p_type,
|
||||
static void fill_prog_header (Elf_Phdr *prog_header, Elf_Word p_type,
|
||||
Elf_Off p_offset, Elf_Addr p_vaddr, Elf_Word p_flags,
|
||||
Elf_Word p_filesz, Elf_Word p_memsz)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ PRIVATE void fill_prog_header (Elf_Phdr *prog_header, Elf_Word p_type,
|
||||
/*===========================================================================*
|
||||
* fill_note_segment_and_entries_hdrs *
|
||||
*===========================================================================*/
|
||||
PRIVATE void fill_note_segment_and_entries_hdrs(Elf_Phdr phdrs[],
|
||||
static void fill_note_segment_and_entries_hdrs(Elf_Phdr phdrs[],
|
||||
Elf_Nhdr nhdrs[])
|
||||
{
|
||||
int filesize;
|
||||
@@ -158,7 +158,7 @@ PRIVATE void fill_note_segment_and_entries_hdrs(Elf_Phdr phdrs[],
|
||||
/*===========================================================================*
|
||||
* adjust_offset *
|
||||
*===========================================================================*/
|
||||
PRIVATE void adjust_offsets(Elf_Phdr phdrs[], int phnum)
|
||||
static void adjust_offsets(Elf_Phdr phdrs[], int phnum)
|
||||
{
|
||||
int i;
|
||||
long offset = sizeof(Elf_Ehdr) + phnum * sizeof(Elf_Phdr);
|
||||
@@ -172,7 +172,7 @@ PRIVATE void adjust_offsets(Elf_Phdr phdrs[], int phnum)
|
||||
/*===========================================================================*
|
||||
* write_buf *
|
||||
*===========================================================================*/
|
||||
PRIVATE void write_buf(struct filp *f, char *buf, size_t size)
|
||||
static void write_buf(struct filp *f, char *buf, size_t size)
|
||||
{
|
||||
read_write(WRITING, f, buf, size, VFS_PROC_NR);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ PRIVATE void write_buf(struct filp *f, char *buf, size_t size)
|
||||
/*===========================================================================*
|
||||
* get_memory_regions *
|
||||
*===========================================================================*/
|
||||
PRIVATE int get_memory_regions(Elf_Phdr phdrs[])
|
||||
static int get_memory_regions(Elf_Phdr phdrs[])
|
||||
{
|
||||
/* Print the virtual memory regions of a process. */
|
||||
|
||||
@@ -222,7 +222,7 @@ PRIVATE int get_memory_regions(Elf_Phdr phdrs[])
|
||||
/*===========================================================================*
|
||||
* dump_notes *
|
||||
*===========================================================================*/
|
||||
PRIVATE void dump_notes(struct filp *f, Elf_Nhdr nhdrs[], int csig,
|
||||
static void dump_notes(struct filp *f, Elf_Nhdr nhdrs[], int csig,
|
||||
char *proc_name)
|
||||
{
|
||||
char *note_name = ELF_NOTE_MINIX_ELFCORE_NAME "\0";
|
||||
@@ -264,7 +264,7 @@ PRIVATE void dump_notes(struct filp *f, Elf_Nhdr nhdrs[], int csig,
|
||||
/*===========================================================================*
|
||||
* dump_elf_header *
|
||||
*===========================================================================*/
|
||||
PRIVATE void dump_elf_header(struct filp *f, Elf_Ehdr elf_header)
|
||||
static void dump_elf_header(struct filp *f, Elf_Ehdr elf_header)
|
||||
{
|
||||
write_buf(f, (char *) &elf_header, sizeof(Elf_Ehdr));
|
||||
}
|
||||
@@ -272,7 +272,7 @@ PRIVATE void dump_elf_header(struct filp *f, Elf_Ehdr elf_header)
|
||||
/*===========================================================================*
|
||||
* dump_program_headers *
|
||||
*===========================================================================*/
|
||||
PRIVATE void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum)
|
||||
static void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -283,7 +283,7 @@ PRIVATE void dump_program_headers(struct filp *f, Elf_Phdr phdrs[], int phnum)
|
||||
/*===========================================================================*
|
||||
* dump_segments *
|
||||
*===========================================================================*/
|
||||
PRIVATE void dump_segments(struct filp *f, Elf_Phdr phdrs[], int phnum)
|
||||
static void dump_segments(struct filp *f, Elf_Phdr phdrs[], int phnum)
|
||||
{
|
||||
int i;
|
||||
vir_bytes len;
|
||||
|
||||
@@ -39,17 +39,17 @@
|
||||
#include "vmnt.h"
|
||||
#include "param.h"
|
||||
|
||||
FORWARD void restart_reopen(int major);
|
||||
FORWARD int safe_io_conversion(endpoint_t, cp_grant_id_t *, int *,
|
||||
static void restart_reopen(int major);
|
||||
static int safe_io_conversion(endpoint_t, cp_grant_id_t *, int *,
|
||||
endpoint_t *, void **, size_t, u32_t *);
|
||||
|
||||
PRIVATE int dummyproc;
|
||||
static int dummyproc;
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* dev_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_open(
|
||||
int dev_open(
|
||||
dev_t dev, /* device to open */
|
||||
endpoint_t proc_e, /* process to open for */
|
||||
int flags /* mode bits and flags */
|
||||
@@ -73,7 +73,7 @@ PUBLIC int dev_open(
|
||||
/*===========================================================================*
|
||||
* dev_reopen *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_reopen(
|
||||
int dev_reopen(
|
||||
dev_t dev, /* device to open */
|
||||
int filp_no, /* filp to reopen for */
|
||||
int flags /* mode bits and flags */
|
||||
@@ -102,7 +102,7 @@ PUBLIC int dev_reopen(
|
||||
/*===========================================================================*
|
||||
* dev_close *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_close(
|
||||
int dev_close(
|
||||
dev_t dev, /* device to close */
|
||||
int filp_no
|
||||
)
|
||||
@@ -122,7 +122,7 @@ PUBLIC int dev_close(
|
||||
/*===========================================================================*
|
||||
* dev_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int bdev_open(dev_t dev, int access)
|
||||
int bdev_open(dev_t dev, int access)
|
||||
{
|
||||
/* Open a block device. */
|
||||
int major;
|
||||
@@ -138,7 +138,7 @@ PUBLIC int bdev_open(dev_t dev, int access)
|
||||
/*===========================================================================*
|
||||
* bdev_close *
|
||||
*===========================================================================*/
|
||||
PUBLIC int bdev_close(dev_t dev)
|
||||
int bdev_close(dev_t dev)
|
||||
{
|
||||
/* Close a block device. */
|
||||
int major;
|
||||
@@ -154,7 +154,7 @@ PUBLIC int bdev_close(dev_t dev)
|
||||
/*===========================================================================*
|
||||
* bdev_ioctl *
|
||||
*===========================================================================*/
|
||||
PRIVATE int bdev_ioctl(dev_t dev, endpoint_t proc_e, int req, void *buf)
|
||||
static int bdev_ioctl(dev_t dev, endpoint_t proc_e, int req, void *buf)
|
||||
{
|
||||
/* Perform an I/O control operation on a block device. */
|
||||
struct dmap *dp;
|
||||
@@ -228,7 +228,7 @@ endpoint_t find_suspended_ep(endpoint_t driver, cp_grant_id_t g)
|
||||
/*===========================================================================*
|
||||
* dev_status *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dev_status(message *m)
|
||||
void dev_status(message *m)
|
||||
{
|
||||
/* A device sent us a notification it has something for us. Retrieve it. */
|
||||
|
||||
@@ -293,7 +293,7 @@ PUBLIC void dev_status(message *m)
|
||||
/*===========================================================================*
|
||||
* safe_io_conversion *
|
||||
*===========================================================================*/
|
||||
PRIVATE int safe_io_conversion(driver, gid, op, io_ept, buf, bytes, pos_lo)
|
||||
static int safe_io_conversion(driver, gid, op, io_ept, buf, bytes, pos_lo)
|
||||
endpoint_t driver;
|
||||
cp_grant_id_t *gid;
|
||||
int *op;
|
||||
@@ -359,7 +359,7 @@ u32_t *pos_lo;
|
||||
return(0);
|
||||
}
|
||||
|
||||
PRIVATE int cancel_nblock(struct dmap * dp,
|
||||
static int cancel_nblock(struct dmap * dp,
|
||||
int minor,
|
||||
int call,
|
||||
endpoint_t ioproc,
|
||||
@@ -388,7 +388,7 @@ PRIVATE int cancel_nblock(struct dmap * dp,
|
||||
/*===========================================================================*
|
||||
* dev_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dev_io(
|
||||
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? */
|
||||
@@ -516,7 +516,7 @@ PUBLIC int dev_io(
|
||||
/*===========================================================================*
|
||||
* gen_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int gen_opcl(
|
||||
int gen_opcl(
|
||||
int op, /* operation, (B)DEV_OPEN or (B)DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
endpoint_t proc_e, /* process to open/close for */
|
||||
@@ -568,7 +568,7 @@ PUBLIC int gen_opcl(
|
||||
/*===========================================================================*
|
||||
* tty_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int tty_opcl(
|
||||
int tty_opcl(
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t dev, /* device to open or close */
|
||||
endpoint_t proc_e, /* process to open/close for */
|
||||
@@ -610,7 +610,7 @@ PUBLIC int tty_opcl(
|
||||
/*===========================================================================*
|
||||
* ctty_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int ctty_opcl(
|
||||
int ctty_opcl(
|
||||
int op, /* operation, DEV_OPEN or DEV_CLOSE */
|
||||
dev_t UNUSED(dev), /* device to open or close */
|
||||
endpoint_t UNUSED(proc_e), /* process to open/close for */
|
||||
@@ -630,7 +630,7 @@ PUBLIC int ctty_opcl(
|
||||
/*===========================================================================*
|
||||
* pm_setsid *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_setsid(proc_e)
|
||||
void pm_setsid(proc_e)
|
||||
int proc_e;
|
||||
{
|
||||
/* Perform the VFS side of the SETSID call, i.e. get rid of the controlling
|
||||
@@ -650,7 +650,7 @@ int proc_e;
|
||||
/*===========================================================================*
|
||||
* do_ioctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_ioctl()
|
||||
int do_ioctl()
|
||||
{
|
||||
/* Perform the ioctl(ls_fd, request, argx) system call (uses m2 fmt). */
|
||||
|
||||
@@ -689,7 +689,7 @@ PUBLIC int do_ioctl()
|
||||
/*===========================================================================*
|
||||
* gen_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int gen_io(driver_e, mess_ptr)
|
||||
int gen_io(driver_e, mess_ptr)
|
||||
endpoint_t driver_e; /* which endpoint to call */
|
||||
message *mess_ptr; /* pointer to message for task */
|
||||
{
|
||||
@@ -739,7 +739,7 @@ message *mess_ptr; /* pointer to message for task */
|
||||
/*===========================================================================*
|
||||
* asyn_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int asyn_io(task_nr, mess_ptr)
|
||||
int asyn_io(task_nr, mess_ptr)
|
||||
int task_nr; /* which task to call */
|
||||
message *mess_ptr; /* pointer to message for task */
|
||||
{
|
||||
@@ -765,7 +765,7 @@ message *mess_ptr; /* pointer to message for task */
|
||||
/*===========================================================================*
|
||||
* ctty_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int ctty_io(
|
||||
int ctty_io(
|
||||
endpoint_t UNUSED(task_nr), /* not used - for compatibility with dmap_t */
|
||||
message *mess_ptr /* pointer to message for task */
|
||||
)
|
||||
@@ -805,7 +805,7 @@ PUBLIC int ctty_io(
|
||||
/*===========================================================================*
|
||||
* no_dev *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_dev(
|
||||
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 */
|
||||
@@ -819,7 +819,7 @@ PUBLIC int no_dev(
|
||||
/*===========================================================================*
|
||||
* no_dev_io *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m))
|
||||
int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m))
|
||||
{
|
||||
/* Called when doing i/o on a nonexistent device. */
|
||||
printf("VFS: I/O on unmapped device number\n");
|
||||
@@ -830,7 +830,7 @@ PUBLIC int no_dev_io(endpoint_t UNUSED(proc), message *UNUSED(m))
|
||||
/*===========================================================================*
|
||||
* clone_opcl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int clone_opcl(
|
||||
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 */
|
||||
@@ -927,7 +927,7 @@ PUBLIC int clone_opcl(
|
||||
/*===========================================================================*
|
||||
* bdev_up *
|
||||
*===========================================================================*/
|
||||
PUBLIC void bdev_up(int maj)
|
||||
void bdev_up(int maj)
|
||||
{
|
||||
/* A new block device driver has been mapped in. This may affect both mounted
|
||||
* file systems and open block-special files.
|
||||
@@ -987,7 +987,7 @@ PUBLIC void bdev_up(int maj)
|
||||
/*===========================================================================*
|
||||
* cdev_up *
|
||||
*===========================================================================*/
|
||||
PUBLIC void cdev_up(int maj)
|
||||
void cdev_up(int maj)
|
||||
{
|
||||
/* A new character device driver has been mapped in.
|
||||
*/
|
||||
@@ -1032,7 +1032,7 @@ PUBLIC void cdev_up(int maj)
|
||||
/*===========================================================================*
|
||||
* open_reply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void open_reply(void)
|
||||
void open_reply(void)
|
||||
{
|
||||
struct fproc *rfp;
|
||||
endpoint_t proc_e;
|
||||
@@ -1048,7 +1048,7 @@ PUBLIC void open_reply(void)
|
||||
/*===========================================================================*
|
||||
* restart_reopen *
|
||||
*===========================================================================*/
|
||||
PRIVATE void restart_reopen(maj)
|
||||
static void restart_reopen(maj)
|
||||
int maj;
|
||||
{
|
||||
int n, r, minor_dev, major_dev, fd_nr;
|
||||
@@ -1138,7 +1138,7 @@ int maj;
|
||||
/*===========================================================================*
|
||||
* reopen_reply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void reopen_reply()
|
||||
void reopen_reply()
|
||||
{
|
||||
endpoint_t driver_e;
|
||||
int filp_no, status, maj;
|
||||
|
||||
@@ -28,7 +28,7 @@ struct dmap dmap[NR_DEVICES];
|
||||
/*===========================================================================*
|
||||
* do_mapdriver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_mapdriver()
|
||||
int do_mapdriver()
|
||||
{
|
||||
/* Create a device->driver mapping. RS will tell us which major is driven by
|
||||
* this driver, what type of device it is (regular, TTY, asynchronous, clone,
|
||||
@@ -76,7 +76,7 @@ PUBLIC int do_mapdriver()
|
||||
/*===========================================================================*
|
||||
* map_driver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int map_driver(label, major, proc_nr_e, style, flags)
|
||||
int map_driver(label, major, proc_nr_e, style, flags)
|
||||
const char *label; /* name of the driver */
|
||||
int major; /* major number of the device */
|
||||
endpoint_t proc_nr_e; /* process number of the driver */
|
||||
@@ -162,7 +162,7 @@ int flags; /* device flags */
|
||||
/*===========================================================================*
|
||||
* dmap_unmap_by_endpt *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dmap_unmap_by_endpt(endpoint_t proc_e)
|
||||
void dmap_unmap_by_endpt(endpoint_t proc_e)
|
||||
{
|
||||
/* Lookup driver in dmap table by endpoint and unmap it */
|
||||
int major, r;
|
||||
@@ -181,7 +181,7 @@ PUBLIC void dmap_unmap_by_endpt(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* map_service *
|
||||
*===========================================================================*/
|
||||
PUBLIC int map_service(struct rprocpub *rpub)
|
||||
int map_service(struct rprocpub *rpub)
|
||||
{
|
||||
/* Map a new service by storing its device driver properties. */
|
||||
int r;
|
||||
@@ -207,7 +207,7 @@ PUBLIC int map_service(struct rprocpub *rpub)
|
||||
/*===========================================================================*
|
||||
* init_dmap *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_dmap()
|
||||
void init_dmap()
|
||||
{
|
||||
/* Initialize the table with empty device <-> driver mappings. */
|
||||
int i;
|
||||
@@ -220,7 +220,7 @@ PUBLIC void init_dmap()
|
||||
/*===========================================================================*
|
||||
* dmap_driver_match *
|
||||
*===========================================================================*/
|
||||
PUBLIC int dmap_driver_match(endpoint_t proc, int major)
|
||||
int dmap_driver_match(endpoint_t proc, int major)
|
||||
{
|
||||
if (major < 0 || major >= NR_DEVICES) return(0);
|
||||
if (dmap[major].dmap_driver != NONE && dmap[major].dmap_driver == proc)
|
||||
@@ -232,7 +232,7 @@ PUBLIC int dmap_driver_match(endpoint_t proc, int major)
|
||||
/*===========================================================================*
|
||||
* dmap_endpt_up *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dmap_endpt_up(endpoint_t proc_e, int is_blk)
|
||||
void dmap_endpt_up(endpoint_t proc_e, int is_blk)
|
||||
{
|
||||
/* A device driver with endpoint proc_e has been restarted. Go tell everyone
|
||||
* that might be blocking on it that this device is 'up'.
|
||||
@@ -252,7 +252,7 @@ PUBLIC void dmap_endpt_up(endpoint_t proc_e, int is_blk)
|
||||
/*===========================================================================*
|
||||
* get_dmap *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct dmap *get_dmap(endpoint_t proc_e)
|
||||
struct dmap *get_dmap(endpoint_t proc_e)
|
||||
{
|
||||
/* See if 'proc_e' endpoint belongs to a valid dmap entry. If so, return a
|
||||
* pointer */
|
||||
|
||||
@@ -35,25 +35,25 @@
|
||||
#include <libexec.h>
|
||||
#include "exec.h"
|
||||
|
||||
FORWARD void lock_exec(void);
|
||||
FORWARD void unlock_exec(void);
|
||||
FORWARD int exec_newmem(int proc_e, vir_bytes text_addr, vir_bytes
|
||||
static void lock_exec(void);
|
||||
static void unlock_exec(void);
|
||||
static int exec_newmem(int proc_e, vir_bytes text_addr, vir_bytes
|
||||
text_bytes, vir_bytes data_addr, vir_bytes data_bytes, vir_bytes
|
||||
tot_bytes, vir_bytes frame_len, int sep_id, int is_elf, dev_t st_dev,
|
||||
ino_t st_ino, time_t ctime, char *progname, int new_uid, int new_gid,
|
||||
vir_bytes *stack_topp, int *load_textp, int *setugidp);
|
||||
FORWARD int is_script(const char *exec_hdr, size_t exec_len);
|
||||
FORWARD int patch_stack(struct vnode *vp, char stack[ARG_MAX], vir_bytes
|
||||
static int is_script(const char *exec_hdr, size_t exec_len);
|
||||
static int patch_stack(struct vnode *vp, char stack[ARG_MAX], vir_bytes
|
||||
*stk_bytes, char path[PATH_MAX]);
|
||||
FORWARD int insert_arg(char stack[ARG_MAX], vir_bytes *stk_bytes, char
|
||||
static int insert_arg(char stack[ARG_MAX], vir_bytes *stk_bytes, char
|
||||
*arg, int replace);
|
||||
FORWARD void patch_ptr(char stack[ARG_MAX], vir_bytes base);
|
||||
FORWARD void clo_exec(struct fproc *rfp);
|
||||
FORWARD int read_seg(struct vnode *vp, off_t off, int proc_e, int seg,
|
||||
static void patch_ptr(char stack[ARG_MAX], vir_bytes base);
|
||||
static void clo_exec(struct fproc *rfp);
|
||||
static int read_seg(struct vnode *vp, off_t off, int proc_e, int seg,
|
||||
vir_bytes seg_addr, phys_bytes seg_bytes);
|
||||
FORWARD int load_aout(struct exec_info *execi);
|
||||
FORWARD int load_elf(struct exec_info *execi);
|
||||
FORWARD int map_header(char **exec_hdr, const struct vnode *vp);
|
||||
static int load_aout(struct exec_info *execi);
|
||||
static int load_elf(struct exec_info *execi);
|
||||
static int map_header(char **exec_hdr, const struct vnode *vp);
|
||||
|
||||
#define PTRSIZE sizeof(char *) /* Size of pointers in argv[] and envp[]. */
|
||||
|
||||
@@ -62,18 +62,18 @@ struct exec_loaders {
|
||||
int (*load_object)(struct exec_info *);
|
||||
};
|
||||
|
||||
PRIVATE const struct exec_loaders exec_loaders[] = {
|
||||
static const struct exec_loaders exec_loaders[] = {
|
||||
{ load_aout },
|
||||
{ load_elf },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
PRIVATE char hdr[PAGE_SIZE]; /* Assume that header is not larger than a page */
|
||||
static char hdr[PAGE_SIZE]; /* Assume that header is not larger than a page */
|
||||
|
||||
/*===========================================================================*
|
||||
* lock_exec *
|
||||
*===========================================================================*/
|
||||
PRIVATE void lock_exec(void)
|
||||
static void lock_exec(void)
|
||||
{
|
||||
message org_m_in;
|
||||
struct fproc *org_fp;
|
||||
@@ -98,7 +98,7 @@ PRIVATE void lock_exec(void)
|
||||
/*===========================================================================*
|
||||
* unlock_exec *
|
||||
*===========================================================================*/
|
||||
PRIVATE void unlock_exec(void)
|
||||
static void unlock_exec(void)
|
||||
{
|
||||
if (mutex_unlock(&exec_lock) != 0)
|
||||
panic("Could not release lock on exec");
|
||||
@@ -107,7 +107,7 @@ PRIVATE void unlock_exec(void)
|
||||
/*===========================================================================*
|
||||
* pm_exec *
|
||||
*===========================================================================*/
|
||||
PUBLIC int pm_exec(int proc_e, char *path, vir_bytes path_len, char *frame,
|
||||
int pm_exec(int proc_e, char *path, vir_bytes path_len, char *frame,
|
||||
vir_bytes frame_len, vir_bytes *pc)
|
||||
{
|
||||
/* Perform the execve(name, argv, envp) call. The user library builds a
|
||||
@@ -261,7 +261,7 @@ pm_execfinal:
|
||||
/*===========================================================================*
|
||||
* load_aout *
|
||||
*===========================================================================*/
|
||||
PRIVATE int load_aout(struct exec_info *execi)
|
||||
static int load_aout(struct exec_info *execi)
|
||||
{
|
||||
int r;
|
||||
struct vnode *vp;
|
||||
@@ -312,7 +312,7 @@ PRIVATE int load_aout(struct exec_info *execi)
|
||||
/*===========================================================================*
|
||||
* load_elf *
|
||||
*===========================================================================*/
|
||||
PRIVATE int load_elf(struct exec_info *execi)
|
||||
static int load_elf(struct exec_info *execi)
|
||||
{
|
||||
int r;
|
||||
struct vnode *vp;
|
||||
@@ -367,7 +367,7 @@ PRIVATE int load_elf(struct exec_info *execi)
|
||||
/*===========================================================================*
|
||||
* exec_newmem *
|
||||
*===========================================================================*/
|
||||
PRIVATE int exec_newmem(
|
||||
static int exec_newmem(
|
||||
int proc_e,
|
||||
vir_bytes text_addr,
|
||||
vir_bytes text_bytes,
|
||||
@@ -427,7 +427,7 @@ PRIVATE int exec_newmem(
|
||||
/*===========================================================================*
|
||||
* is_script *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_script(const char *exec_hdr, size_t exec_len)
|
||||
static int is_script(const char *exec_hdr, size_t exec_len)
|
||||
{
|
||||
/* Is Interpreted script? */
|
||||
assert(exec_hdr != NULL);
|
||||
@@ -438,7 +438,7 @@ PRIVATE int is_script(const char *exec_hdr, size_t exec_len)
|
||||
/*===========================================================================*
|
||||
* patch_stack *
|
||||
*===========================================================================*/
|
||||
PRIVATE int patch_stack(vp, stack, stk_bytes, path)
|
||||
static int patch_stack(vp, stack, stk_bytes, path)
|
||||
struct vnode *vp; /* pointer for open script file */
|
||||
char stack[ARG_MAX]; /* pointer to stack image within VFS */
|
||||
vir_bytes *stk_bytes; /* size of initial stack */
|
||||
@@ -512,7 +512,7 @@ char path[PATH_MAX]; /* path to script file */
|
||||
/*===========================================================================*
|
||||
* insert_arg *
|
||||
*===========================================================================*/
|
||||
PRIVATE int insert_arg(
|
||||
static int insert_arg(
|
||||
char stack[ARG_MAX], /* pointer to stack image within PM */
|
||||
vir_bytes *stk_bytes, /* size of initial stack */
|
||||
char *arg, /* argument to prepend/replace as new argv[0] */
|
||||
@@ -570,7 +570,7 @@ int replace
|
||||
/*===========================================================================*
|
||||
* patch_ptr *
|
||||
*===========================================================================*/
|
||||
PRIVATE void patch_ptr(
|
||||
static void patch_ptr(
|
||||
char stack[ARG_MAX], /* pointer to stack image within PM */
|
||||
vir_bytes base /* virtual address of stack base inside user */
|
||||
)
|
||||
@@ -603,7 +603,7 @@ vir_bytes base /* virtual address of stack base inside user */
|
||||
/*===========================================================================*
|
||||
* read_seg *
|
||||
*===========================================================================*/
|
||||
PRIVATE int read_seg(
|
||||
static int read_seg(
|
||||
struct vnode *vp, /* inode descriptor to read from */
|
||||
off_t off, /* offset in file */
|
||||
int proc_e, /* process number (endpoint) */
|
||||
@@ -680,7 +680,7 @@ phys_bytes seg_bytes /* how much is to be transferred? */
|
||||
/*===========================================================================*
|
||||
* clo_exec *
|
||||
*===========================================================================*/
|
||||
PRIVATE void clo_exec(struct fproc *rfp)
|
||||
static void clo_exec(struct fproc *rfp)
|
||||
{
|
||||
/* Files can be marked with the FD_CLOEXEC bit (in fp->fp_cloexec).
|
||||
*/
|
||||
@@ -695,7 +695,7 @@ PRIVATE void clo_exec(struct fproc *rfp)
|
||||
/*===========================================================================*
|
||||
* map_header *
|
||||
*===========================================================================*/
|
||||
PRIVATE int map_header(char **exec_hdr, const struct vnode *vp)
|
||||
static int map_header(char **exec_hdr, const struct vnode *vp)
|
||||
{
|
||||
int r;
|
||||
u64_t new_pos;
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
#include "vnode.h"
|
||||
|
||||
|
||||
FORWARD filp_id_t verify_fd(endpoint_t ep, int fd);
|
||||
static filp_id_t verify_fd(endpoint_t ep, int fd);
|
||||
|
||||
#if LOCK_DEBUG
|
||||
/*===========================================================================*
|
||||
* check_filp_locks *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_filp_locks_by_me(void)
|
||||
void check_filp_locks_by_me(void)
|
||||
{
|
||||
/* Check whether this thread still has filp locks held */
|
||||
struct filp *f;
|
||||
@@ -53,7 +53,7 @@ PUBLIC void check_filp_locks_by_me(void)
|
||||
/*===========================================================================*
|
||||
* check_filp_locks *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_filp_locks(void)
|
||||
void check_filp_locks(void)
|
||||
{
|
||||
struct filp *f;
|
||||
int r, count = 0;
|
||||
@@ -78,7 +78,7 @@ PUBLIC void check_filp_locks(void)
|
||||
/*===========================================================================*
|
||||
* init_filps *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_filps(void)
|
||||
void init_filps(void)
|
||||
{
|
||||
/* Initialize filps */
|
||||
struct filp *f;
|
||||
@@ -92,7 +92,7 @@ PUBLIC void init_filps(void)
|
||||
/*===========================================================================*
|
||||
* get_fd *
|
||||
*===========================================================================*/
|
||||
PUBLIC int get_fd(int start, mode_t bits, int *k, struct filp **fpt)
|
||||
int get_fd(int start, mode_t bits, int *k, struct filp **fpt)
|
||||
{
|
||||
/* Look for a free file descriptor and a free filp slot. Fill in the mode word
|
||||
* in the latter, but don't claim either one yet, since the open() or creat()
|
||||
@@ -143,7 +143,7 @@ PUBLIC int get_fd(int start, mode_t bits, int *k, struct filp **fpt)
|
||||
/*===========================================================================*
|
||||
* get_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct filp *get_filp(fild, locktype)
|
||||
struct filp *get_filp(fild, locktype)
|
||||
int fild; /* file descriptor */
|
||||
tll_access_t locktype;
|
||||
{
|
||||
@@ -156,7 +156,7 @@ tll_access_t locktype;
|
||||
/*===========================================================================*
|
||||
* get_filp2 *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct filp *get_filp2(rfp, fild, locktype)
|
||||
struct filp *get_filp2(rfp, fild, locktype)
|
||||
register struct fproc *rfp;
|
||||
int fild; /* file descriptor */
|
||||
tll_access_t locktype;
|
||||
@@ -178,7 +178,7 @@ tll_access_t locktype;
|
||||
/*===========================================================================*
|
||||
* find_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct filp *find_filp(struct vnode *vp, mode_t bits)
|
||||
struct filp *find_filp(struct vnode *vp, mode_t bits)
|
||||
{
|
||||
/* Find a filp slot that refers to the vnode 'vp' in a way as described
|
||||
* by the mode bit 'bits'. Used for determining whether somebody is still
|
||||
@@ -202,7 +202,7 @@ PUBLIC struct filp *find_filp(struct vnode *vp, mode_t bits)
|
||||
/*===========================================================================*
|
||||
* invalidate_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int invalidate_filp(struct filp *rfilp)
|
||||
int invalidate_filp(struct filp *rfilp)
|
||||
{
|
||||
/* Invalidate filp. fp_filp_inuse is not cleared, so filp can't be reused
|
||||
until it is closed first. */
|
||||
@@ -224,7 +224,7 @@ PUBLIC int invalidate_filp(struct filp *rfilp)
|
||||
/*===========================================================================*
|
||||
* invalidate_filp_by_endpt *
|
||||
*===========================================================================*/
|
||||
PUBLIC void invalidate_filp_by_endpt(endpoint_t proc_e)
|
||||
void invalidate_filp_by_endpt(endpoint_t proc_e)
|
||||
{
|
||||
struct filp *f;
|
||||
|
||||
@@ -239,7 +239,7 @@ PUBLIC void invalidate_filp_by_endpt(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* lock_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void lock_filp(filp, locktype)
|
||||
void lock_filp(filp, locktype)
|
||||
struct filp *filp;
|
||||
tll_access_t locktype;
|
||||
{
|
||||
@@ -287,7 +287,7 @@ tll_access_t locktype;
|
||||
/*===========================================================================*
|
||||
* unlock_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlock_filp(filp)
|
||||
void unlock_filp(filp)
|
||||
struct filp *filp;
|
||||
{
|
||||
/* If this filp holds a soft lock on the vnode, we must be the owner */
|
||||
@@ -312,7 +312,7 @@ struct filp *filp;
|
||||
/*===========================================================================*
|
||||
* unlock_filps *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlock_filps(filp1, filp2)
|
||||
void unlock_filps(filp1, filp2)
|
||||
struct filp *filp1;
|
||||
struct filp *filp2;
|
||||
{
|
||||
@@ -344,7 +344,7 @@ struct filp *filp2;
|
||||
/*===========================================================================*
|
||||
* verify_fd *
|
||||
*===========================================================================*/
|
||||
PRIVATE filp_id_t verify_fd(ep, fd)
|
||||
static filp_id_t verify_fd(ep, fd)
|
||||
endpoint_t ep;
|
||||
int fd;
|
||||
{
|
||||
@@ -366,7 +366,7 @@ int fd;
|
||||
/*===========================================================================*
|
||||
* do_verify_fd *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_verify_fd(void)
|
||||
int do_verify_fd(void)
|
||||
{
|
||||
struct filp *rfilp;
|
||||
rfilp = (struct filp *) verify_fd(m_in.USER_ENDPT, m_in.COUNT);
|
||||
@@ -378,7 +378,7 @@ PUBLIC int do_verify_fd(void)
|
||||
/*===========================================================================*
|
||||
* set_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int set_filp(sfilp)
|
||||
int set_filp(sfilp)
|
||||
filp_id_t sfilp;
|
||||
{
|
||||
if (sfilp == NULL) return(EINVAL);
|
||||
@@ -393,7 +393,7 @@ filp_id_t sfilp;
|
||||
/*===========================================================================*
|
||||
* do_set_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_set_filp(void)
|
||||
int do_set_filp(void)
|
||||
{
|
||||
return set_filp((filp_id_t) m_in.ADDRESS);
|
||||
}
|
||||
@@ -401,7 +401,7 @@ PUBLIC int do_set_filp(void)
|
||||
/*===========================================================================*
|
||||
* copy_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int copy_filp(to_ep, cfilp)
|
||||
int copy_filp(to_ep, cfilp)
|
||||
endpoint_t to_ep;
|
||||
filp_id_t cfilp;
|
||||
{
|
||||
@@ -432,7 +432,7 @@ filp_id_t cfilp;
|
||||
/*===========================================================================*
|
||||
* do_copy_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_copy_filp(void)
|
||||
int do_copy_filp(void)
|
||||
{
|
||||
return copy_filp(m_in.USER_ENDPT, (filp_id_t) m_in.ADDRESS);
|
||||
}
|
||||
@@ -440,7 +440,7 @@ PUBLIC int do_copy_filp(void)
|
||||
/*===========================================================================*
|
||||
* put_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int put_filp(pfilp)
|
||||
int put_filp(pfilp)
|
||||
filp_id_t pfilp;
|
||||
{
|
||||
if (pfilp == NULL) {
|
||||
@@ -455,7 +455,7 @@ filp_id_t pfilp;
|
||||
/*===========================================================================*
|
||||
* do_put_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_put_filp(void)
|
||||
int do_put_filp(void)
|
||||
{
|
||||
return put_filp((filp_id_t) m_in.ADDRESS);
|
||||
}
|
||||
@@ -463,7 +463,7 @@ PUBLIC int do_put_filp(void)
|
||||
/*===========================================================================*
|
||||
* cancel_fd *
|
||||
*===========================================================================*/
|
||||
PUBLIC int cancel_fd(ep, fd)
|
||||
int cancel_fd(ep, fd)
|
||||
endpoint_t ep;
|
||||
int fd;
|
||||
{
|
||||
@@ -498,7 +498,7 @@ int fd;
|
||||
/*===========================================================================*
|
||||
* do_cancel_fd *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_cancel_fd(void)
|
||||
int do_cancel_fd(void)
|
||||
{
|
||||
return cancel_fd(m_in.USER_ENDPT, m_in.COUNT);
|
||||
}
|
||||
@@ -506,7 +506,7 @@ PUBLIC int do_cancel_fd(void)
|
||||
/*===========================================================================*
|
||||
* close_filp *
|
||||
*===========================================================================*/
|
||||
PUBLIC void close_filp(f)
|
||||
void close_filp(f)
|
||||
struct filp *f;
|
||||
{
|
||||
/* Close a file. Will also unlock filp when done */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define MAX_DEPTH 1
|
||||
|
||||
/* global variables stack */
|
||||
PRIVATE struct {
|
||||
static struct {
|
||||
struct fproc *g_fp; /* pointer to caller process */
|
||||
message g_m_in; /* request message */
|
||||
message g_m_out; /* reply message */
|
||||
@@ -30,16 +30,16 @@ PRIVATE struct {
|
||||
char g_user_fullpath[PATH_MAX]; /* path to look up */
|
||||
} globals[MAX_DEPTH];
|
||||
|
||||
PRIVATE int depth = 0; /* current globals stack level */
|
||||
static int depth = 0; /* current globals stack level */
|
||||
|
||||
FORWARD int push_globals(void);
|
||||
FORWARD void pop_globals(void);
|
||||
FORWARD void set_globals(message *m);
|
||||
static int push_globals(void);
|
||||
static void pop_globals(void);
|
||||
static void set_globals(message *m);
|
||||
|
||||
/*===========================================================================*
|
||||
* push_globals *
|
||||
*===========================================================================*/
|
||||
PRIVATE int push_globals()
|
||||
static int push_globals()
|
||||
{
|
||||
/* Save the global variables of the current call onto the globals stack.
|
||||
*/
|
||||
@@ -60,7 +60,7 @@ PRIVATE int push_globals()
|
||||
/*===========================================================================*
|
||||
* pop_globals *
|
||||
*===========================================================================*/
|
||||
PRIVATE void pop_globals()
|
||||
static void pop_globals()
|
||||
{
|
||||
/* Restore the global variables of a call from the globals stack.
|
||||
*/
|
||||
@@ -79,7 +79,7 @@ PRIVATE void pop_globals()
|
||||
/*===========================================================================*
|
||||
* set_globals *
|
||||
*===========================================================================*/
|
||||
PRIVATE void set_globals(m)
|
||||
static void set_globals(m)
|
||||
message *m; /* request message */
|
||||
{
|
||||
/* Initialize global variables based on a request message.
|
||||
@@ -97,7 +97,7 @@ message *m; /* request message */
|
||||
/*===========================================================================*
|
||||
* nested_fs_call *
|
||||
*===========================================================================*/
|
||||
PUBLIC void nested_fs_call(m)
|
||||
void nested_fs_call(m)
|
||||
message *m; /* request/reply message pointer */
|
||||
{
|
||||
/* Handle a nested call from a file system server.
|
||||
|
||||
@@ -8,7 +8,7 @@ int gcov_flush(cp_grant_id_t grantid, size_t size );
|
||||
/*===========================================================================*
|
||||
* do_gcov_flush *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_gcov_flush()
|
||||
int do_gcov_flush()
|
||||
{
|
||||
/* A userland tool has requested the gcov data from another
|
||||
* process (possibly vfs itself). Grant the target process
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/*===========================================================================*
|
||||
* do_link *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_link()
|
||||
int do_link()
|
||||
{
|
||||
/* Perform the link(name1, name2) system call. */
|
||||
int r = OK;
|
||||
@@ -85,7 +85,7 @@ PUBLIC int do_link()
|
||||
/*===========================================================================*
|
||||
* do_unlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_unlink()
|
||||
int do_unlink()
|
||||
{
|
||||
/* Perform the unlink(name) or rmdir(name) system call. The code for these two
|
||||
* is almost the same. They differ only in some condition testing. Unlink()
|
||||
@@ -166,7 +166,7 @@ PUBLIC int do_unlink()
|
||||
/*===========================================================================*
|
||||
* do_rename *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_rename()
|
||||
int do_rename()
|
||||
{
|
||||
/* Perform the rename(name1, name2) system call. */
|
||||
int r = OK, r1;
|
||||
@@ -262,7 +262,7 @@ PUBLIC int do_rename()
|
||||
/*===========================================================================*
|
||||
* do_truncate *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_truncate()
|
||||
int do_truncate()
|
||||
{
|
||||
/* truncate_vnode() does the actual work of do_truncate() and do_ftruncate().
|
||||
* do_truncate() and do_ftruncate() have to get hold of the inode, either
|
||||
@@ -298,7 +298,7 @@ PUBLIC int do_truncate()
|
||||
/*===========================================================================*
|
||||
* do_ftruncate *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_ftruncate()
|
||||
int do_ftruncate()
|
||||
{
|
||||
/* As with do_truncate(), truncate_vnode() does the actual work. */
|
||||
struct filp *rfilp;
|
||||
@@ -322,7 +322,7 @@ PUBLIC int do_ftruncate()
|
||||
/*===========================================================================*
|
||||
* truncate_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int truncate_vnode(vp, newsize)
|
||||
int truncate_vnode(vp, newsize)
|
||||
struct vnode *vp;
|
||||
off_t newsize;
|
||||
{
|
||||
@@ -341,7 +341,7 @@ off_t newsize;
|
||||
/*===========================================================================*
|
||||
* do_slink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_slink()
|
||||
int do_slink()
|
||||
{
|
||||
/* Perform the symlink(name1, name2) system call. */
|
||||
int r;
|
||||
@@ -379,7 +379,7 @@ PUBLIC int do_slink()
|
||||
/*===========================================================================*
|
||||
* rdlink_direct *
|
||||
*===========================================================================*/
|
||||
PUBLIC int rdlink_direct(orig_path, link_path, rfp)
|
||||
int rdlink_direct(orig_path, link_path, rfp)
|
||||
char *orig_path;
|
||||
char link_path[PATH_MAX]; /* should have length PATH_MAX */
|
||||
struct fproc *rfp;
|
||||
@@ -419,7 +419,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* do_rdlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_rdlink()
|
||||
int do_rdlink()
|
||||
{
|
||||
/* Perform the readlink(name, buf, bufsize) system call. */
|
||||
int r, copylen;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/*===========================================================================*
|
||||
* lock_op *
|
||||
*===========================================================================*/
|
||||
PUBLIC int lock_op(f, req)
|
||||
int lock_op(f, req)
|
||||
struct filp *f;
|
||||
int req; /* either F_SETLK or F_SETLKW */
|
||||
{
|
||||
@@ -169,7 +169,7 @@ int req; /* either F_SETLK or F_SETLKW */
|
||||
/*===========================================================================*
|
||||
* lock_revive *
|
||||
*===========================================================================*/
|
||||
PUBLIC void lock_revive()
|
||||
void lock_revive()
|
||||
{
|
||||
/* Go find all the processes that are waiting for any kind of lock and
|
||||
* revive them all. The ones that are still blocked will block again when
|
||||
|
||||
@@ -40,33 +40,33 @@ EXTERN unsigned long calls_stats[NCALLS];
|
||||
#endif
|
||||
|
||||
/* Thread related prototypes */
|
||||
FORWARD void thread_cleanup_f(struct fproc *rfp, char *f, int l);
|
||||
static void thread_cleanup_f(struct fproc *rfp, char *f, int l);
|
||||
#define thread_cleanup(x) thread_cleanup_f(x, __FILE__, __LINE__)
|
||||
FORWARD void *do_async_dev_result(void *arg);
|
||||
FORWARD void *do_control_msgs(void *arg);
|
||||
FORWARD void *do_fs_reply(struct job *job);
|
||||
FORWARD void *do_work(void *arg);
|
||||
FORWARD void *do_pm(void *arg);
|
||||
FORWARD void *do_init_root(void *arg);
|
||||
FORWARD void handle_work(void *(*func)(void *arg));
|
||||
static void *do_async_dev_result(void *arg);
|
||||
static void *do_control_msgs(void *arg);
|
||||
static void *do_fs_reply(struct job *job);
|
||||
static void *do_work(void *arg);
|
||||
static void *do_pm(void *arg);
|
||||
static void *do_init_root(void *arg);
|
||||
static void handle_work(void *(*func)(void *arg));
|
||||
|
||||
FORWARD void get_work(void);
|
||||
FORWARD void lock_pm(void);
|
||||
FORWARD void unlock_pm(void);
|
||||
FORWARD void service_pm(void);
|
||||
FORWARD void service_pm_postponed(void);
|
||||
FORWARD int unblock(struct fproc *rfp);
|
||||
static void get_work(void);
|
||||
static void lock_pm(void);
|
||||
static void unlock_pm(void);
|
||||
static void service_pm(void);
|
||||
static void service_pm_postponed(void);
|
||||
static int unblock(struct fproc *rfp);
|
||||
|
||||
/* SEF functions and variables. */
|
||||
FORWARD void sef_local_startup(void);
|
||||
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
PRIVATE mutex_t pm_lock;
|
||||
PRIVATE endpoint_t receive_from;
|
||||
static void sef_local_startup(void);
|
||||
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
|
||||
static mutex_t pm_lock;
|
||||
static endpoint_t receive_from;
|
||||
|
||||
/*===========================================================================*
|
||||
* main *
|
||||
*===========================================================================*/
|
||||
PUBLIC int main(void)
|
||||
int main(void)
|
||||
{
|
||||
/* This is the main program of the file system. The main loop consists of
|
||||
* three major activities: getting new work, processing the work, and sending
|
||||
@@ -136,7 +136,7 @@ PUBLIC int main(void)
|
||||
/*===========================================================================*
|
||||
* handle_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void handle_work(void *(*func)(void *arg))
|
||||
static void handle_work(void *(*func)(void *arg))
|
||||
{
|
||||
/* Handle asynchronous device replies and new system calls. If the originating
|
||||
* endpoint is an FS endpoint, take extra care not to get in deadlock. */
|
||||
@@ -177,7 +177,7 @@ PRIVATE void handle_work(void *(*func)(void *arg))
|
||||
/*===========================================================================*
|
||||
* do_async_dev_result *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_async_dev_result(void *arg)
|
||||
static void *do_async_dev_result(void *arg)
|
||||
{
|
||||
endpoint_t endpt;
|
||||
struct job my_job;
|
||||
@@ -227,7 +227,7 @@ PRIVATE void *do_async_dev_result(void *arg)
|
||||
/*===========================================================================*
|
||||
* do_control_msgs *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_control_msgs(void *arg)
|
||||
static void *do_control_msgs(void *arg)
|
||||
{
|
||||
struct job my_job;
|
||||
|
||||
@@ -254,7 +254,7 @@ PRIVATE void *do_control_msgs(void *arg)
|
||||
/*===========================================================================*
|
||||
* do_fs_reply *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_fs_reply(struct job *job)
|
||||
static void *do_fs_reply(struct job *job)
|
||||
{
|
||||
struct vmnt *vmp;
|
||||
struct fproc *rfp;
|
||||
@@ -281,7 +281,7 @@ PRIVATE void *do_fs_reply(struct job *job)
|
||||
/*===========================================================================*
|
||||
* lock_pm *
|
||||
*===========================================================================*/
|
||||
PRIVATE void lock_pm(void)
|
||||
static void lock_pm(void)
|
||||
{
|
||||
message org_m_in;
|
||||
struct fproc *org_fp;
|
||||
@@ -306,7 +306,7 @@ PRIVATE void lock_pm(void)
|
||||
/*===========================================================================*
|
||||
* unlock_pm *
|
||||
*===========================================================================*/
|
||||
PRIVATE void unlock_pm(void)
|
||||
static void unlock_pm(void)
|
||||
{
|
||||
if (mutex_unlock(&pm_lock) != 0)
|
||||
panic("Could not release lock on pm");
|
||||
@@ -315,7 +315,7 @@ PRIVATE void unlock_pm(void)
|
||||
/*===========================================================================*
|
||||
* do_pm *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_pm(void *arg)
|
||||
static void *do_pm(void *arg)
|
||||
{
|
||||
struct job my_job;
|
||||
struct fproc *rfp;
|
||||
@@ -335,7 +335,7 @@ PRIVATE void *do_pm(void *arg)
|
||||
/*===========================================================================*
|
||||
* do_pending_pipe *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_pending_pipe(void *arg)
|
||||
static void *do_pending_pipe(void *arg)
|
||||
{
|
||||
int r, op;
|
||||
struct job my_job;
|
||||
@@ -370,7 +370,7 @@ PRIVATE void *do_pending_pipe(void *arg)
|
||||
/*===========================================================================*
|
||||
* do_dummy *
|
||||
*===========================================================================*/
|
||||
PUBLIC void *do_dummy(void *arg)
|
||||
void *do_dummy(void *arg)
|
||||
{
|
||||
struct job my_job;
|
||||
int r;
|
||||
@@ -391,7 +391,7 @@ PUBLIC void *do_dummy(void *arg)
|
||||
/*===========================================================================*
|
||||
* do_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_work(void *arg)
|
||||
static void *do_work(void *arg)
|
||||
{
|
||||
int error;
|
||||
struct job my_job;
|
||||
@@ -458,7 +458,7 @@ PRIVATE void *do_work(void *arg)
|
||||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void sef_local_startup()
|
||||
static void sef_local_startup()
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
@@ -473,7 +473,7 @@ PRIVATE void sef_local_startup()
|
||||
/*===========================================================================*
|
||||
* sef_cb_init_fresh *
|
||||
*===========================================================================*/
|
||||
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
|
||||
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
|
||||
{
|
||||
/* Initialize the virtual file server. */
|
||||
int s, i;
|
||||
@@ -585,7 +585,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info)
|
||||
/*===========================================================================*
|
||||
* do_init_root *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *do_init_root(void *arg)
|
||||
static void *do_init_root(void *arg)
|
||||
{
|
||||
struct fproc *rfp;
|
||||
struct job my_job;
|
||||
@@ -619,7 +619,7 @@ PRIVATE void *do_init_root(void *arg)
|
||||
/*===========================================================================*
|
||||
* lock_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC void lock_proc(struct fproc *rfp, int force_lock)
|
||||
void lock_proc(struct fproc *rfp, int force_lock)
|
||||
{
|
||||
int r;
|
||||
message org_m_in;
|
||||
@@ -649,7 +649,7 @@ PUBLIC void lock_proc(struct fproc *rfp, int force_lock)
|
||||
/*===========================================================================*
|
||||
* unlock_proc *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlock_proc(struct fproc *rfp)
|
||||
void unlock_proc(struct fproc *rfp)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -660,7 +660,7 @@ PUBLIC void unlock_proc(struct fproc *rfp)
|
||||
/*===========================================================================*
|
||||
* thread_cleanup *
|
||||
*===========================================================================*/
|
||||
PRIVATE void thread_cleanup_f(struct fproc *rfp, char *f, int l)
|
||||
static void thread_cleanup_f(struct fproc *rfp, char *f, int l)
|
||||
{
|
||||
/* Clean up worker thread. Skip parts if this thread is not associated
|
||||
* with a particular process (i.e., rfp is NULL) */
|
||||
@@ -702,7 +702,7 @@ PRIVATE void thread_cleanup_f(struct fproc *rfp, char *f, int l)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work()
|
||||
static void get_work()
|
||||
{
|
||||
/* Normally wait for new input. However, if 'reviving' is
|
||||
* nonzero, a suspended process must be awakened.
|
||||
@@ -770,7 +770,7 @@ PRIVATE void get_work()
|
||||
/*===========================================================================*
|
||||
* reply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void reply(whom, result)
|
||||
void reply(whom, result)
|
||||
int whom; /* process to reply to */
|
||||
int result; /* result of the call (usually OK or error #) */
|
||||
{
|
||||
@@ -787,7 +787,7 @@ int result; /* result of the call (usually OK or error #) */
|
||||
/*===========================================================================*
|
||||
* service_pm_postponed *
|
||||
*===========================================================================*/
|
||||
PRIVATE void service_pm_postponed(void)
|
||||
static void service_pm_postponed(void)
|
||||
{
|
||||
int r;
|
||||
vir_bytes pc;
|
||||
@@ -842,7 +842,7 @@ PRIVATE void service_pm_postponed(void)
|
||||
/*===========================================================================*
|
||||
* service_pm *
|
||||
*===========================================================================*/
|
||||
PRIVATE void service_pm()
|
||||
static void service_pm()
|
||||
{
|
||||
int r, slot;
|
||||
|
||||
@@ -956,7 +956,7 @@ PRIVATE void service_pm()
|
||||
/*===========================================================================*
|
||||
* unblock *
|
||||
*===========================================================================*/
|
||||
PRIVATE int unblock(rfp)
|
||||
static int unblock(rfp)
|
||||
struct fproc *rfp;
|
||||
{
|
||||
int blocked_on;
|
||||
|
||||
@@ -44,22 +44,22 @@
|
||||
#define CORE_MODE 0777 /* mode to use on core image files */
|
||||
|
||||
#if ENABLE_SYSCALL_STATS
|
||||
PUBLIC unsigned long calls_stats[NCALLS];
|
||||
unsigned long calls_stats[NCALLS];
|
||||
#endif
|
||||
|
||||
FORWARD void free_proc(struct fproc *freed, int flags);
|
||||
static void free_proc(struct fproc *freed, int flags);
|
||||
/*
|
||||
FORWARD int dumpcore(int proc_e, struct mem_map *seg_ptr);
|
||||
FORWARD int write_bytes(struct inode *rip, off_t off, char *buf, size_t
|
||||
static int dumpcore(int proc_e, struct mem_map *seg_ptr);
|
||||
static int write_bytes(struct inode *rip, off_t off, char *buf, size_t
|
||||
bytes);
|
||||
FORWARD int write_seg(struct inode *rip, off_t off, int proc_e, int seg,
|
||||
static int write_seg(struct inode *rip, off_t off, int proc_e, int seg,
|
||||
off_t seg_off, phys_bytes seg_bytes);
|
||||
*/
|
||||
|
||||
/*===========================================================================*
|
||||
* do_getsysinfo *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getsysinfo()
|
||||
int do_getsysinfo()
|
||||
{
|
||||
vir_bytes src_addr, dst_addr;
|
||||
size_t len;
|
||||
@@ -100,7 +100,7 @@ PUBLIC int do_getsysinfo()
|
||||
/*===========================================================================*
|
||||
* do_dup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_dup()
|
||||
int do_dup()
|
||||
{
|
||||
/* Perform the dup(fd) or dup2(fd,fd2) system call. These system calls are
|
||||
* obsolete. In fact, it is not even possible to invoke them using the
|
||||
@@ -150,7 +150,7 @@ PUBLIC int do_dup()
|
||||
/*===========================================================================*
|
||||
* do_fcntl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fcntl()
|
||||
int do_fcntl()
|
||||
{
|
||||
/* Perform the fcntl(fd, request, ...) system call. */
|
||||
|
||||
@@ -284,7 +284,7 @@ PUBLIC int do_fcntl()
|
||||
/*===========================================================================*
|
||||
* do_sync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_sync()
|
||||
int do_sync()
|
||||
{
|
||||
struct vmnt *vmp;
|
||||
int r = OK;
|
||||
@@ -305,7 +305,7 @@ PUBLIC int do_sync()
|
||||
/*===========================================================================*
|
||||
* do_fsync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fsync()
|
||||
int do_fsync()
|
||||
{
|
||||
/* Perform the fsync() system call. */
|
||||
struct filp *rfilp;
|
||||
@@ -334,7 +334,7 @@ PUBLIC int do_fsync()
|
||||
/*===========================================================================*
|
||||
* pm_reboot *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_reboot()
|
||||
void pm_reboot()
|
||||
{
|
||||
/* Perform the VFS side of the reboot call. */
|
||||
int i;
|
||||
@@ -364,7 +364,7 @@ PUBLIC void pm_reboot()
|
||||
/*===========================================================================*
|
||||
* pm_fork *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_fork(pproc, cproc, cpid)
|
||||
void pm_fork(pproc, cproc, cpid)
|
||||
int pproc; /* Parent process */
|
||||
int cproc; /* Child process */
|
||||
int cpid; /* Child process id */
|
||||
@@ -431,7 +431,7 @@ int cpid; /* Child process id */
|
||||
/*===========================================================================*
|
||||
* free_proc *
|
||||
*===========================================================================*/
|
||||
PRIVATE void free_proc(struct fproc *exiter, int flags)
|
||||
static void free_proc(struct fproc *exiter, int flags)
|
||||
{
|
||||
int i;
|
||||
register struct fproc *rfp;
|
||||
@@ -509,7 +509,7 @@ PRIVATE void free_proc(struct fproc *exiter, int flags)
|
||||
/*===========================================================================*
|
||||
* pm_exit *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_exit(proc)
|
||||
void pm_exit(proc)
|
||||
int proc;
|
||||
{
|
||||
/* Perform the file system portion of the exit(status) system call. */
|
||||
@@ -524,7 +524,7 @@ int proc;
|
||||
/*===========================================================================*
|
||||
* pm_setgid *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_setgid(proc_e, egid, rgid)
|
||||
void pm_setgid(proc_e, egid, rgid)
|
||||
int proc_e;
|
||||
int egid;
|
||||
int rgid;
|
||||
@@ -543,7 +543,7 @@ int rgid;
|
||||
/*===========================================================================*
|
||||
* pm_setgroups *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_setgroups(proc_e, ngroups, groups)
|
||||
void pm_setgroups(proc_e, ngroups, groups)
|
||||
int proc_e;
|
||||
int ngroups;
|
||||
gid_t *groups;
|
||||
@@ -566,7 +566,7 @@ gid_t *groups;
|
||||
/*===========================================================================*
|
||||
* pm_setuid *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pm_setuid(proc_e, euid, ruid)
|
||||
void pm_setuid(proc_e, euid, ruid)
|
||||
int proc_e;
|
||||
int euid;
|
||||
int ruid;
|
||||
@@ -584,7 +584,7 @@ int ruid;
|
||||
/*===========================================================================*
|
||||
* do_svrctl *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_svrctl()
|
||||
int do_svrctl()
|
||||
{
|
||||
switch (m_in.svrctl_req) {
|
||||
/* No control request implemented yet. */
|
||||
@@ -596,7 +596,7 @@ PUBLIC int do_svrctl()
|
||||
/*===========================================================================*
|
||||
* pm_dumpcore *
|
||||
*===========================================================================*/
|
||||
PUBLIC int pm_dumpcore(endpoint_t proc_e, int csig, vir_bytes exe_name)
|
||||
int pm_dumpcore(endpoint_t proc_e, int csig, vir_bytes exe_name)
|
||||
{
|
||||
int slot, r, core_fd;
|
||||
struct filp *f;
|
||||
@@ -629,7 +629,7 @@ PUBLIC int pm_dumpcore(endpoint_t proc_e, int csig, vir_bytes exe_name)
|
||||
/*===========================================================================*
|
||||
* ds_event *
|
||||
*===========================================================================*/
|
||||
PUBLIC void ds_event(void)
|
||||
void ds_event(void)
|
||||
{
|
||||
char key[DS_MAX_KEYLEN];
|
||||
char *blkdrv_prefix = "drv.blk.";
|
||||
|
||||
@@ -33,22 +33,22 @@
|
||||
#include "param.h"
|
||||
|
||||
/* Allow the root to be replaced before the first 'real' mount. */
|
||||
PRIVATE int have_root = 0;
|
||||
static int have_root = 0;
|
||||
|
||||
/* Bitmap of in-use "none" pseudo devices. */
|
||||
PRIVATE bitchunk_t nonedev[BITMAP_CHUNKS(NR_NONEDEVS)] = { 0 };
|
||||
static bitchunk_t nonedev[BITMAP_CHUNKS(NR_NONEDEVS)] = { 0 };
|
||||
|
||||
#define alloc_nonedev(dev) SET_BIT(nonedev, minor(dev) - 1)
|
||||
#define free_nonedev(dev) UNSET_BIT(nonedev, minor(dev) - 1)
|
||||
|
||||
FORWARD dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]);
|
||||
FORWARD dev_t find_free_nonedev(void);
|
||||
FORWARD void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e);
|
||||
static dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX]);
|
||||
static dev_t find_free_nonedev(void);
|
||||
static void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e);
|
||||
|
||||
/*===========================================================================*
|
||||
* update_bspec *
|
||||
*===========================================================================*/
|
||||
PRIVATE void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e)
|
||||
static void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e)
|
||||
{
|
||||
/* Update all block special files for a certain device, to use a new FS endpt
|
||||
* to route raw block I/O requests through.
|
||||
@@ -86,7 +86,7 @@ PRIVATE void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e)
|
||||
/*===========================================================================*
|
||||
* do_fsready *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fsready()
|
||||
int do_fsready()
|
||||
{
|
||||
/* deprecated */
|
||||
return(SUSPEND);
|
||||
@@ -95,7 +95,7 @@ PUBLIC int do_fsready()
|
||||
/*===========================================================================*
|
||||
* do_mount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_mount()
|
||||
int do_mount()
|
||||
{
|
||||
/* Perform the mount(name, mfile, mount_flags) system call. */
|
||||
endpoint_t fs_e;
|
||||
@@ -156,7 +156,7 @@ PUBLIC int do_mount()
|
||||
/*===========================================================================*
|
||||
* mount_fs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int mount_fs(
|
||||
int mount_fs(
|
||||
dev_t dev,
|
||||
char mountpoint[PATH_MAX],
|
||||
endpoint_t fs_e,
|
||||
@@ -378,7 +378,7 @@ char mount_label[LABEL_MAX] )
|
||||
/*===========================================================================*
|
||||
* mount_pfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC void mount_pfs(void)
|
||||
void mount_pfs(void)
|
||||
{
|
||||
/* Mount the Pipe File Server. It's not really mounted onto the file system,
|
||||
but it's necessary it has a vmnt entry to make locking easier */
|
||||
@@ -406,7 +406,7 @@ PUBLIC void mount_pfs(void)
|
||||
/*===========================================================================*
|
||||
* do_umount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_umount(void)
|
||||
int do_umount(void)
|
||||
{
|
||||
/* Perform the umount(name) system call. */
|
||||
char label[LABEL_MAX];
|
||||
@@ -438,7 +438,7 @@ PUBLIC int do_umount(void)
|
||||
/*===========================================================================*
|
||||
* unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int unmount(
|
||||
int unmount(
|
||||
dev_t dev, /* block-special device */
|
||||
char *label /* buffer to retrieve label, or NULL */
|
||||
)
|
||||
@@ -517,7 +517,7 @@ PUBLIC int unmount(
|
||||
/*===========================================================================*
|
||||
* unmount_all *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unmount_all(void)
|
||||
void unmount_all(void)
|
||||
{
|
||||
/* Unmount all filesystems. File systems are mounted on other file systems,
|
||||
* so you have to pull off the loose bits repeatedly to get it all undone.
|
||||
@@ -543,7 +543,7 @@ PUBLIC void unmount_all(void)
|
||||
/*===========================================================================*
|
||||
* name_to_dev *
|
||||
*===========================================================================*/
|
||||
PRIVATE dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX])
|
||||
static dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX])
|
||||
{
|
||||
/* Convert the block special file in 'user_fullpath' to a device number.
|
||||
* If the given path is not a block special file, but 'allow_mountpt' is set
|
||||
@@ -581,7 +581,7 @@ PRIVATE dev_t name_to_dev(int allow_mountpt, char path[PATH_MAX])
|
||||
/*===========================================================================*
|
||||
* is_nonedev *
|
||||
*===========================================================================*/
|
||||
PUBLIC int is_nonedev(dev_t dev)
|
||||
int is_nonedev(dev_t dev)
|
||||
{
|
||||
/* Return whether the given device is a "none" pseudo device.
|
||||
*/
|
||||
@@ -594,7 +594,7 @@ PUBLIC int is_nonedev(dev_t dev)
|
||||
/*===========================================================================*
|
||||
* find_free_nonedev *
|
||||
*===========================================================================*/
|
||||
PRIVATE dev_t find_free_nonedev(void)
|
||||
static dev_t find_free_nonedev(void)
|
||||
{
|
||||
/* Find a free "none" pseudo device. Do not allocate it yet.
|
||||
*/
|
||||
|
||||
@@ -32,17 +32,17 @@
|
||||
#include "vmnt.h"
|
||||
#include "path.h"
|
||||
|
||||
PUBLIC char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
|
||||
char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
|
||||
|
||||
FORWARD struct vnode *new_node(struct lookup *resolve, int oflags,
|
||||
static struct vnode *new_node(struct lookup *resolve, int oflags,
|
||||
mode_t bits);
|
||||
FORWARD int pipe_open(struct vnode *vp, mode_t bits, int oflags);
|
||||
static int pipe_open(struct vnode *vp, mode_t bits, int oflags);
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* do_creat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_creat()
|
||||
int do_creat()
|
||||
{
|
||||
/* Perform the creat(name, mode) system call. */
|
||||
int r;
|
||||
@@ -58,7 +58,7 @@ PUBLIC int do_creat()
|
||||
/*===========================================================================*
|
||||
* do_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_open()
|
||||
int do_open()
|
||||
{
|
||||
/* Perform the open(name, flags,...) system call. */
|
||||
int create_mode = 0; /* is really mode_t but this gives problems */
|
||||
@@ -82,7 +82,7 @@ PUBLIC int do_open()
|
||||
/*===========================================================================*
|
||||
* common_open *
|
||||
*===========================================================================*/
|
||||
PUBLIC int common_open(char path[PATH_MAX], int oflags, mode_t omode)
|
||||
int common_open(char path[PATH_MAX], int oflags, mode_t omode)
|
||||
{
|
||||
/* Common code from do_creat and do_open. */
|
||||
int b, r, exist = TRUE, major_dev;
|
||||
@@ -288,7 +288,7 @@ PUBLIC int common_open(char path[PATH_MAX], int oflags, mode_t omode)
|
||||
/*===========================================================================*
|
||||
* new_node *
|
||||
*===========================================================================*/
|
||||
PRIVATE struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits)
|
||||
static struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits)
|
||||
{
|
||||
/* Try to create a new inode and return a pointer to it. If the inode already
|
||||
exists, return a pointer to it as well, but set err_code accordingly.
|
||||
@@ -466,7 +466,7 @@ PRIVATE struct vnode *new_node(struct lookup *resolve, int oflags, mode_t bits)
|
||||
/*===========================================================================*
|
||||
* pipe_open *
|
||||
*===========================================================================*/
|
||||
PRIVATE int pipe_open(struct vnode *vp, mode_t bits, int oflags)
|
||||
static int pipe_open(struct vnode *vp, mode_t bits, int oflags)
|
||||
{
|
||||
/* This function is called from common_open. It checks if
|
||||
* there is at least one reader/writer pair for the pipe, if not
|
||||
@@ -499,7 +499,7 @@ PRIVATE int pipe_open(struct vnode *vp, mode_t bits, int oflags)
|
||||
/*===========================================================================*
|
||||
* do_mknod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_mknod()
|
||||
int do_mknod()
|
||||
{
|
||||
/* Perform the mknod(name, mode, addr) system call. */
|
||||
register mode_t bits, mode_bits;
|
||||
@@ -543,7 +543,7 @@ PUBLIC int do_mknod()
|
||||
/*===========================================================================*
|
||||
* do_mkdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_mkdir()
|
||||
int do_mkdir()
|
||||
{
|
||||
/* Perform the mkdir(name, mode) system call. */
|
||||
mode_t bits; /* mode bits for the new inode */
|
||||
@@ -579,7 +579,7 @@ PUBLIC int do_mkdir()
|
||||
/*===========================================================================*
|
||||
* do_lseek *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_lseek()
|
||||
int do_lseek()
|
||||
{
|
||||
/* Perform the lseek(ls_fd, offset, whence) system call. */
|
||||
register struct filp *rfilp;
|
||||
@@ -635,7 +635,7 @@ PUBLIC int do_lseek()
|
||||
/*===========================================================================*
|
||||
* do_llseek *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_llseek()
|
||||
int do_llseek()
|
||||
{
|
||||
/* Perform the llseek(ls_fd, offset, whence) system call. */
|
||||
register struct filp *rfilp;
|
||||
@@ -687,7 +687,7 @@ PUBLIC int do_llseek()
|
||||
/*===========================================================================*
|
||||
* do_close *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_close()
|
||||
int do_close()
|
||||
{
|
||||
/* Perform the close(fd) system call. */
|
||||
|
||||
@@ -698,7 +698,7 @@ PUBLIC int do_close()
|
||||
/*===========================================================================*
|
||||
* close_fd *
|
||||
*===========================================================================*/
|
||||
PUBLIC int close_fd(rfp, fd_nr)
|
||||
int close_fd(rfp, fd_nr)
|
||||
struct fproc *rfp;
|
||||
int fd_nr;
|
||||
{
|
||||
@@ -737,7 +737,7 @@ int fd_nr;
|
||||
/*===========================================================================*
|
||||
* close_reply *
|
||||
*===========================================================================*/
|
||||
PUBLIC void close_reply()
|
||||
void close_reply()
|
||||
{
|
||||
/* No need to do anything */
|
||||
}
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
*/
|
||||
#define DO_POSIX_PATHNAME_RES 0
|
||||
|
||||
FORWARD int lookup(struct vnode *dirp, struct lookup *resolve,
|
||||
static int lookup(struct vnode *dirp, struct lookup *resolve,
|
||||
node_details_t *node, struct fproc *rfp);
|
||||
FORWARD int check_perms(endpoint_t ep, cp_grant_id_t io_gr, size_t
|
||||
static int check_perms(endpoint_t ep, cp_grant_id_t io_gr, size_t
|
||||
pathlen);
|
||||
|
||||
/*===========================================================================*
|
||||
* advance *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vnode *advance(dirp, resolve, rfp)
|
||||
struct vnode *advance(dirp, resolve, rfp)
|
||||
struct vnode *dirp;
|
||||
struct lookup *resolve;
|
||||
struct fproc *rfp;
|
||||
@@ -136,7 +136,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* eat_path *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vnode *eat_path(resolve, rfp)
|
||||
struct vnode *eat_path(resolve, rfp)
|
||||
struct lookup *resolve;
|
||||
struct fproc *rfp;
|
||||
{
|
||||
@@ -150,7 +150,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* last_dir *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vnode *last_dir(resolve, rfp)
|
||||
struct vnode *last_dir(resolve, rfp)
|
||||
struct lookup *resolve;
|
||||
struct fproc *rfp;
|
||||
{
|
||||
@@ -334,7 +334,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* lookup *
|
||||
*===========================================================================*/
|
||||
PRIVATE int lookup(start_node, resolve, result_node, rfp)
|
||||
static int lookup(start_node, resolve, result_node, rfp)
|
||||
struct vnode *start_node;
|
||||
struct lookup *resolve;
|
||||
node_details_t *result_node;
|
||||
@@ -517,7 +517,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* lookup_init *
|
||||
*===========================================================================*/
|
||||
PUBLIC void lookup_init(resolve, path, flags, vmp, vp)
|
||||
void lookup_init(resolve, path, flags, vmp, vp)
|
||||
struct lookup *resolve;
|
||||
char *path;
|
||||
int flags;
|
||||
@@ -540,7 +540,7 @@ struct vnode **vp;
|
||||
/*===========================================================================*
|
||||
* get_name *
|
||||
*===========================================================================*/
|
||||
PUBLIC int get_name(dirp, entry, ename)
|
||||
int get_name(dirp, entry, ename)
|
||||
struct vnode *dirp;
|
||||
struct vnode *entry;
|
||||
char ename[NAME_MAX + 1];
|
||||
@@ -589,7 +589,7 @@ char ename[NAME_MAX + 1];
|
||||
/*===========================================================================*
|
||||
* canonical_path *
|
||||
*===========================================================================*/
|
||||
PUBLIC int canonical_path(orig_path, rfp)
|
||||
int canonical_path(orig_path, rfp)
|
||||
char orig_path[PATH_MAX];
|
||||
struct fproc *rfp;
|
||||
{
|
||||
@@ -733,7 +733,7 @@ struct fproc *rfp;
|
||||
/*===========================================================================*
|
||||
* check_perms *
|
||||
*===========================================================================*/
|
||||
PRIVATE int check_perms(ep, io_gr, pathlen)
|
||||
static int check_perms(ep, io_gr, pathlen)
|
||||
endpoint_t ep;
|
||||
cp_grant_id_t io_gr;
|
||||
size_t pathlen;
|
||||
@@ -784,7 +784,7 @@ size_t pathlen;
|
||||
/*===========================================================================*
|
||||
* do_check_perms *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_check_perms(void)
|
||||
int do_check_perms(void)
|
||||
{
|
||||
return check_perms(m_in.USER_ENDPT, (cp_grant_id_t) m_in.IO_GRANT,
|
||||
(size_t) m_in.COUNT);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/*===========================================================================*
|
||||
* do_pipe *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_pipe()
|
||||
int do_pipe()
|
||||
{
|
||||
/* Perform the pipe(fil_des) system call. */
|
||||
|
||||
@@ -135,7 +135,7 @@ PUBLIC int do_pipe()
|
||||
/*===========================================================================*
|
||||
* map_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int map_vnode(vp, map_to_fs_e)
|
||||
int map_vnode(vp, map_to_fs_e)
|
||||
struct vnode *vp;
|
||||
endpoint_t map_to_fs_e;
|
||||
{
|
||||
@@ -173,7 +173,7 @@ endpoint_t map_to_fs_e;
|
||||
/*===========================================================================*
|
||||
* pipe_check *
|
||||
*===========================================================================*/
|
||||
PUBLIC int pipe_check(vp, rw_flag, oflags, bytes, position, notouch)
|
||||
int pipe_check(vp, rw_flag, oflags, bytes, position, notouch)
|
||||
register struct vnode *vp; /* the inode of the pipe */
|
||||
int rw_flag; /* READING or WRITING */
|
||||
int oflags; /* flags set by open or fcntl */
|
||||
@@ -274,7 +274,7 @@ int notouch; /* check only */
|
||||
/*===========================================================================*
|
||||
* suspend *
|
||||
*===========================================================================*/
|
||||
PUBLIC void suspend(int why)
|
||||
void suspend(int why)
|
||||
{
|
||||
/* Take measures to suspend the processing of the present system call.
|
||||
* Store the parameters to be used upon resuming in the process table.
|
||||
@@ -306,7 +306,7 @@ PUBLIC void suspend(int why)
|
||||
/*===========================================================================*
|
||||
* wait_for *
|
||||
*===========================================================================*/
|
||||
PUBLIC void wait_for(endpoint_t who)
|
||||
void wait_for(endpoint_t who)
|
||||
{
|
||||
if(who == NONE || who == ANY)
|
||||
panic("suspend on NONE or ANY");
|
||||
@@ -318,7 +318,7 @@ PUBLIC void wait_for(endpoint_t who)
|
||||
/*===========================================================================*
|
||||
* pipe_suspend *
|
||||
*===========================================================================*/
|
||||
PUBLIC void pipe_suspend(filp, buf, size)
|
||||
void pipe_suspend(filp, buf, size)
|
||||
struct filp *filp;
|
||||
char *buf;
|
||||
size_t size;
|
||||
@@ -341,7 +341,7 @@ size_t size;
|
||||
/*===========================================================================*
|
||||
* unsuspend_by_endpt *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unsuspend_by_endpt(endpoint_t proc_e)
|
||||
void unsuspend_by_endpt(endpoint_t proc_e)
|
||||
{
|
||||
/* Revive processes waiting for drivers (SUSPENDed) that have disappeared with
|
||||
* return code EAGAIN.
|
||||
@@ -364,7 +364,7 @@ PUBLIC void unsuspend_by_endpt(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* release *
|
||||
*===========================================================================*/
|
||||
PUBLIC void release(vp, op, count)
|
||||
void release(vp, op, count)
|
||||
register struct vnode *vp; /* inode of pipe */
|
||||
int op; /* READ, WRITE, OPEN or CREAT */
|
||||
int count; /* max number of processes to release */
|
||||
@@ -434,7 +434,7 @@ int count; /* max number of processes to release */
|
||||
/*===========================================================================*
|
||||
* revive *
|
||||
*===========================================================================*/
|
||||
PUBLIC void revive(proc_nr_e, returned)
|
||||
void revive(proc_nr_e, returned)
|
||||
int proc_nr_e; /* process to revive */
|
||||
int returned; /* if hanging on task, how many bytes read */
|
||||
{
|
||||
@@ -514,7 +514,7 @@ int returned; /* if hanging on task, how many bytes read */
|
||||
/*===========================================================================*
|
||||
* unpause *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unpause(endpoint_t proc_e)
|
||||
void unpause(endpoint_t proc_e)
|
||||
{
|
||||
/* A signal has been sent to a user who is paused on the file system.
|
||||
* Abort the system call with the EINTR error message.
|
||||
@@ -619,7 +619,7 @@ PUBLIC void unpause(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* check_pipe *
|
||||
*===========================================================================*/
|
||||
PUBLIC int check_pipe(void)
|
||||
int check_pipe(void)
|
||||
{
|
||||
/* Integrity check; verify that susp_count equals what the fproc table thinks
|
||||
* is suspended on a pipe */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/*===========================================================================*
|
||||
* do_chmod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_chmod()
|
||||
int do_chmod()
|
||||
{
|
||||
/* Perform the chmod(name, mode) and fchmod(fd, mode) system calls. */
|
||||
|
||||
@@ -87,7 +87,7 @@ PUBLIC int do_chmod()
|
||||
/*===========================================================================*
|
||||
* do_chown *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_chown()
|
||||
int do_chown()
|
||||
{
|
||||
/* Perform the chown(path, owner, group) and fchmod(fd, owner, group) system
|
||||
* calls. */
|
||||
@@ -162,7 +162,7 @@ PUBLIC int do_chown()
|
||||
/*===========================================================================*
|
||||
* do_umask *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_umask()
|
||||
int do_umask()
|
||||
{
|
||||
/* Perform the umask(co_mode) system call. */
|
||||
register mode_t r;
|
||||
@@ -176,7 +176,7 @@ PUBLIC int do_umask()
|
||||
/*===========================================================================*
|
||||
* do_access *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_access()
|
||||
int do_access()
|
||||
{
|
||||
/* Perform the access(name, mode) system call. */
|
||||
int r;
|
||||
@@ -211,7 +211,7 @@ PUBLIC int do_access()
|
||||
/*===========================================================================*
|
||||
* forbidden *
|
||||
*===========================================================================*/
|
||||
PUBLIC int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired)
|
||||
int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired)
|
||||
{
|
||||
/* Given a pointer to an vnode, 'vp', and the access desired, determine
|
||||
* if the access is allowed, and if not why not. The routine looks up the
|
||||
@@ -266,7 +266,7 @@ PUBLIC int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired)
|
||||
/*===========================================================================*
|
||||
* read_only *
|
||||
*===========================================================================*/
|
||||
PUBLIC int read_only(vp)
|
||||
int read_only(vp)
|
||||
struct vnode *vp; /* ptr to inode whose file sys is to be cked */
|
||||
{
|
||||
/* Check to see if the file system on which the inode 'ip' resides is mounted
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/*===========================================================================*
|
||||
* do_read *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_read()
|
||||
int do_read()
|
||||
{
|
||||
return(do_read_write(READING));
|
||||
}
|
||||
@@ -38,7 +38,7 @@ PUBLIC int do_read()
|
||||
/*===========================================================================*
|
||||
* lock_bsf *
|
||||
*===========================================================================*/
|
||||
PUBLIC void lock_bsf(void)
|
||||
void lock_bsf(void)
|
||||
{
|
||||
message org_m_in;
|
||||
struct fproc *org_fp;
|
||||
@@ -62,7 +62,7 @@ PUBLIC void lock_bsf(void)
|
||||
/*===========================================================================*
|
||||
* unlock_bsf *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlock_bsf(void)
|
||||
void unlock_bsf(void)
|
||||
{
|
||||
if (mutex_unlock(&bsf_lock) != 0)
|
||||
panic("failed to unlock block special file lock");
|
||||
@@ -71,7 +71,7 @@ PUBLIC void unlock_bsf(void)
|
||||
/*===========================================================================*
|
||||
* do_read_write *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_read_write(rw_flag)
|
||||
int do_read_write(rw_flag)
|
||||
int rw_flag; /* READING or WRITING */
|
||||
{
|
||||
/* Perform read(fd, buffer, nbytes) or write(fd, buffer, nbytes) call. */
|
||||
@@ -105,7 +105,7 @@ int rw_flag; /* READING or WRITING */
|
||||
/*===========================================================================*
|
||||
* read_write *
|
||||
*===========================================================================*/
|
||||
PUBLIC int read_write(int rw_flag, struct filp *f, char *buf, size_t size,
|
||||
int read_write(int rw_flag, struct filp *f, char *buf, size_t size,
|
||||
endpoint_t for_e)
|
||||
{
|
||||
register struct vnode *vp;
|
||||
@@ -209,7 +209,7 @@ PUBLIC int read_write(int rw_flag, struct filp *f, char *buf, size_t size,
|
||||
/*===========================================================================*
|
||||
* do_getdents *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_getdents()
|
||||
int do_getdents()
|
||||
{
|
||||
/* Perform the getdents(fd, buf, size) system call. */
|
||||
int r = OK;
|
||||
@@ -242,7 +242,7 @@ PUBLIC int do_getdents()
|
||||
/*===========================================================================*
|
||||
* rw_pipe *
|
||||
*===========================================================================*/
|
||||
PUBLIC int rw_pipe(rw_flag, usr_e, f, buf, req_size)
|
||||
int rw_pipe(rw_flag, usr_e, f, buf, req_size)
|
||||
int rw_flag; /* READING or WRITING */
|
||||
endpoint_t usr_e;
|
||||
struct filp *f;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/*===========================================================================*
|
||||
* req_breadwrite *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_breadwrite(
|
||||
int req_breadwrite(
|
||||
endpoint_t fs_e,
|
||||
endpoint_t user_e,
|
||||
dev_t dev,
|
||||
@@ -73,7 +73,7 @@ PUBLIC int req_breadwrite(
|
||||
/*===========================================================================*
|
||||
* req_chmod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_chmod(
|
||||
int req_chmod(
|
||||
int fs_e,
|
||||
ino_t inode_nr,
|
||||
mode_t rmode,
|
||||
@@ -101,7 +101,7 @@ PUBLIC int req_chmod(
|
||||
/*===========================================================================*
|
||||
* req_chown *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_chown(
|
||||
int req_chown(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
uid_t newuid,
|
||||
@@ -131,7 +131,7 @@ PUBLIC int req_chown(
|
||||
/*===========================================================================*
|
||||
* req_create *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_create(
|
||||
int req_create(
|
||||
int fs_e,
|
||||
ino_t inode_nr,
|
||||
int omode,
|
||||
@@ -184,7 +184,7 @@ PUBLIC int req_create(
|
||||
/*===========================================================================*
|
||||
* req_flush *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_flush(endpoint_t fs_e, dev_t dev)
|
||||
int req_flush(endpoint_t fs_e, dev_t dev)
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -200,7 +200,7 @@ PUBLIC int req_flush(endpoint_t fs_e, dev_t dev)
|
||||
/*===========================================================================*
|
||||
* req_fstatfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_fstatfs(int fs_e, int proc_e, char *buf)
|
||||
int req_fstatfs(int fs_e, int proc_e, char *buf)
|
||||
{
|
||||
int r;
|
||||
cp_grant_id_t grant_id;
|
||||
@@ -226,7 +226,7 @@ PUBLIC int req_fstatfs(int fs_e, int proc_e, char *buf)
|
||||
/*===========================================================================*
|
||||
* req_statvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_statvfs(int fs_e, int proc_e, char *buf)
|
||||
int req_statvfs(int fs_e, int proc_e, char *buf)
|
||||
{
|
||||
int r;
|
||||
cp_grant_id_t grant_id;
|
||||
@@ -252,7 +252,7 @@ PUBLIC int req_statvfs(int fs_e, int proc_e, char *buf)
|
||||
/*===========================================================================*
|
||||
* req_ftrunc *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end)
|
||||
int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end)
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -272,7 +272,7 @@ PUBLIC int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end)
|
||||
/*===========================================================================*
|
||||
* req_getdents *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_getdents(
|
||||
int req_getdents(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
u64_t pos,
|
||||
@@ -319,7 +319,7 @@ PUBLIC int req_getdents(
|
||||
/*===========================================================================*
|
||||
* req_inhibread *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_inhibread(endpoint_t fs_e, ino_t inode_nr)
|
||||
int req_inhibread(endpoint_t fs_e, ino_t inode_nr)
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -335,7 +335,7 @@ PUBLIC int req_inhibread(endpoint_t fs_e, ino_t inode_nr)
|
||||
/*===========================================================================*
|
||||
* req_link *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_link(
|
||||
int req_link(
|
||||
endpoint_t fs_e,
|
||||
ino_t link_parent,
|
||||
char *lastc,
|
||||
@@ -369,7 +369,7 @@ PUBLIC int req_link(
|
||||
/*===========================================================================*
|
||||
* req_lookup *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_lookup(
|
||||
int req_lookup(
|
||||
endpoint_t fs_e,
|
||||
ino_t dir_ino,
|
||||
ino_t root_ino,
|
||||
@@ -471,7 +471,7 @@ PUBLIC int req_lookup(
|
||||
/*===========================================================================*
|
||||
* req_mkdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_mkdir(
|
||||
int req_mkdir(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
char *lastc,
|
||||
@@ -510,7 +510,7 @@ PUBLIC int req_mkdir(
|
||||
/*===========================================================================*
|
||||
* req_mknod *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_mknod(
|
||||
int req_mknod(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
char *lastc,
|
||||
@@ -551,7 +551,7 @@ PUBLIC int req_mknod(
|
||||
/*===========================================================================*
|
||||
* req_mountpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_mountpoint(endpoint_t fs_e, ino_t inode_nr)
|
||||
int req_mountpoint(endpoint_t fs_e, ino_t inode_nr)
|
||||
{
|
||||
message m;
|
||||
|
||||
@@ -567,7 +567,7 @@ PUBLIC int req_mountpoint(endpoint_t fs_e, ino_t inode_nr)
|
||||
/*===========================================================================*
|
||||
* req_newnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_newnode(
|
||||
int req_newnode(
|
||||
endpoint_t fs_e,
|
||||
uid_t uid,
|
||||
gid_t gid,
|
||||
@@ -604,7 +604,7 @@ PUBLIC int req_newnode(
|
||||
/*===========================================================================*
|
||||
* req_newdriver *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_newdriver(
|
||||
int req_newdriver(
|
||||
endpoint_t fs_e,
|
||||
dev_t dev,
|
||||
char *label
|
||||
@@ -639,7 +639,7 @@ PUBLIC int req_newdriver(
|
||||
/*===========================================================================*
|
||||
* req_putnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_putnode(fs_e, inode_nr, count)
|
||||
int req_putnode(fs_e, inode_nr, count)
|
||||
int fs_e;
|
||||
ino_t inode_nr;
|
||||
int count;
|
||||
@@ -659,7 +659,7 @@ int count;
|
||||
/*===========================================================================*
|
||||
* req_rdlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_rdlink(fs_e, inode_nr, proc_e, buf, len, direct)
|
||||
int req_rdlink(fs_e, inode_nr, proc_e, buf, len, direct)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
endpoint_t proc_e;
|
||||
@@ -699,7 +699,7 @@ int direct; /* set to 1 to use direct grants instead of magic grants */
|
||||
/*===========================================================================*
|
||||
* req_readsuper *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_readsuper(
|
||||
int req_readsuper(
|
||||
endpoint_t fs_e,
|
||||
char *label,
|
||||
dev_t dev,
|
||||
@@ -750,7 +750,7 @@ PUBLIC int req_readsuper(
|
||||
/*===========================================================================*
|
||||
* req_readwrite *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_readwrite(fs_e, inode_nr, pos, rw_flag, user_e,
|
||||
int req_readwrite(fs_e, inode_nr, pos, rw_flag, user_e,
|
||||
user_addr, num_of_bytes, new_posp, cum_iop)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
@@ -799,7 +799,7 @@ unsigned int *cum_iop;
|
||||
/*===========================================================================*
|
||||
* req_rename *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_rename(fs_e, old_dir, old_name, new_dir, new_name)
|
||||
int req_rename(fs_e, old_dir, old_name, new_dir, new_name)
|
||||
endpoint_t fs_e;
|
||||
ino_t old_dir;
|
||||
char *old_name;
|
||||
@@ -842,7 +842,7 @@ char *new_name;
|
||||
/*===========================================================================*
|
||||
* req_rmdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_rmdir(fs_e, inode_nr, lastc)
|
||||
int req_rmdir(fs_e, inode_nr, lastc)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
char *lastc;
|
||||
@@ -874,7 +874,7 @@ char *lastc;
|
||||
/*===========================================================================*
|
||||
* req_slink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_slink(
|
||||
int req_slink(
|
||||
endpoint_t fs_e,
|
||||
ino_t inode_nr,
|
||||
char *lastc,
|
||||
@@ -924,7 +924,7 @@ PUBLIC int req_slink(
|
||||
/*===========================================================================*
|
||||
* req_stat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_stat(fs_e, inode_nr, proc_e, buf, pos, stat_version)
|
||||
int req_stat(fs_e, inode_nr, proc_e, buf, pos, stat_version)
|
||||
int fs_e;
|
||||
ino_t inode_nr;
|
||||
int proc_e;
|
||||
@@ -1010,7 +1010,7 @@ int stat_version;
|
||||
/*===========================================================================*
|
||||
* req_sync *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_sync(fs_e)
|
||||
int req_sync(fs_e)
|
||||
endpoint_t fs_e;
|
||||
{
|
||||
message m;
|
||||
@@ -1026,7 +1026,7 @@ endpoint_t fs_e;
|
||||
/*===========================================================================*
|
||||
* req_unlink *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_unlink(fs_e, inode_nr, lastc)
|
||||
int req_unlink(fs_e, inode_nr, lastc)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
char *lastc;
|
||||
@@ -1058,7 +1058,7 @@ char *lastc;
|
||||
/*===========================================================================*
|
||||
* req_unmount *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_unmount(fs_e)
|
||||
int req_unmount(fs_e)
|
||||
endpoint_t fs_e;
|
||||
{
|
||||
message m;
|
||||
@@ -1074,7 +1074,7 @@ endpoint_t fs_e;
|
||||
/*===========================================================================*
|
||||
* req_utime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int req_utime(fs_e, inode_nr, actime, modtime)
|
||||
int req_utime(fs_e, inode_nr, actime, modtime)
|
||||
endpoint_t fs_e;
|
||||
ino_t inode_nr;
|
||||
time_t actime;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define FROM_PROC 0
|
||||
#define TO_PROC 1
|
||||
|
||||
PRIVATE struct selectentry {
|
||||
static struct selectentry {
|
||||
struct fproc *requestor; /* slot is free iff this is NULL */
|
||||
endpoint_t req_endpt;
|
||||
fd_set readfds, writefds, errorfds;
|
||||
@@ -39,30 +39,30 @@ PRIVATE struct selectentry {
|
||||
timer_t timer; /* if expiry > 0 */
|
||||
} selecttab[MAXSELECTS];
|
||||
|
||||
FORWARD int copy_fdsets(struct selectentry *se, int nfds, int
|
||||
static int copy_fdsets(struct selectentry *se, int nfds, int
|
||||
direction);
|
||||
FORWARD int do_select_request(struct selectentry *se, int fd, int *ops);
|
||||
FORWARD void filp_status(struct filp *fp, int status);
|
||||
FORWARD int is_deferred(struct selectentry *se);
|
||||
FORWARD void restart_proc(struct selectentry *se);
|
||||
FORWARD void ops2tab(int ops, int fd, struct selectentry *e);
|
||||
FORWARD int is_regular_file(struct filp *f);
|
||||
FORWARD int is_pipe(struct filp *f);
|
||||
FORWARD int is_supported_major(struct filp *f);
|
||||
FORWARD void select_lock_filp(struct filp *f, int ops);
|
||||
FORWARD int select_request_async(struct filp *f, int *ops, int block);
|
||||
FORWARD int select_request_file(struct filp *f, int *ops, int block);
|
||||
FORWARD int select_request_major(struct filp *f, int *ops, int block);
|
||||
FORWARD int select_request_pipe(struct filp *f, int *ops, int block);
|
||||
FORWARD int select_request_sync(struct filp *f, int *ops, int block);
|
||||
FORWARD void select_cancel_all(struct selectentry *e);
|
||||
FORWARD void select_cancel_filp(struct filp *f);
|
||||
FORWARD void select_return(struct selectentry *);
|
||||
FORWARD void select_restart_filps(void);
|
||||
FORWARD int tab2ops(int fd, struct selectentry *e);
|
||||
FORWARD void wipe_select(struct selectentry *s);
|
||||
static int do_select_request(struct selectentry *se, int fd, int *ops);
|
||||
static void filp_status(struct filp *fp, int status);
|
||||
static int is_deferred(struct selectentry *se);
|
||||
static void restart_proc(struct selectentry *se);
|
||||
static void ops2tab(int ops, int fd, struct selectentry *e);
|
||||
static int is_regular_file(struct filp *f);
|
||||
static int is_pipe(struct filp *f);
|
||||
static int is_supported_major(struct filp *f);
|
||||
static void select_lock_filp(struct filp *f, int ops);
|
||||
static int select_request_async(struct filp *f, int *ops, int block);
|
||||
static int select_request_file(struct filp *f, int *ops, int block);
|
||||
static int select_request_major(struct filp *f, int *ops, int block);
|
||||
static int select_request_pipe(struct filp *f, int *ops, int block);
|
||||
static int select_request_sync(struct filp *f, int *ops, int block);
|
||||
static void select_cancel_all(struct selectentry *e);
|
||||
static void select_cancel_filp(struct filp *f);
|
||||
static void select_return(struct selectentry *);
|
||||
static void select_restart_filps(void);
|
||||
static int tab2ops(int fd, struct selectentry *e);
|
||||
static void wipe_select(struct selectentry *s);
|
||||
|
||||
PRIVATE struct fdtype {
|
||||
static struct fdtype {
|
||||
int (*select_request)(struct filp *, int *ops, int block);
|
||||
int (*type_match)(struct filp *f);
|
||||
} fdtypes[] = {
|
||||
@@ -71,7 +71,7 @@ PRIVATE struct fdtype {
|
||||
{ select_request_pipe, is_pipe },
|
||||
};
|
||||
#define SEL_FDS (sizeof(fdtypes) / sizeof(fdtypes[0]))
|
||||
PRIVATE int select_majors[] = { /* List of majors that support selecting on */
|
||||
static int select_majors[] = { /* List of majors that support selecting on */
|
||||
TTY_MAJOR,
|
||||
INET_MAJOR,
|
||||
UDS_MAJOR,
|
||||
@@ -82,7 +82,7 @@ PRIVATE int select_majors[] = { /* List of majors that support selecting on */
|
||||
/*===========================================================================*
|
||||
* do_select *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_select(void)
|
||||
int do_select(void)
|
||||
{
|
||||
/* Implement the select(nfds, readfds, writefds, errorfds, timeout) system
|
||||
* call. First we copy the arguments and verify their sanity. Then we check
|
||||
@@ -270,7 +270,7 @@ PUBLIC int do_select(void)
|
||||
/*===========================================================================*
|
||||
* is_deferred *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_deferred(struct selectentry *se)
|
||||
static int is_deferred(struct selectentry *se)
|
||||
{
|
||||
/* Find out whether this select has pending initial replies */
|
||||
|
||||
@@ -289,7 +289,7 @@ PRIVATE int is_deferred(struct selectentry *se)
|
||||
/*===========================================================================*
|
||||
* is_regular_file *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_regular_file(struct filp *f)
|
||||
static int is_regular_file(struct filp *f)
|
||||
{
|
||||
return(f && f->filp_vno && (f->filp_vno->v_mode & I_TYPE) == I_REGULAR);
|
||||
}
|
||||
@@ -297,7 +297,7 @@ PRIVATE int is_regular_file(struct filp *f)
|
||||
/*===========================================================================*
|
||||
* is_pipe *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_pipe(struct filp *f)
|
||||
static int is_pipe(struct filp *f)
|
||||
{
|
||||
/* Recognize either anonymous pipe or named pipe (FIFO) */
|
||||
return(f && f->filp_vno && (f->filp_vno->v_mode & I_TYPE) == I_NAMED_PIPE);
|
||||
@@ -306,7 +306,7 @@ PRIVATE int is_pipe(struct filp *f)
|
||||
/*===========================================================================*
|
||||
* is_supported_major *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_supported_major(struct filp *f)
|
||||
static int is_supported_major(struct filp *f)
|
||||
{
|
||||
/* See if this filp is a handle on a device on which we support select() */
|
||||
int m;
|
||||
@@ -324,7 +324,7 @@ PRIVATE int is_supported_major(struct filp *f)
|
||||
/*===========================================================================*
|
||||
* select_request_async *
|
||||
*===========================================================================*/
|
||||
PRIVATE int select_request_async(struct filp *f, int *ops, int block)
|
||||
static int select_request_async(struct filp *f, int *ops, int block)
|
||||
{
|
||||
int r, rops, major;
|
||||
struct dmap *dp;
|
||||
@@ -385,7 +385,7 @@ PRIVATE int select_request_async(struct filp *f, int *ops, int block)
|
||||
/*===========================================================================*
|
||||
* select_request_file *
|
||||
*===========================================================================*/
|
||||
PRIVATE int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops),
|
||||
static int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops),
|
||||
int UNUSED(block))
|
||||
{
|
||||
/* Files are always ready, so output *ops is input *ops */
|
||||
@@ -395,7 +395,7 @@ PRIVATE int select_request_file(struct filp *UNUSED(f), int *UNUSED(ops),
|
||||
/*===========================================================================*
|
||||
* select_request_major *
|
||||
*===========================================================================*/
|
||||
PRIVATE int select_request_major(struct filp *f, int *ops, int block)
|
||||
static int select_request_major(struct filp *f, int *ops, int block)
|
||||
{
|
||||
int major, r;
|
||||
|
||||
@@ -414,7 +414,7 @@ PRIVATE int select_request_major(struct filp *f, int *ops, int block)
|
||||
/*===========================================================================*
|
||||
* select_request_sync *
|
||||
*===========================================================================*/
|
||||
PRIVATE int select_request_sync(struct filp *f, int *ops, int block)
|
||||
static int select_request_sync(struct filp *f, int *ops, int block)
|
||||
{
|
||||
int rops;
|
||||
|
||||
@@ -431,7 +431,7 @@ PRIVATE int select_request_sync(struct filp *f, int *ops, int block)
|
||||
/*===========================================================================*
|
||||
* select_request_pipe *
|
||||
*===========================================================================*/
|
||||
PRIVATE int select_request_pipe(struct filp *f, int *ops, int block)
|
||||
static int select_request_pipe(struct filp *f, int *ops, int block)
|
||||
{
|
||||
int orig_ops, r = 0, err;
|
||||
|
||||
@@ -479,7 +479,7 @@ PRIVATE int select_request_pipe(struct filp *f, int *ops, int block)
|
||||
/*===========================================================================*
|
||||
* tab2ops *
|
||||
*===========================================================================*/
|
||||
PRIVATE int tab2ops(int fd, struct selectentry *e)
|
||||
static int tab2ops(int fd, struct selectentry *e)
|
||||
{
|
||||
int ops = 0;
|
||||
if (FD_ISSET(fd, &e->readfds)) ops |= SEL_RD;
|
||||
@@ -493,7 +493,7 @@ PRIVATE int tab2ops(int fd, struct selectentry *e)
|
||||
/*===========================================================================*
|
||||
* ops2tab *
|
||||
*===========================================================================*/
|
||||
PRIVATE void ops2tab(int ops, int fd, struct selectentry *e)
|
||||
static void ops2tab(int ops, int fd, struct selectentry *e)
|
||||
{
|
||||
if ((ops & SEL_RD) && e->vir_readfds && FD_ISSET(fd, &e->readfds) &&
|
||||
!FD_ISSET(fd, &e->ready_readfds)) {
|
||||
@@ -518,7 +518,7 @@ PRIVATE void ops2tab(int ops, int fd, struct selectentry *e)
|
||||
/*===========================================================================*
|
||||
* copy_fdsets *
|
||||
*===========================================================================*/
|
||||
PRIVATE int copy_fdsets(struct selectentry *se, int nfds, int direction)
|
||||
static int copy_fdsets(struct selectentry *se, int nfds, int direction)
|
||||
{
|
||||
int r;
|
||||
size_t fd_setsize;
|
||||
@@ -573,7 +573,7 @@ PRIVATE int copy_fdsets(struct selectentry *se, int nfds, int direction)
|
||||
/*===========================================================================*
|
||||
* select_cancel_all *
|
||||
*===========================================================================*/
|
||||
PRIVATE void select_cancel_all(struct selectentry *se)
|
||||
static void select_cancel_all(struct selectentry *se)
|
||||
{
|
||||
/* Cancel select. Decrease select usage and cancel timer */
|
||||
|
||||
@@ -597,7 +597,7 @@ PRIVATE void select_cancel_all(struct selectentry *se)
|
||||
/*===========================================================================*
|
||||
* select_cancel_filp *
|
||||
*===========================================================================*/
|
||||
PRIVATE void select_cancel_filp(struct filp *f)
|
||||
static void select_cancel_filp(struct filp *f)
|
||||
{
|
||||
/* Reduce number of select users of this filp */
|
||||
|
||||
@@ -622,7 +622,7 @@ PRIVATE void select_cancel_filp(struct filp *f)
|
||||
/*===========================================================================*
|
||||
* select_return *
|
||||
*===========================================================================*/
|
||||
PRIVATE void select_return(struct selectentry *se)
|
||||
static void select_return(struct selectentry *se)
|
||||
{
|
||||
int r, r1;
|
||||
|
||||
@@ -645,7 +645,7 @@ PRIVATE void select_return(struct selectentry *se)
|
||||
/*===========================================================================*
|
||||
* select_callback *
|
||||
*===========================================================================*/
|
||||
PUBLIC void select_callback(struct filp *f, int status)
|
||||
void select_callback(struct filp *f, int status)
|
||||
{
|
||||
filp_status(f, status);
|
||||
}
|
||||
@@ -653,7 +653,7 @@ PUBLIC void select_callback(struct filp *f, int status)
|
||||
/*===========================================================================*
|
||||
* init_select *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_select(void)
|
||||
void init_select(void)
|
||||
{
|
||||
int s;
|
||||
|
||||
@@ -665,7 +665,7 @@ PUBLIC void init_select(void)
|
||||
/*===========================================================================*
|
||||
* select_forget *
|
||||
*===========================================================================*/
|
||||
PUBLIC void select_forget(endpoint_t proc_e)
|
||||
void select_forget(endpoint_t proc_e)
|
||||
{
|
||||
/* Something has happened (e.g. signal delivered that interrupts select()).
|
||||
* Totally forget about the select(). */
|
||||
@@ -690,7 +690,7 @@ PUBLIC void select_forget(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* select_timeout_check *
|
||||
*===========================================================================*/
|
||||
PUBLIC void select_timeout_check(timer_t *timer)
|
||||
void select_timeout_check(timer_t *timer)
|
||||
{
|
||||
int s;
|
||||
struct selectentry *se;
|
||||
@@ -711,7 +711,7 @@ PUBLIC void select_timeout_check(timer_t *timer)
|
||||
/*===========================================================================*
|
||||
* select_unsuspend_by_endpt *
|
||||
*===========================================================================*/
|
||||
PUBLIC void select_unsuspend_by_endpt(endpoint_t proc_e)
|
||||
void select_unsuspend_by_endpt(endpoint_t proc_e)
|
||||
{
|
||||
/* Revive blocked processes when a driver has disappeared */
|
||||
|
||||
@@ -750,7 +750,7 @@ PUBLIC void select_unsuspend_by_endpt(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* select_reply1 *
|
||||
*===========================================================================*/
|
||||
PUBLIC void select_reply1(driver_e, minor, status)
|
||||
void select_reply1(driver_e, minor, status)
|
||||
endpoint_t driver_e;
|
||||
int minor;
|
||||
int status;
|
||||
@@ -842,7 +842,7 @@ int status;
|
||||
/*===========================================================================*
|
||||
* select_reply2 *
|
||||
*===========================================================================*/
|
||||
PUBLIC void select_reply2(driver_e, minor, status)
|
||||
void select_reply2(driver_e, minor, status)
|
||||
endpoint_t driver_e;
|
||||
int minor;
|
||||
int status;
|
||||
@@ -912,7 +912,7 @@ int status;
|
||||
/*===========================================================================*
|
||||
* select_restart_filps *
|
||||
*===========================================================================*/
|
||||
PRIVATE void select_restart_filps()
|
||||
static void select_restart_filps()
|
||||
{
|
||||
int fd, slot;
|
||||
struct filp *f;
|
||||
@@ -954,7 +954,7 @@ PRIVATE void select_restart_filps()
|
||||
/*===========================================================================*
|
||||
* do_select_request *
|
||||
*===========================================================================*/
|
||||
PRIVATE int do_select_request(se, fd, ops)
|
||||
static int do_select_request(se, fd, ops)
|
||||
struct selectentry *se;
|
||||
int fd;
|
||||
int *ops;
|
||||
@@ -981,7 +981,7 @@ int *ops;
|
||||
/*===========================================================================*
|
||||
* filp_status *
|
||||
*===========================================================================*/
|
||||
PRIVATE void filp_status(f, status)
|
||||
static void filp_status(f, status)
|
||||
struct filp *f;
|
||||
int status;
|
||||
{
|
||||
@@ -1007,7 +1007,7 @@ int status;
|
||||
/*===========================================================================*
|
||||
* restart_proc *
|
||||
*===========================================================================*/
|
||||
PRIVATE void restart_proc(se)
|
||||
static void restart_proc(se)
|
||||
struct selectentry *se;
|
||||
{
|
||||
/* Tell process about select results (if any) unless there are still results
|
||||
@@ -1020,7 +1020,7 @@ struct selectentry *se;
|
||||
/*===========================================================================*
|
||||
* wipe_select *
|
||||
*===========================================================================*/
|
||||
PRIVATE void wipe_select(struct selectentry *se)
|
||||
static void wipe_select(struct selectentry *se)
|
||||
{
|
||||
se->nfds = 0;
|
||||
se->nreadyfds = 0;
|
||||
@@ -1039,7 +1039,7 @@ PRIVATE void wipe_select(struct selectentry *se)
|
||||
/*===========================================================================*
|
||||
* select_lock_filp *
|
||||
*===========================================================================*/
|
||||
PRIVATE void select_lock_filp(struct filp *f, int ops)
|
||||
static void select_lock_filp(struct filp *f, int ops)
|
||||
{
|
||||
/* Lock a filp and vnode based on which operations are requested */
|
||||
tll_access_t locktype;;
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
#include "vnode.h"
|
||||
#include "vmnt.h"
|
||||
|
||||
FORWARD int change(struct vnode **iip, char *name_ptr, int len);
|
||||
FORWARD int change_into(struct vnode **iip, struct vnode *vp);
|
||||
static int change(struct vnode **iip, char *name_ptr, int len);
|
||||
static int change_into(struct vnode **iip, struct vnode *vp);
|
||||
|
||||
/*===========================================================================*
|
||||
* do_fchdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fchdir()
|
||||
int do_fchdir()
|
||||
{
|
||||
/* Change directory on already-opened fd. */
|
||||
struct filp *rfilp;
|
||||
@@ -49,7 +49,7 @@ PUBLIC int do_fchdir()
|
||||
/*===========================================================================*
|
||||
* do_chdir *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_chdir()
|
||||
int do_chdir()
|
||||
{
|
||||
/* Perform the chdir(name) system call. */
|
||||
|
||||
@@ -59,7 +59,7 @@ PUBLIC int do_chdir()
|
||||
/*===========================================================================*
|
||||
* do_chroot *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_chroot()
|
||||
int do_chroot()
|
||||
{
|
||||
/* Perform the chroot(name) system call. */
|
||||
|
||||
@@ -70,7 +70,7 @@ PUBLIC int do_chroot()
|
||||
/*===========================================================================*
|
||||
* change *
|
||||
*===========================================================================*/
|
||||
PRIVATE int change(iip, name_ptr, len)
|
||||
static int change(iip, name_ptr, len)
|
||||
struct vnode **iip; /* pointer to the inode pointer for the dir */
|
||||
char *name_ptr; /* pointer to the directory name to change to */
|
||||
int len; /* length of the directory name string */
|
||||
@@ -99,7 +99,7 @@ int len; /* length of the directory name string */
|
||||
/*===========================================================================*
|
||||
* change_into *
|
||||
*===========================================================================*/
|
||||
PRIVATE int change_into(iip, vp)
|
||||
static int change_into(iip, vp)
|
||||
struct vnode **iip; /* pointer to the inode pointer for the dir */
|
||||
struct vnode *vp; /* this is what the inode has to become */
|
||||
{
|
||||
@@ -124,7 +124,7 @@ struct vnode *vp; /* this is what the inode has to become */
|
||||
/*===========================================================================*
|
||||
* do_stat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_stat()
|
||||
int do_stat()
|
||||
{
|
||||
/* Perform the stat(name, buf) system call. */
|
||||
int r;
|
||||
@@ -156,7 +156,7 @@ PUBLIC int do_stat()
|
||||
/*===========================================================================*
|
||||
* do_fstat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fstat()
|
||||
int do_fstat()
|
||||
{
|
||||
/* Perform the fstat(fd, buf) system call. */
|
||||
register struct filp *rfilp;
|
||||
@@ -190,7 +190,7 @@ PUBLIC int do_fstat()
|
||||
/*===========================================================================*
|
||||
* do_fstatfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fstatfs()
|
||||
int do_fstatfs()
|
||||
{
|
||||
/* Perform the fstatfs(fd, buf) system call. */
|
||||
struct filp *rfilp;
|
||||
@@ -209,7 +209,7 @@ PUBLIC int do_fstatfs()
|
||||
/*===========================================================================*
|
||||
* do_statvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_statvfs()
|
||||
int do_statvfs()
|
||||
{
|
||||
/* Perform the stat(name, buf) system call. */
|
||||
int r;
|
||||
@@ -237,7 +237,7 @@ PUBLIC int do_statvfs()
|
||||
/*===========================================================================*
|
||||
* do_fstatvfs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_fstatvfs()
|
||||
int do_fstatvfs()
|
||||
{
|
||||
/* Perform the fstat(fd, buf) system call. */
|
||||
register struct filp *rfilp;
|
||||
@@ -257,7 +257,7 @@ PUBLIC int do_fstatvfs()
|
||||
/*===========================================================================*
|
||||
* do_lstat *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_lstat()
|
||||
int do_lstat()
|
||||
{
|
||||
/* Perform the lstat(name, buf) system call. */
|
||||
struct vnode *vp;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "vnode.h"
|
||||
#include "vmnt.h"
|
||||
|
||||
PUBLIC int (*call_vec[])(void) = {
|
||||
int (*call_vec[])(void) = {
|
||||
no_sys, /* 0 = unused */
|
||||
no_sys, /* 1 = (exit) */
|
||||
no_sys, /* 2 = (fork) */
|
||||
@@ -133,7 +133,7 @@ PUBLIC int (*call_vec[])(void) = {
|
||||
/* This should not fail with "array size is negative": */
|
||||
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];
|
||||
|
||||
PUBLIC int (*pfs_call_vec[])(void) = {
|
||||
int (*pfs_call_vec[])(void) = {
|
||||
|
||||
no_sys, /* 0 */
|
||||
do_check_perms, /* 1 */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/*===========================================================================*
|
||||
* do_utime *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_utime()
|
||||
int do_utime()
|
||||
{
|
||||
/* Perform the utime(name, timep) system call. */
|
||||
register int len;
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include "threads.h"
|
||||
#include <assert.h>
|
||||
|
||||
FORWARD int tll_append(tll_t *tllp, tll_access_t locktype);
|
||||
static int tll_append(tll_t *tllp, tll_access_t locktype);
|
||||
|
||||
PRIVATE int tll_append(tll_t *tllp, tll_access_t locktype)
|
||||
static int tll_append(tll_t *tllp, tll_access_t locktype)
|
||||
{
|
||||
struct worker_thread *queue;
|
||||
|
||||
@@ -70,7 +70,7 @@ PRIVATE int tll_append(tll_t *tllp, tll_access_t locktype)
|
||||
return(OK);
|
||||
}
|
||||
|
||||
PUBLIC void tll_downgrade(tll_t *tllp)
|
||||
void tll_downgrade(tll_t *tllp)
|
||||
{
|
||||
/* Downgrade three-level-lock tll from write-only to read-serialized, or from
|
||||
* read-serialized to read-only. Caveat: as we can't know whether the next
|
||||
@@ -109,7 +109,7 @@ PUBLIC void tll_downgrade(tll_t *tllp)
|
||||
assert(tllp->t_owner == NULL);
|
||||
}
|
||||
|
||||
PUBLIC void tll_init(tll_t *tllp)
|
||||
void tll_init(tll_t *tllp)
|
||||
{
|
||||
/* Initialize three-level-lock tll */
|
||||
assert(tllp != NULL);
|
||||
@@ -122,18 +122,18 @@ PUBLIC void tll_init(tll_t *tllp)
|
||||
tllp->t_owner = NULL;
|
||||
}
|
||||
|
||||
PUBLIC int tll_islocked(tll_t *tllp)
|
||||
int tll_islocked(tll_t *tllp)
|
||||
{
|
||||
return(tllp->t_current != TLL_NONE);
|
||||
}
|
||||
|
||||
PUBLIC int tll_locked_by_me(tll_t *tllp)
|
||||
int tll_locked_by_me(tll_t *tllp)
|
||||
{
|
||||
assert(self != NULL);
|
||||
return(tllp->t_owner == self && !(tllp->t_status & TLL_PEND));
|
||||
}
|
||||
|
||||
PUBLIC int tll_lock(tll_t *tllp, tll_access_t locktype)
|
||||
int tll_lock(tll_t *tllp, tll_access_t locktype)
|
||||
{
|
||||
/* Try to lock three-level-lock tll with type locktype */
|
||||
|
||||
@@ -210,7 +210,7 @@ PUBLIC int tll_lock(tll_t *tllp, tll_access_t locktype)
|
||||
return(OK);
|
||||
}
|
||||
|
||||
PUBLIC int tll_haspendinglock(tll_t *tllp)
|
||||
int tll_haspendinglock(tll_t *tllp)
|
||||
{
|
||||
/* Is someone trying to obtain a lock? */
|
||||
assert(tllp != NULL);
|
||||
@@ -220,7 +220,7 @@ PUBLIC int tll_haspendinglock(tll_t *tllp)
|
||||
return(tllp->t_write != NULL || tllp->t_serial != NULL);
|
||||
}
|
||||
|
||||
PUBLIC int tll_unlock(tll_t *tllp)
|
||||
int tll_unlock(tll_t *tllp)
|
||||
{
|
||||
/* Unlock a previously locked three-level-lock tll */
|
||||
int signal_owner = 0;
|
||||
@@ -293,7 +293,7 @@ PUBLIC int tll_unlock(tll_t *tllp)
|
||||
return(OK);
|
||||
}
|
||||
|
||||
PUBLIC void tll_upgrade(tll_t *tllp)
|
||||
void tll_upgrade(tll_t *tllp)
|
||||
{
|
||||
/* Upgrade three-level-lock tll from read-serialized to write-only */
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/*===========================================================================*
|
||||
* fetch_name *
|
||||
*===========================================================================*/
|
||||
PUBLIC int fetch_name(path, len, flag, dest)
|
||||
int fetch_name(path, len, flag, dest)
|
||||
char *path; /* pointer to the path in user space */
|
||||
int len; /* path length, including 0 byte */
|
||||
int flag; /* M3 means path may be in message */
|
||||
@@ -74,7 +74,7 @@ char *dest; /* pointer to where path is to be stored */
|
||||
/*===========================================================================*
|
||||
* no_sys *
|
||||
*===========================================================================*/
|
||||
PUBLIC int no_sys()
|
||||
int no_sys()
|
||||
{
|
||||
/* Somebody has used an illegal system call number */
|
||||
return(ENOSYS);
|
||||
@@ -84,7 +84,7 @@ PUBLIC int no_sys()
|
||||
/*===========================================================================*
|
||||
* isokendpt_f *
|
||||
*===========================================================================*/
|
||||
PUBLIC int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int fatal)
|
||||
int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int fatal)
|
||||
{
|
||||
int failed = 0;
|
||||
endpoint_t ke;
|
||||
@@ -120,7 +120,7 @@ PUBLIC int isokendpt_f(char *file, int line, endpoint_t endpoint, int *proc, int
|
||||
/*===========================================================================*
|
||||
* clock_time *
|
||||
*===========================================================================*/
|
||||
PUBLIC time_t clock_time()
|
||||
time_t clock_time()
|
||||
{
|
||||
/* This routine returns the time in seconds since 1.1.1970. MINIX is an
|
||||
* astrophysically naive system that assumes the earth rotates at a constant
|
||||
@@ -141,7 +141,7 @@ PUBLIC time_t clock_time()
|
||||
/*===========================================================================*
|
||||
* in_group *
|
||||
*===========================================================================*/
|
||||
PUBLIC int in_group(struct fproc *rfp, gid_t grp)
|
||||
int in_group(struct fproc *rfp, gid_t grp)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <assert.h>
|
||||
#include "fproc.h"
|
||||
|
||||
FORWARD int is_vmnt_locked(struct vmnt *vmp);
|
||||
FORWARD void clear_vmnt(struct vmnt *vmp);
|
||||
static int is_vmnt_locked(struct vmnt *vmp);
|
||||
static void clear_vmnt(struct vmnt *vmp);
|
||||
|
||||
/* Is vmp pointer reasonable? */
|
||||
#define SANEVMP(v) ((((v) >= &vmnt[0] && (v) < &vmnt[NR_MNTS])))
|
||||
@@ -22,7 +22,7 @@ FORWARD void clear_vmnt(struct vmnt *vmp);
|
||||
/*===========================================================================*
|
||||
* check_vmnt_locks_by_me *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_vmnt_locks_by_me(struct fproc *rfp)
|
||||
void check_vmnt_locks_by_me(struct fproc *rfp)
|
||||
{
|
||||
/* Check whether this thread still has locks held on vmnts */
|
||||
struct vmnt *vmp;
|
||||
@@ -42,7 +42,7 @@ PUBLIC void check_vmnt_locks_by_me(struct fproc *rfp)
|
||||
/*===========================================================================*
|
||||
* check_vmnt_locks *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_vmnt_locks()
|
||||
void check_vmnt_locks()
|
||||
{
|
||||
struct vmnt *vmp;
|
||||
int count = 0;
|
||||
@@ -62,7 +62,7 @@ PUBLIC void check_vmnt_locks()
|
||||
/*===========================================================================*
|
||||
* mark_vmnt_free *
|
||||
*===========================================================================*/
|
||||
PUBLIC void mark_vmnt_free(struct vmnt *vmp)
|
||||
void mark_vmnt_free(struct vmnt *vmp)
|
||||
{
|
||||
ASSERTVMP(vmp);
|
||||
|
||||
@@ -73,7 +73,7 @@ PUBLIC void mark_vmnt_free(struct vmnt *vmp)
|
||||
/*===========================================================================*
|
||||
* clear_vmnt *
|
||||
*===========================================================================*/
|
||||
PRIVATE void clear_vmnt(struct vmnt *vmp)
|
||||
static void clear_vmnt(struct vmnt *vmp)
|
||||
{
|
||||
/* Reset vmp to initial parameters */
|
||||
ASSERTVMP(vmp);
|
||||
@@ -92,7 +92,7 @@ PRIVATE void clear_vmnt(struct vmnt *vmp)
|
||||
/*===========================================================================*
|
||||
* get_free_vmnt *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vmnt *get_free_vmnt(void)
|
||||
struct vmnt *get_free_vmnt(void)
|
||||
{
|
||||
struct vmnt *vmp;
|
||||
|
||||
@@ -109,7 +109,7 @@ PUBLIC struct vmnt *get_free_vmnt(void)
|
||||
/*===========================================================================*
|
||||
* find_vmnt *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vmnt *find_vmnt(endpoint_t fs_e)
|
||||
struct vmnt *find_vmnt(endpoint_t fs_e)
|
||||
{
|
||||
/* Find the vmnt belonging to an FS with endpoint 'fs_e' iff it's in use */
|
||||
struct vmnt *vp;
|
||||
@@ -124,7 +124,7 @@ PUBLIC struct vmnt *find_vmnt(endpoint_t fs_e)
|
||||
/*===========================================================================*
|
||||
* init_vmnts *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_vmnts(void)
|
||||
void init_vmnts(void)
|
||||
{
|
||||
/* Initialize vmnt table */
|
||||
struct vmnt *vmp;
|
||||
@@ -138,7 +138,7 @@ PUBLIC void init_vmnts(void)
|
||||
/*===========================================================================*
|
||||
* is_vmnt_locked *
|
||||
*===========================================================================*/
|
||||
PRIVATE int is_vmnt_locked(struct vmnt *vmp)
|
||||
static int is_vmnt_locked(struct vmnt *vmp)
|
||||
{
|
||||
ASSERTVMP(vmp);
|
||||
return(tll_islocked(&vmp->m_lock) || tll_haspendinglock(&vmp->m_lock));
|
||||
@@ -147,7 +147,7 @@ PRIVATE int is_vmnt_locked(struct vmnt *vmp)
|
||||
/*===========================================================================*
|
||||
* lock_vmnt *
|
||||
*===========================================================================*/
|
||||
PUBLIC int lock_vmnt(struct vmnt *vmp, tll_access_t locktype)
|
||||
int lock_vmnt(struct vmnt *vmp, tll_access_t locktype)
|
||||
{
|
||||
int r;
|
||||
tll_access_t initial_locktype;
|
||||
@@ -177,7 +177,7 @@ PUBLIC int lock_vmnt(struct vmnt *vmp, tll_access_t locktype)
|
||||
/*===========================================================================*
|
||||
* vmnt_unmap_by_endpoint *
|
||||
*===========================================================================*/
|
||||
PUBLIC void vmnt_unmap_by_endpt(endpoint_t proc_e)
|
||||
void vmnt_unmap_by_endpt(endpoint_t proc_e)
|
||||
{
|
||||
struct vmnt *vmp;
|
||||
|
||||
@@ -196,7 +196,7 @@ PUBLIC void vmnt_unmap_by_endpt(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* unlock_vmnt *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlock_vmnt(struct vmnt *vmp)
|
||||
void unlock_vmnt(struct vmnt *vmp)
|
||||
{
|
||||
ASSERTVMP(vmp);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
/*===========================================================================*
|
||||
* check_vnode_locks_by_me *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_vnode_locks_by_me(struct fproc *rfp)
|
||||
void check_vnode_locks_by_me(struct fproc *rfp)
|
||||
{
|
||||
/* Check whether this thread still has locks held on vnodes */
|
||||
struct vnode *vp;
|
||||
@@ -63,7 +63,7 @@ PUBLIC void check_vnode_locks_by_me(struct fproc *rfp)
|
||||
/*===========================================================================*
|
||||
* check_vnode_locks *
|
||||
*===========================================================================*/
|
||||
PUBLIC void check_vnode_locks()
|
||||
void check_vnode_locks()
|
||||
{
|
||||
struct vnode *vp;
|
||||
int count = 0;
|
||||
@@ -82,7 +82,7 @@ PUBLIC void check_vnode_locks()
|
||||
/*===========================================================================*
|
||||
* get_free_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vnode *get_free_vnode()
|
||||
struct vnode *get_free_vnode()
|
||||
{
|
||||
/* Find a free vnode slot in the vnode table (it's not actually allocated) */
|
||||
struct vnode *vp;
|
||||
@@ -108,7 +108,7 @@ PUBLIC struct vnode *get_free_vnode()
|
||||
/*===========================================================================*
|
||||
* find_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct vnode *find_vnode(int fs_e, int ino)
|
||||
struct vnode *find_vnode(int fs_e, int ino)
|
||||
{
|
||||
/* Find a specified (FS endpoint and inode number) vnode in the
|
||||
* vnode table */
|
||||
@@ -124,7 +124,7 @@ PUBLIC struct vnode *find_vnode(int fs_e, int ino)
|
||||
/*===========================================================================*
|
||||
* is_vnode_locked *
|
||||
*===========================================================================*/
|
||||
PUBLIC int is_vnode_locked(struct vnode *vp)
|
||||
int is_vnode_locked(struct vnode *vp)
|
||||
{
|
||||
/* Find out whether a thread holds a lock on this vnode or is trying to obtain
|
||||
* a lock. */
|
||||
@@ -136,7 +136,7 @@ PUBLIC int is_vnode_locked(struct vnode *vp)
|
||||
/*===========================================================================*
|
||||
* init_vnodes *
|
||||
*===========================================================================*/
|
||||
PUBLIC void init_vnodes(void)
|
||||
void init_vnodes(void)
|
||||
{
|
||||
struct vnode *vp;
|
||||
|
||||
@@ -154,7 +154,7 @@ PUBLIC void init_vnodes(void)
|
||||
/*===========================================================================*
|
||||
* lock_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC int lock_vnode(struct vnode *vp, tll_access_t locktype)
|
||||
int lock_vnode(struct vnode *vp, tll_access_t locktype)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -175,7 +175,7 @@ PUBLIC int lock_vnode(struct vnode *vp, tll_access_t locktype)
|
||||
/*===========================================================================*
|
||||
* unlock_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void unlock_vnode(struct vnode *vp)
|
||||
void unlock_vnode(struct vnode *vp)
|
||||
{
|
||||
#if LOCK_DEBUG
|
||||
int i;
|
||||
@@ -216,7 +216,7 @@ PUBLIC void unlock_vnode(struct vnode *vp)
|
||||
/*===========================================================================*
|
||||
* dup_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dup_vnode(struct vnode *vp)
|
||||
void dup_vnode(struct vnode *vp)
|
||||
{
|
||||
/* dup_vnode() is called to increment the vnode and therefore the
|
||||
* referred inode's counter.
|
||||
@@ -229,7 +229,7 @@ PUBLIC void dup_vnode(struct vnode *vp)
|
||||
/*===========================================================================*
|
||||
* put_vnode *
|
||||
*===========================================================================*/
|
||||
PUBLIC void put_vnode(struct vnode *vp)
|
||||
void put_vnode(struct vnode *vp)
|
||||
{
|
||||
/* Decrease vnode's usage counter and decrease inode's usage counter in the
|
||||
* corresponding FS process. Decreasing the fs_count each time we decrease the
|
||||
@@ -294,7 +294,7 @@ PUBLIC void put_vnode(struct vnode *vp)
|
||||
/*===========================================================================*
|
||||
* vnode_clean_refs *
|
||||
*===========================================================================*/
|
||||
PUBLIC void vnode_clean_refs(struct vnode *vp)
|
||||
void vnode_clean_refs(struct vnode *vp)
|
||||
{
|
||||
/* Tell the underlying FS to drop all reference but one. */
|
||||
|
||||
@@ -313,7 +313,7 @@ PUBLIC void vnode_clean_refs(struct vnode *vp)
|
||||
/*===========================================================================*
|
||||
* check_vrefs *
|
||||
*===========================================================================*/
|
||||
PUBLIC int check_vrefs()
|
||||
int check_vrefs()
|
||||
{
|
||||
int i, bad;
|
||||
int ispipe_flag, ispipe_mode;
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
#include "job.h"
|
||||
#include <assert.h>
|
||||
|
||||
FORWARD void append_job(struct job *job, void *(*func)(void *arg));
|
||||
FORWARD void get_work(struct worker_thread *worker);
|
||||
FORWARD void *worker_main(void *arg);
|
||||
FORWARD void worker_sleep(struct worker_thread *worker);
|
||||
FORWARD void worker_wake(struct worker_thread *worker);
|
||||
FORWARD int worker_waiting_for(struct worker_thread *worker, endpoint_t
|
||||
static void append_job(struct job *job, void *(*func)(void *arg));
|
||||
static void get_work(struct worker_thread *worker);
|
||||
static void *worker_main(void *arg);
|
||||
static void worker_sleep(struct worker_thread *worker);
|
||||
static void worker_wake(struct worker_thread *worker);
|
||||
static int worker_waiting_for(struct worker_thread *worker, endpoint_t
|
||||
proc_e);
|
||||
PRIVATE int init = 0;
|
||||
PRIVATE mthread_attr_t tattr;
|
||||
static int init = 0;
|
||||
static mthread_attr_t tattr;
|
||||
|
||||
#ifdef MKCOVERAGE
|
||||
# define TH_STACKSIZE (10 * 1024)
|
||||
@@ -27,7 +27,7 @@ PRIVATE mthread_attr_t tattr;
|
||||
/*===========================================================================*
|
||||
* worker_init *
|
||||
*===========================================================================*/
|
||||
PUBLIC void worker_init(struct worker_thread *wp)
|
||||
void worker_init(struct worker_thread *wp)
|
||||
{
|
||||
/* Initialize worker thread */
|
||||
if (!init) {
|
||||
@@ -58,7 +58,7 @@ PUBLIC void worker_init(struct worker_thread *wp)
|
||||
/*===========================================================================*
|
||||
* get_work *
|
||||
*===========================================================================*/
|
||||
PRIVATE void get_work(struct worker_thread *worker)
|
||||
static void get_work(struct worker_thread *worker)
|
||||
{
|
||||
/* Find new work to do. Work can be 'queued', 'pending', or absent. In the
|
||||
* latter case wait for new work to come in. */
|
||||
@@ -96,7 +96,7 @@ PRIVATE void get_work(struct worker_thread *worker)
|
||||
/*===========================================================================*
|
||||
* worker_available *
|
||||
*===========================================================================*/
|
||||
PUBLIC int worker_available(void)
|
||||
int worker_available(void)
|
||||
{
|
||||
int busy, i;
|
||||
|
||||
@@ -112,7 +112,7 @@ PUBLIC int worker_available(void)
|
||||
/*===========================================================================*
|
||||
* worker_main *
|
||||
*===========================================================================*/
|
||||
PRIVATE void *worker_main(void *arg)
|
||||
static void *worker_main(void *arg)
|
||||
{
|
||||
/* Worker thread main loop */
|
||||
struct worker_thread *me;
|
||||
@@ -141,7 +141,7 @@ PRIVATE void *worker_main(void *arg)
|
||||
/*===========================================================================*
|
||||
* dl_worker_start *
|
||||
*===========================================================================*/
|
||||
PUBLIC void dl_worker_start(void *(*func)(void *arg))
|
||||
void dl_worker_start(void *(*func)(void *arg))
|
||||
{
|
||||
/* Start the deadlock resolving worker. This worker is reserved to run in case
|
||||
* all other workers are busy and we have to have an additional worker to come
|
||||
@@ -159,7 +159,7 @@ PUBLIC void dl_worker_start(void *(*func)(void *arg))
|
||||
/*===========================================================================*
|
||||
* sys_worker_start *
|
||||
*===========================================================================*/
|
||||
PUBLIC void sys_worker_start(void *(*func)(void *arg))
|
||||
void sys_worker_start(void *(*func)(void *arg))
|
||||
{
|
||||
/* Carry out work for the system (i.e., kernel or PM). If this thread is idle
|
||||
* do it right away, else create new job and append it to the queue. */
|
||||
@@ -177,7 +177,7 @@ PUBLIC void sys_worker_start(void *(*func)(void *arg))
|
||||
/*===========================================================================*
|
||||
* append_job *
|
||||
*===========================================================================*/
|
||||
PRIVATE void append_job(struct job *job, void *(*func)(void *arg))
|
||||
static void append_job(struct job *job, void *(*func)(void *arg))
|
||||
{
|
||||
/* Append a job */
|
||||
|
||||
@@ -201,7 +201,7 @@ PRIVATE void append_job(struct job *job, void *(*func)(void *arg))
|
||||
/*===========================================================================*
|
||||
* worker_start *
|
||||
*===========================================================================*/
|
||||
PUBLIC void worker_start(void *(*func)(void *arg))
|
||||
void worker_start(void *(*func)(void *arg))
|
||||
{
|
||||
/* Find an available worker or wait for one */
|
||||
int i;
|
||||
@@ -250,7 +250,7 @@ PUBLIC void worker_start(void *(*func)(void *arg))
|
||||
/*===========================================================================*
|
||||
* worker_sleep *
|
||||
*===========================================================================*/
|
||||
PRIVATE void worker_sleep(struct worker_thread *worker)
|
||||
static void worker_sleep(struct worker_thread *worker)
|
||||
{
|
||||
ASSERTW(worker);
|
||||
assert(self == worker);
|
||||
@@ -266,7 +266,7 @@ PRIVATE void worker_sleep(struct worker_thread *worker)
|
||||
/*===========================================================================*
|
||||
* worker_wake *
|
||||
*===========================================================================*/
|
||||
PRIVATE void worker_wake(struct worker_thread *worker)
|
||||
static void worker_wake(struct worker_thread *worker)
|
||||
{
|
||||
/* Signal a worker to wake up */
|
||||
ASSERTW(worker);
|
||||
@@ -281,7 +281,7 @@ PRIVATE void worker_wake(struct worker_thread *worker)
|
||||
/*===========================================================================*
|
||||
* worker_wait *
|
||||
*===========================================================================*/
|
||||
PUBLIC void worker_wait(void)
|
||||
void worker_wait(void)
|
||||
{
|
||||
struct worker_thread *worker;
|
||||
|
||||
@@ -300,7 +300,7 @@ PUBLIC void worker_wait(void)
|
||||
/*===========================================================================*
|
||||
* worker_signal *
|
||||
*===========================================================================*/
|
||||
PUBLIC void worker_signal(struct worker_thread *worker)
|
||||
void worker_signal(struct worker_thread *worker)
|
||||
{
|
||||
ASSERTW(worker); /* Make sure we have a valid thread */
|
||||
worker_wake(worker);
|
||||
@@ -309,7 +309,7 @@ PUBLIC void worker_signal(struct worker_thread *worker)
|
||||
/*===========================================================================*
|
||||
* worker_stop *
|
||||
*===========================================================================*/
|
||||
PUBLIC void worker_stop(struct worker_thread *worker)
|
||||
void worker_stop(struct worker_thread *worker)
|
||||
{
|
||||
ASSERTW(worker); /* Make sure we have a valid thread */
|
||||
if (worker->w_job.j_fp)
|
||||
@@ -322,7 +322,7 @@ PUBLIC void worker_stop(struct worker_thread *worker)
|
||||
/*===========================================================================*
|
||||
* worker_stop_by_endpt *
|
||||
*===========================================================================*/
|
||||
PUBLIC void worker_stop_by_endpt(endpoint_t proc_e)
|
||||
void worker_stop_by_endpt(endpoint_t proc_e)
|
||||
{
|
||||
struct worker_thread *worker;
|
||||
int i;
|
||||
@@ -342,7 +342,7 @@ PUBLIC void worker_stop_by_endpt(endpoint_t proc_e)
|
||||
/*===========================================================================*
|
||||
* worker_self *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct worker_thread *worker_self(void)
|
||||
struct worker_thread *worker_self(void)
|
||||
{
|
||||
struct worker_thread *worker;
|
||||
worker = worker_get(mthread_self());
|
||||
@@ -353,7 +353,7 @@ PUBLIC struct worker_thread *worker_self(void)
|
||||
/*===========================================================================*
|
||||
* worker_get *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct worker_thread *worker_get(thread_t worker_tid)
|
||||
struct worker_thread *worker_get(thread_t worker_tid)
|
||||
{
|
||||
int i;
|
||||
struct worker_thread *worker;
|
||||
@@ -378,7 +378,7 @@ PUBLIC struct worker_thread *worker_get(thread_t worker_tid)
|
||||
/*===========================================================================*
|
||||
* worker_getjob *
|
||||
*===========================================================================*/
|
||||
PUBLIC struct job *worker_getjob(thread_t worker_tid)
|
||||
struct job *worker_getjob(thread_t worker_tid)
|
||||
{
|
||||
struct worker_thread *worker;
|
||||
|
||||
@@ -391,7 +391,7 @@ PUBLIC struct job *worker_getjob(thread_t worker_tid)
|
||||
/*===========================================================================*
|
||||
* worker_waiting_for *
|
||||
*===========================================================================*/
|
||||
PRIVATE int worker_waiting_for(struct worker_thread *worker, endpoint_t proc_e)
|
||||
static int worker_waiting_for(struct worker_thread *worker, endpoint_t proc_e)
|
||||
{
|
||||
ASSERTW(worker); /* Make sure we have a valid thread */
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
/*===========================================================================*
|
||||
* do_write *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_write()
|
||||
int do_write()
|
||||
{
|
||||
/* Perform the write(fd, buffer, nbytes) system call. */
|
||||
return(do_read_write(WRITING));
|
||||
|
||||
Reference in New Issue
Block a user