retire PUBLIC, PRIVATE and FORWARD

This commit is contained in:
Ben Gras
2012-03-25 20:25:53 +02:00
parent 6a73e85ad1
commit 7336a67dfe
603 changed files with 5776 additions and 5779 deletions

View File

@@ -31,7 +31,7 @@ void release_node(struct puffs_usermount *pu, struct puffs_node *pn)
/*===========================================================================*
* fs_putnode *
*===========================================================================*/
PUBLIC int fs_putnode(void)
int fs_putnode(void)
{
/* Find the pnode specified by the request message and decrease its counter.
* Release unused pnode.

View File

@@ -12,7 +12,7 @@
/*===========================================================================*
* fs_ftrunc *
*===========================================================================*/
PUBLIC int fs_ftrunc(void)
int fs_ftrunc(void)
{
int r;
struct puffs_node *pn;
@@ -68,7 +68,7 @@ PUBLIC int fs_ftrunc(void)
/*===========================================================================*
* fs_link *
*===========================================================================*/
PUBLIC int fs_link()
int fs_link()
{
/* Perform the link(name1, name2) system call. */
@@ -152,7 +152,7 @@ PUBLIC int fs_link()
/*===========================================================================*
* fs_rdlink *
*===========================================================================*/
PUBLIC int fs_rdlink()
int fs_rdlink()
{
register int r; /* return value */
size_t copylen;
@@ -193,7 +193,7 @@ PUBLIC int fs_rdlink()
/*===========================================================================*
* fs_rename *
*===========================================================================*/
PUBLIC int fs_rename()
int fs_rename()
{
/* Perform the rename(name1, name2) system call. */
struct puffs_node *old_dirp, *old_ip; /* ptrs to old dir, file pnodes */
@@ -385,15 +385,15 @@ rename_out:
return(r);
}
FORWARD int remove_dir(struct puffs_node *pn_dir, struct puffs_node *pn,
static int remove_dir(struct puffs_node *pn_dir, struct puffs_node *pn,
struct puffs_cn *pcn);
FORWARD int unlink_file(struct puffs_node *dirp, struct puffs_node *pn,
static int unlink_file(struct puffs_node *dirp, struct puffs_node *pn,
struct puffs_cn *pcn);
/*===========================================================================*
* fs_unlink *
*===========================================================================*/
PUBLIC int fs_unlink()
int fs_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()
@@ -467,7 +467,7 @@ PUBLIC int fs_unlink()
/*===========================================================================*
* remove_dir *
*===========================================================================*/
PRIVATE int remove_dir(pn_dir, pn, pcn)
static int remove_dir(pn_dir, pn, pcn)
struct puffs_node *pn_dir; /* parent directory */
struct puffs_node *pn; /* directory to be removed */
struct puffs_cn *pcn; /* Name, creads of directory */
@@ -525,7 +525,7 @@ struct puffs_cn *pcn; /* Name, creads of directory */
/*===========================================================================*
* unlink_file *
*===========================================================================*/
PRIVATE int unlink_file(dirp, pn, pcn)
static int unlink_file(dirp, pn, pcn)
struct puffs_node *dirp; /* parent directory of file */
struct puffs_node *pn; /* pnode of file, may be NULL too. */
struct puffs_cn *pcn; /* Name, creads of file */

View File

@@ -12,7 +12,7 @@
/*===========================================================================*
* fs_sync *
*===========================================================================*/
PUBLIC int fs_sync()
int fs_sync()
{
/* Perform the sync() system call. Flush all the tables.
* The order in which the various tables are flushed is critical.
@@ -35,7 +35,7 @@ PUBLIC int fs_sync()
/*===========================================================================*
* fs_flush *
*===========================================================================*/
PUBLIC int fs_flush()
int fs_flush()
{
/* Flush the blocks of a device from the cache after writing any dirty blocks
* to disk.
@@ -56,7 +56,7 @@ PUBLIC int fs_flush()
/*===========================================================================*
* fs_new_driver *
*===========================================================================*/
PUBLIC int fs_new_driver(void)
int fs_new_driver(void)
{
/* Do not do anything. */

View File

@@ -15,7 +15,7 @@
/*===========================================================================*
* fs_readsuper *
*===========================================================================*/
PUBLIC int fs_readsuper()
int fs_readsuper()
{
struct vattr *root_va;
@@ -42,7 +42,7 @@ PUBLIC int fs_readsuper()
/*===========================================================================*
* fs_mountpoint *
*===========================================================================*/
PUBLIC int fs_mountpoint()
int fs_mountpoint()
{
/* This function looks up the mount point, it checks the condition whether
* the partition can be mounted on the pnode or not.
@@ -75,7 +75,7 @@ PUBLIC int fs_mountpoint()
/*===========================================================================*
* fs_unmount *
*===========================================================================*/
PUBLIC int fs_unmount()
int fs_unmount()
{
int error;

View File

@@ -16,7 +16,7 @@
/*===========================================================================*
* fs_create *
*===========================================================================*/
PUBLIC int fs_create()
int fs_create()
{
int r;
struct puffs_node *pn_dir;
@@ -114,7 +114,7 @@ PUBLIC int fs_create()
/*===========================================================================*
* fs_mknod *
*===========================================================================*/
PUBLIC int fs_mknod()
int fs_mknod()
{
int r;
struct puffs_node *pn_dir;
@@ -197,7 +197,7 @@ PUBLIC int fs_mknod()
/*===========================================================================*
* fs_mkdir *
*===========================================================================*/
PUBLIC int fs_mkdir()
int fs_mkdir()
{
int r;
struct puffs_node *pn_dir;
@@ -280,7 +280,7 @@ PUBLIC int fs_mkdir()
/*===========================================================================*
* fs_slink *
*===========================================================================*/
PUBLIC int fs_slink()
int fs_slink()
{
int r;
struct pnode *pn; /* pnode containing symbolic link */
@@ -372,7 +372,7 @@ PUBLIC int fs_slink()
/*===========================================================================*
* fs_inhibread *
*===========================================================================*/
PUBLIC int fs_inhibread()
int fs_inhibread()
{
return(OK);
}

View File

@@ -25,17 +25,17 @@
#include "puffs.h"
#include "puffs_priv.h"
PUBLIC char dot2[3] = ".."; /* permissions for . and .. */
char dot2[3] = ".."; /* permissions for . and .. */
FORWARD char *get_name(char *name, char string[NAME_MAX+1]);
FORWARD int ltraverse(struct puffs_node *pn, char *suffix);
FORWARD int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
static char *get_name(char *name, char string[NAME_MAX+1]);
static int ltraverse(struct puffs_node *pn, char *suffix);
static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
puffs_node **res_inop, size_t *offsetp, int *symlinkp);
/*===========================================================================*
* fs_lookup *
*===========================================================================*/
PUBLIC int fs_lookup()
int fs_lookup()
{
cp_grant_id_t grant;
int r, r1, flags, symlinks;
@@ -128,7 +128,7 @@ PUBLIC int fs_lookup()
/*===========================================================================*
* parse_path *
*===========================================================================*/
PRIVATE int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp)
static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp)
ino_t dir_ino;
ino_t root_ino;
int flags;
@@ -279,7 +279,7 @@ int *symlinkp;
/*===========================================================================*
* ltraverse *
*===========================================================================*/
PRIVATE int ltraverse(pn, suffix)
static int ltraverse(pn, suffix)
register struct puffs_node *pn;/* symbolic link */
char *suffix; /* current remaining path. Has to point in the
* user_path buffer
@@ -355,7 +355,7 @@ char *suffix; /* current remaining path. Has to point in the
/*===========================================================================*
* advance *
*===========================================================================*/
PUBLIC struct puffs_node *advance(pn_dir, string, chk_perm)
struct puffs_node *advance(pn_dir, string, chk_perm)
struct puffs_node *pn_dir; /* pnode for directory to be searched */
char string[NAME_MAX + 1]; /* component name to look for */
int chk_perm; /* check permissions when string is looked up*/
@@ -501,7 +501,7 @@ int chk_perm; /* check permissions when string is looked up*/
/*===========================================================================*
* get_name *
*===========================================================================*/
PRIVATE char *get_name(path_name, string)
static char *get_name(path_name, string)
char *path_name; /* path name to parse */
char string[NAME_MAX+1]; /* component extracted from 'old_name' */
{

View File

@@ -8,13 +8,13 @@
#include "puffs.h"
#include "puffs_priv.h"
FORWARD int in_group(gid_t grp);
static int in_group(gid_t grp);
/*===========================================================================*
* fs_chmod *
*===========================================================================*/
PUBLIC int fs_chmod()
int fs_chmod()
{
/* Perform the chmod(name, mode) system call. */
struct puffs_node *pn;
@@ -49,7 +49,7 @@ PUBLIC int fs_chmod()
/*===========================================================================*
* fs_chown *
*===========================================================================*/
PUBLIC int fs_chown()
int fs_chown()
{
struct puffs_node *pn;
struct vattr va;
@@ -81,7 +81,7 @@ PUBLIC int fs_chown()
/*===========================================================================*
* forbidden *
*===========================================================================*/
PUBLIC int forbidden(register struct puffs_node *pn, mode_t access_desired)
int forbidden(register struct puffs_node *pn, mode_t access_desired)
{
/* Given a pointer to an pnode, 'pn', and the access desired, determine
* if the access is allowed, and if not why not. The routine looks up the
@@ -132,7 +132,7 @@ PUBLIC int forbidden(register struct puffs_node *pn, mode_t access_desired)
/*===========================================================================*
* in_group *
*===========================================================================*/
PRIVATE int in_group(gid_t grp)
static int in_group(gid_t grp)
{
int i;
for(i = 0; i < credentials.vu_ngroups; i++)

View File

@@ -67,13 +67,13 @@ pthread_mutex_t pu_lock = PTHREAD_MUTEX_INITIALIZER;
/* Declare some local functions. */
FORWARD void get_work(message *m_in);
FORWARD void reply(endpoint_t who, message *m_out);
static void get_work(message *m_in);
static void reply(endpoint_t who, message *m_out);
/* SEF functions and variables. */
FORWARD void sef_local_startup(void);
FORWARD int sef_cb_init_fresh(int type, sef_init_info_t *info);
FORWARD void sef_cb_signal_handler(int signo);
static void sef_local_startup(void);
static int sef_cb_init_fresh(int type, sef_init_info_t *info);
static void sef_cb_signal_handler(int signo);
EXTERN int env_argc;
EXTERN char **env_argv;
@@ -671,7 +671,7 @@ puffs_mainloop(struct puffs_usermount *pu)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup()
static void sef_local_startup()
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -689,7 +689,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
static int sef_cb_init_fresh(int type, sef_init_info_t *info)
{
/* Initialize the Minix file server. */
SELF_E = getprocnr();
@@ -699,7 +699,7 @@ PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info)
/*===========================================================================*
* sef_cb_signal_handler *
*===========================================================================*/
PRIVATE void sef_cb_signal_handler(int signo)
static void sef_cb_signal_handler(int signo)
{
/* Only check for termination signal, ignore anything else. */
if (signo != SIGTERM) return;
@@ -724,7 +724,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* get_work *
*===========================================================================*/
PRIVATE void get_work(m_in)
static void get_work(m_in)
message *m_in; /* pointer to message */
{
int r, srcok = 0;
@@ -761,7 +761,7 @@ message *m_in; /* pointer to message */
/*===========================================================================*
* reply *
*===========================================================================*/
PRIVATE void reply(
static void reply(
endpoint_t who,
message *m_out /* report result */
)

View File

@@ -18,16 +18,16 @@
#define GETDENTS_BUFSIZ 4096
PRIVATE char getdents_buf[GETDENTS_BUFSIZ];
static char getdents_buf[GETDENTS_BUFSIZ];
#define RW_BUFSIZ (128 << 10)
PRIVATE char rw_buf[RW_BUFSIZ];
static char rw_buf[RW_BUFSIZ];
/*===========================================================================*
* fs_readwrite *
*===========================================================================*/
PUBLIC int fs_readwrite(void)
int fs_readwrite(void)
{
int r = OK, rw_flag;
cp_grant_id_t gid;
@@ -108,7 +108,7 @@ PUBLIC int fs_readwrite(void)
/*===========================================================================*
* fs_breadwrite *
*===========================================================================*/
PUBLIC int fs_breadwrite(void)
int fs_breadwrite(void)
{
/* We do not support breads/writes */
panic("bread write requested, but FS doesn't support it!\n");
@@ -119,7 +119,7 @@ PUBLIC int fs_breadwrite(void)
/*===========================================================================*
* fs_getdents *
*===========================================================================*/
PUBLIC int fs_getdents(void)
int fs_getdents(void)
{
int r;
register struct puffs_node *pn;

View File

@@ -15,7 +15,7 @@
/*===========================================================================*
* fs_fstatfs *
*===========================================================================*/
PUBLIC int fs_fstatfs()
int fs_fstatfs()
{
int r;
struct statvfs st_vfs;
@@ -39,7 +39,7 @@ PUBLIC int fs_fstatfs()
/*===========================================================================*
* fs_stat *
*===========================================================================*/
PUBLIC int fs_stat()
int fs_stat()
{
register int r; /* return value */
register struct puffs_node *pn; /* target pnode */
@@ -97,7 +97,7 @@ PUBLIC int fs_stat()
/*===========================================================================*
* fs_statvfs *
*===========================================================================*/
PUBLIC int fs_statvfs()
int fs_statvfs()
{
int r;
struct statvfs st;

View File

@@ -9,7 +9,7 @@
#include "fs.h"
PUBLIC int (*fs_call_vec[])(void) = {
int (*fs_call_vec[])(void) = {
no_sys, /* 0 not used */
no_sys, /* 1 */ /* Was: fs_getnode */
fs_putnode, /* 2 */

View File

@@ -14,7 +14,7 @@
/*===========================================================================*
* fs_utime *
*===========================================================================*/
PUBLIC int fs_utime()
int fs_utime()
{
struct puffs_node *pn;
struct vattr va;

View File

@@ -13,7 +13,7 @@
/*===========================================================================*
* no_sys *
*===========================================================================*/
PUBLIC int no_sys()
int no_sys()
{
/* Somebody has used an illegal system call number */
lpuffs_debug("no_sys: invalid call %d\n", req_nr);
@@ -24,7 +24,7 @@ PUBLIC int no_sys()
/*===========================================================================*
* mfs_nul *
*===========================================================================*/
PUBLIC void mfs_nul_f(const char *file, int line, char *str, unsigned int len,
void mfs_nul_f(const char *file, int line, char *str, unsigned int len,
unsigned int maxlen)
{
if (len < maxlen && str[len-1] != '\0') {
@@ -37,7 +37,7 @@ PUBLIC void mfs_nul_f(const char *file, int line, char *str, unsigned int len,
/*===========================================================================*
* 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
@@ -58,7 +58,7 @@ PUBLIC time_t clock_time()
/*===========================================================================*
* update_times *
*===========================================================================*/
PUBLIC int update_times(struct puffs_node *pn, int flags, time_t t)
int update_times(struct puffs_node *pn, int flags, time_t t)
{
int r;
struct vattr va;
@@ -103,7 +103,7 @@ PUBLIC int update_times(struct puffs_node *pn, int flags, time_t t)
/*===========================================================================*
* lpuffs_debug *
*===========================================================================*/
PUBLIC void lpuffs_debug(const char *format, ...)
void lpuffs_debug(const char *format, ...)
{
char buffer[256];
va_list args;