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

@@ -12,15 +12,15 @@
#include "inc.h"
PRIVATE LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS];
static LIST_HEAD(hash_head, inode) hash_table[NUM_HASH_SLOTS];
FORWARD void del_one_dentry(struct inode *ino);
FORWARD unsigned int hash_dentry(struct inode *parent, char *name);
static void del_one_dentry(struct inode *ino);
static unsigned int hash_dentry(struct inode *parent, char *name);
/*===========================================================================*
* init_dentry *
*===========================================================================*/
PUBLIC void init_dentry()
void init_dentry()
{
/* Initialize the names hashtable.
*/
@@ -33,7 +33,7 @@ PUBLIC void init_dentry()
/*===========================================================================*
* lookup_dentry *
*===========================================================================*/
PUBLIC struct inode *lookup_dentry(parent, name)
struct inode *lookup_dentry(parent, name)
struct inode *parent;
char *name;
{
@@ -64,7 +64,7 @@ char *name;
/*===========================================================================*
* add_dentry *
*===========================================================================*/
PUBLIC void add_dentry(parent, name, ino)
void add_dentry(parent, name, ino)
struct inode *parent;
char *name;
struct inode *ino;
@@ -92,7 +92,7 @@ struct inode *ino;
/*===========================================================================*
* del_one_dentry *
*===========================================================================*/
PRIVATE void del_one_dentry(ino)
static void del_one_dentry(ino)
struct inode *ino;
{
/* This inode has become inaccessible by name. Disassociate it from its parent
@@ -123,7 +123,7 @@ struct inode *ino;
/*===========================================================================*
* del_dentry *
*===========================================================================*/
PUBLIC void del_dentry(ino)
void del_dentry(ino)
struct inode *ino;
{
/* Disassociate an inode from its parent, effectively deleting it. Recursively
@@ -167,7 +167,7 @@ struct inode *ino;
/*===========================================================================*
* hash_dentry *
*===========================================================================*/
PRIVATE unsigned int hash_dentry(parent, name)
static unsigned int hash_dentry(parent, name)
struct inode *parent;
char *name;
{

View File

@@ -15,7 +15,7 @@
/*===========================================================================*
* get_handle *
*===========================================================================*/
PUBLIC int get_handle(ino)
int get_handle(ino)
struct inode *ino;
{
/* Get an open file or directory handle for an inode.
@@ -55,7 +55,7 @@ struct inode *ino;
/*===========================================================================*
* put_handle *
*===========================================================================*/
PUBLIC void put_handle(ino)
void put_handle(ino)
struct inode *ino;
{
/* Close an open file or directory handle associated with an inode.

View File

@@ -18,14 +18,14 @@
#include "inc.h"
PRIVATE struct inode inodes[NUM_INODES];
static struct inode inodes[NUM_INODES];
PRIVATE TAILQ_HEAD(free_head, inode) free_list;
static TAILQ_HEAD(free_head, inode) free_list;
/*===========================================================================*
* init_inode *
*===========================================================================*/
PUBLIC struct inode *init_inode()
struct inode *init_inode()
{
/* Initialize inode table. Return the root inode.
*/
@@ -65,7 +65,7 @@ PUBLIC struct inode *init_inode()
/*===========================================================================*
* find_inode *
*===========================================================================*/
PUBLIC struct inode *find_inode(ino_nr)
struct inode *find_inode(ino_nr)
ino_t ino_nr;
{
/* Get an inode based on its inode number. Do not increase its reference count.
@@ -102,7 +102,7 @@ ino_t ino_nr;
/*===========================================================================*
* get_inode *
*===========================================================================*/
PUBLIC void get_inode(ino)
void get_inode(ino)
struct inode *ino;
{
/* Increase the given inode's reference count. If both reference and link
@@ -126,7 +126,7 @@ struct inode *ino;
/*===========================================================================*
* put_inode *
*===========================================================================*/
PUBLIC void put_inode(ino)
void put_inode(ino)
struct inode *ino;
{
/* Decrease an inode's reference count. If this count has reached zero, close
@@ -166,7 +166,7 @@ struct inode *ino;
/*===========================================================================*
* link_inode *
*===========================================================================*/
PUBLIC void link_inode(parent, ino)
void link_inode(parent, ino)
struct inode *parent;
struct inode *ino;
{
@@ -187,7 +187,7 @@ struct inode *ino;
/*===========================================================================*
* unlink_inode *
*===========================================================================*/
PUBLIC void unlink_inode(ino)
void unlink_inode(ino)
struct inode *ino;
{
/* Unlink an inode from its parent. If both reference and link count have
@@ -213,7 +213,7 @@ struct inode *ino;
/*===========================================================================*
* get_free_inode *
*===========================================================================*/
PUBLIC struct inode *get_free_inode()
struct inode *get_free_inode()
{
/* Return a free inode object (with reference count 1), if available.
*/
@@ -250,7 +250,7 @@ PUBLIC struct inode *get_free_inode()
/*===========================================================================*
* have_free_inode *
*===========================================================================*/
PUBLIC int have_free_inode()
int have_free_inode()
{
/* Check whether there are any free inodes at the moment. Kind of lame, but
* this allows for easier error recovery in some places.
@@ -262,7 +262,7 @@ PUBLIC int have_free_inode()
/*===========================================================================*
* have_used_inode *
*===========================================================================*/
PUBLIC int have_used_inode()
int have_used_inode()
{
/* Check whether any inodes are still in use, that is, any of the inodes have
* a reference count larger than zero.
@@ -279,7 +279,7 @@ PUBLIC int have_used_inode()
/*===========================================================================*
* do_putnode *
*===========================================================================*/
PUBLIC int do_putnode()
int do_putnode()
{
/* Decrease an inode's reference count.
*/

View File

@@ -15,12 +15,12 @@
#include <fcntl.h>
FORWARD int force_remove(char *path, int dir);
static int force_remove(char *path, int dir);
/*===========================================================================*
* do_create *
*===========================================================================*/
PUBLIC int do_create()
int do_create()
{
/* Create a new file.
*/
@@ -128,7 +128,7 @@ PUBLIC int do_create()
/*===========================================================================*
* do_mkdir *
*===========================================================================*/
PUBLIC int do_mkdir()
int do_mkdir()
{
/* Make a new directory.
*/
@@ -177,7 +177,7 @@ PUBLIC int do_mkdir()
/*===========================================================================*
* force_remove *
*===========================================================================*/
PRIVATE int force_remove(path, dir)
static int force_remove(path, dir)
char *path; /* path to file or directory */
int dir; /* TRUE iff directory */
{
@@ -232,7 +232,7 @@ int dir; /* TRUE iff directory */
/*===========================================================================*
* do_unlink *
*===========================================================================*/
PUBLIC int do_unlink()
int do_unlink()
{
/* Delete a file.
*/
@@ -279,7 +279,7 @@ PUBLIC int do_unlink()
/*===========================================================================*
* do_rmdir *
*===========================================================================*/
PUBLIC int do_rmdir()
int do_rmdir()
{
/* Remove an empty directory.
*/
@@ -327,7 +327,7 @@ PUBLIC int do_rmdir()
/*===========================================================================*
* do_rename *
*===========================================================================*/
PUBLIC int do_rename()
int do_rename()
{
/* Rename a file or directory.
*/

View File

@@ -9,19 +9,19 @@
#include "inc.h"
FORWARD int get_mask(vfs_ucred_t *ucred);
FORWARD int access_as_dir(struct inode *ino, struct hgfs_attr *attr, int
static int get_mask(vfs_ucred_t *ucred);
static int access_as_dir(struct inode *ino, struct hgfs_attr *attr, int
uid, int mask);
FORWARD int next_name(char **ptr, char **start, char name[NAME_MAX+1]);
FORWARD int go_up(char path[PATH_MAX], struct inode *ino, struct inode
static int next_name(char **ptr, char **start, char name[NAME_MAX+1]);
static int go_up(char path[PATH_MAX], struct inode *ino, struct inode
**res_ino, struct hgfs_attr *attr);
FORWARD int go_down(char path[PATH_MAX], struct inode *ino, char *name,
static int go_down(char path[PATH_MAX], struct inode *ino, char *name,
struct inode **res_ino, struct hgfs_attr *attr);
/*===========================================================================*
* get_mask *
*===========================================================================*/
PRIVATE int get_mask(ucred)
static int get_mask(ucred)
vfs_ucred_t *ucred; /* credentials of the caller */
{
/* Given the caller's credentials, precompute a search access mask to test
@@ -42,7 +42,7 @@ vfs_ucred_t *ucred; /* credentials of the caller */
/*===========================================================================*
* access_as_dir *
*===========================================================================*/
PRIVATE int access_as_dir(ino, attr, uid, mask)
static int access_as_dir(ino, attr, uid, mask)
struct inode *ino; /* the inode to test */
struct hgfs_attr *attr; /* attributes of the inode */
int uid; /* UID of the caller */
@@ -69,7 +69,7 @@ int mask; /* search access mask of the caller */
/*===========================================================================*
* next_name *
*===========================================================================*/
PRIVATE int next_name(ptr, start, name)
static int next_name(ptr, start, name)
char **ptr; /* cursor pointer into path (in, out) */
char **start; /* place to store start of name */
char name[NAME_MAX+1]; /* place to store name */
@@ -102,7 +102,7 @@ char name[NAME_MAX+1]; /* place to store name */
/*===========================================================================*
* go_up *
*===========================================================================*/
PRIVATE int go_up(path, ino, res_ino, attr)
static int go_up(path, ino, res_ino, attr)
char path[PATH_MAX]; /* path to take the last part from */
struct inode *ino; /* inode of the current directory */
struct inode **res_ino; /* place to store resulting inode */
@@ -131,7 +131,7 @@ struct hgfs_attr *attr; /* place to store inode attributes */
/*===========================================================================*
* go_down *
*===========================================================================*/
PRIVATE int go_down(path, parent, name, res_ino, attr)
static int go_down(path, parent, name, res_ino, attr)
char path[PATH_MAX]; /* path to add the name to */
struct inode *parent; /* inode of the current directory */
char *name; /* name of the directory entry */
@@ -190,7 +190,7 @@ struct hgfs_attr *attr; /* place to store inode attributes */
/*===========================================================================*
* do_lookup *
*===========================================================================*/
PUBLIC int do_lookup()
int do_lookup()
{
/* Resolve a path string to an inode.
*/

View File

@@ -13,10 +13,10 @@
#include <unistd.h>
#include <stdlib.h>
FORWARD void get_work(endpoint_t *who_e);
FORWARD void send_reply(int err, int transid);
static void get_work(endpoint_t *who_e);
static void send_reply(int err, int transid);
PRIVATE struct optset optset_table[] = {
static struct optset optset_table[] = {
{ "prefix", OPT_STRING, opt.prefix, sizeof(opt.prefix) },
{ "uid", OPT_INT, &opt.uid, 10 },
{ "gid", OPT_INT, &opt.gid, 10 },
@@ -28,14 +28,14 @@ PRIVATE struct optset optset_table[] = {
};
/* 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);
/*===========================================================================*
* sef_cb_init_fresh *
*===========================================================================*/
PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize this file server. Called at startup time.
*/
@@ -74,7 +74,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(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;
@@ -94,7 +94,7 @@ PRIVATE void sef_cb_signal_handler(int signo)
/*===========================================================================*
* sef_local_startup *
*===========================================================================*/
PRIVATE void sef_local_startup(void)
static void sef_local_startup(void)
{
/* Register init callbacks. */
sef_setcb_init_fresh(sef_cb_init_fresh);
@@ -111,7 +111,7 @@ PRIVATE void sef_local_startup(void)
/*===========================================================================*
* main *
*===========================================================================*/
PUBLIC int main(argc, argv)
int main(argc, argv)
int argc;
char *argv[];
{
@@ -166,7 +166,7 @@ char *argv[];
/*===========================================================================*
* get_work *
*===========================================================================*/
PRIVATE void get_work(who_e)
static void get_work(who_e)
endpoint_t *who_e;
{
/* Receive a request message from VFS. Return the request call number.
@@ -182,7 +182,7 @@ endpoint_t *who_e;
/*===========================================================================*
* send_reply *
*===========================================================================*/
PRIVATE void send_reply(err, transid)
static void send_reply(err, transid)
int err; /* resulting error code */
int transid;
{

View File

@@ -16,7 +16,7 @@
/*===========================================================================*
* do_fstatfs *
*===========================================================================*/
PUBLIC int do_fstatfs()
int do_fstatfs()
{
/* Retrieve file system statistics.
*/
@@ -31,7 +31,7 @@ PUBLIC int do_fstatfs()
/*===========================================================================*
* do_statvfs *
*===========================================================================*/
PUBLIC int do_statvfs()
int do_statvfs()
{
/* Retrieve file system statistics.
*/

View File

@@ -13,7 +13,7 @@
/*===========================================================================*
* do_readsuper *
*===========================================================================*/
PUBLIC int do_readsuper()
int do_readsuper()
{
/* Mount the file system.
*/
@@ -72,7 +72,7 @@ PUBLIC int do_readsuper()
/*===========================================================================*
* do_unmount *
*===========================================================================*/
PUBLIC int do_unmount()
int do_unmount()
{
/* Unmount the file system.
*/

View File

@@ -15,7 +15,7 @@
/*===========================================================================*
* normalize_name *
*===========================================================================*/
PUBLIC void normalize_name(dst, src)
void normalize_name(dst, src)
char dst[NAME_MAX+1];
char *src;
{
@@ -38,7 +38,7 @@ char *src;
/*===========================================================================*
* compare_name *
*===========================================================================*/
PUBLIC int compare_name(name1, name2)
int compare_name(name1, name2)
char *name1;
char *name2;
{

View File

@@ -14,7 +14,7 @@
/*===========================================================================*
* make_path *
*===========================================================================*/
PUBLIC int make_path(path, ino)
int make_path(path, ino)
char path[PATH_MAX];
struct inode *ino;
{
@@ -68,7 +68,7 @@ struct inode *ino;
/*===========================================================================*
* push_path *
*===========================================================================*/
PUBLIC int push_path(path, name)
int push_path(path, name)
char path[PATH_MAX];
char *name;
{
@@ -92,7 +92,7 @@ char *name;
/*===========================================================================*
* pop_path *
*===========================================================================*/
PUBLIC void pop_path(path)
void pop_path(path)
char path[PATH_MAX];
{
/* Remove the last component from a path.

View File

@@ -17,7 +17,7 @@
/*===========================================================================*
* do_read *
*===========================================================================*/
PUBLIC int do_read()
int do_read()
{
/* Read data from a file.
*/
@@ -77,7 +77,7 @@ PUBLIC int do_read()
/*===========================================================================*
* do_getdents *
*===========================================================================*/
PUBLIC int do_getdents()
int do_getdents()
{
/* Retrieve directory entries.
*/

View File

@@ -15,7 +15,7 @@
/*===========================================================================*
* get_mode *
*===========================================================================*/
PUBLIC mode_t get_mode(ino, mode)
mode_t get_mode(ino, mode)
struct inode *ino;
int mode;
{
@@ -39,7 +39,7 @@ int mode;
/*===========================================================================*
* do_stat *
*===========================================================================*/
PUBLIC int do_stat()
int do_stat()
{
/* Retrieve inode status.
*/
@@ -102,7 +102,7 @@ PUBLIC int do_stat()
/*===========================================================================*
* do_chmod *
*===========================================================================*/
PUBLIC int do_chmod()
int do_chmod()
{
/* Change file mode.
*/
@@ -139,7 +139,7 @@ PUBLIC int do_chmod()
/*===========================================================================*
* do_utime *
*===========================================================================*/
PUBLIC int do_utime()
int do_utime()
{
/* Set file times.
*/

View File

@@ -7,7 +7,7 @@
#define _TABLE
#include "inc.h"
PUBLIC int (*call_vec[])(void) = {
int (*call_vec[])(void) = {
no_sys, /* 0 */
no_sys, /* 1 getnode */
do_putnode, /* 2 putnode */

View File

@@ -14,7 +14,7 @@
/*===========================================================================*
* get_name *
*===========================================================================*/
PUBLIC int get_name(grant, len, name)
int get_name(grant, len, name)
cp_grant_id_t grant; /* memory grant for the path component */
size_t len; /* length of the name, including '\0' */
char name[NAME_MAX+1]; /* buffer in which store the result */
@@ -43,7 +43,7 @@ char name[NAME_MAX+1]; /* buffer in which store the result */
/*===========================================================================*
* do_noop *
*===========================================================================*/
PUBLIC int do_noop()
int do_noop()
{
/* Generic handler for no-op system calls.
*/
@@ -54,7 +54,7 @@ PUBLIC int do_noop()
/*===========================================================================*
* no_sys *
*===========================================================================*/
PUBLIC int no_sys()
int no_sys()
{
/* Generic handler for unimplemented system calls.
*/

View File

@@ -14,7 +14,7 @@
/*===========================================================================*
* verify_path *
*===========================================================================*/
PUBLIC int verify_path(path, ino, attr, stale)
int verify_path(path, ino, attr, stale)
char path[PATH_MAX];
struct inode *ino;
struct hgfs_attr *attr;
@@ -60,7 +60,7 @@ int *stale;
/*===========================================================================*
* verify_inode *
*===========================================================================*/
PUBLIC int verify_inode(ino, path, attr)
int verify_inode(ino, path, attr)
struct inode *ino; /* inode to verify */
char path[PATH_MAX]; /* buffer in which to store the path */
struct hgfs_attr *attr; /* buffer for attributes, or NULL */
@@ -87,7 +87,7 @@ struct hgfs_attr *attr; /* buffer for attributes, or NULL */
/*===========================================================================*
* verify_dentry *
*===========================================================================*/
PUBLIC int verify_dentry(parent, name, path, res_ino)
int verify_dentry(parent, name, path, res_ino)
struct inode *parent; /* parent inode: the inode to verify */
char name[NAME_MAX+1]; /* the given directory entry path component */
char path[PATH_MAX]; /* buffer to store the resulting path in */

View File

@@ -10,13 +10,13 @@
#include "inc.h"
FORWARD int write_file(struct inode *ino, u64_t *posp, size_t *countp,
static int write_file(struct inode *ino, u64_t *posp, size_t *countp,
cp_grant_id_t *grantp);
/*===========================================================================*
* write_file *
*===========================================================================*/
PRIVATE int write_file(ino, posp, countp, grantp)
static int write_file(ino, posp, countp, grantp)
struct inode *ino;
u64_t *posp;
size_t *countp;
@@ -79,7 +79,7 @@ cp_grant_id_t *grantp;
/*===========================================================================*
* do_write *
*===========================================================================*/
PUBLIC int do_write()
int do_write()
{
/* Write data to a file.
*/
@@ -116,7 +116,7 @@ PUBLIC int do_write()
/*===========================================================================*
* do_ftrunc *
*===========================================================================*/
PUBLIC int do_ftrunc()
int do_ftrunc()
{
/* Change file size or create file holes.
*/