Define protocol version of {mode,ino,uid,gid}_t
Change-Id: Ia2027749f2ce55a561d19eb895a5618505e9a2ac
This commit is contained in:
@@ -38,7 +38,7 @@ int fs_putnode(void)
|
||||
*/
|
||||
struct puffs_node *pn;
|
||||
int count = fs_m_in.REQ_COUNT;
|
||||
ino_t inum = fs_m_in.REQ_INODE_NR;
|
||||
pino_t inum = fs_m_in.REQ_INODE_NR;
|
||||
|
||||
if ((pn = puffs_pn_nodewalk(global_pu, 0, &inum)) == NULL) {
|
||||
/* XXX Probably removed from the list, see puffs_pn_remove() */
|
||||
|
||||
@@ -51,7 +51,7 @@ int fs_mountpoint()
|
||||
*/
|
||||
int r = OK;
|
||||
struct puffs_node *pn;
|
||||
mode_t bits;
|
||||
pmode_t bits;
|
||||
|
||||
/*
|
||||
* XXX: we assume that lookup was done first, so pnode can be found with
|
||||
|
||||
+3
-3
@@ -21,7 +21,7 @@ int fs_create()
|
||||
int r;
|
||||
struct puffs_node *pn_dir;
|
||||
struct puffs_node *pn;
|
||||
mode_t omode;
|
||||
pmode_t omode;
|
||||
struct puffs_newinfo pni;
|
||||
struct puffs_kcn pkcnp;
|
||||
PUFFS_MAKECRED(pcr, &global_kcred);
|
||||
@@ -36,7 +36,7 @@ int fs_create()
|
||||
}
|
||||
|
||||
/* Read request message */
|
||||
omode = (mode_t) fs_m_in.REQ_MODE;
|
||||
omode = (pmode_t) fs_m_in.REQ_MODE;
|
||||
caller_uid = (uid_t) fs_m_in.REQ_UID;
|
||||
caller_gid = (gid_t) fs_m_in.REQ_GID;
|
||||
|
||||
@@ -63,7 +63,7 @@ int fs_create()
|
||||
|
||||
memset(&va, 0, sizeof(va));
|
||||
va.va_type = VREG;
|
||||
va.va_mode = omode;
|
||||
va.va_mode = (mode_t) omode;
|
||||
va.va_uid = caller_uid;
|
||||
va.va_gid = caller_gid;
|
||||
va.va_atime = va.va_mtime = va.va_ctime = cur_time;
|
||||
|
||||
+12
-12
@@ -29,7 +29,7 @@ char dot2[3] = ".."; /* permissions for . and .. */
|
||||
|
||||
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
|
||||
static int parse_path(pino_t dir_ino, pino_t root_ino, int flags, struct
|
||||
puffs_node **res_inop, size_t *offsetp, int *symlinkp);
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -41,14 +41,14 @@ int fs_lookup()
|
||||
int r, r1, flags, symlinks;
|
||||
unsigned int len;
|
||||
size_t offset = 0, path_size;
|
||||
ino_t dir_ino, root_ino;
|
||||
pino_t dir_ino, root_ino;
|
||||
struct puffs_node *pn;
|
||||
|
||||
grant = (cp_grant_id_t) fs_m_in.REQ_GRANT;
|
||||
path_size = (size_t) fs_m_in.REQ_PATH_SIZE; /* Size of the buffer */
|
||||
len = (int) fs_m_in.REQ_PATH_LEN; /* including terminating nul */
|
||||
dir_ino = (ino_t) fs_m_in.REQ_DIR_INO;
|
||||
root_ino = (ino_t) fs_m_in.REQ_ROOT_INO;
|
||||
dir_ino = (pino_t) fs_m_in.REQ_DIR_INO;
|
||||
root_ino = (pino_t) fs_m_in.REQ_ROOT_INO;
|
||||
flags = (int) fs_m_in.REQ_FLAGS;
|
||||
|
||||
/* Check length. */
|
||||
@@ -128,14 +128,14 @@ int fs_lookup()
|
||||
/*===========================================================================*
|
||||
* parse_path *
|
||||
*===========================================================================*/
|
||||
static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp)
|
||||
ino_t dir_ino;
|
||||
ino_t root_ino;
|
||||
int flags;
|
||||
struct puffs_node **res_inop;
|
||||
size_t *offsetp;
|
||||
int *symlinkp;
|
||||
{
|
||||
static int parse_path(
|
||||
pino_t dir_ino,
|
||||
pino_t root_ino,
|
||||
int flags,
|
||||
struct puffs_node **res_inop,
|
||||
size_t *offsetp,
|
||||
int *symlinkp
|
||||
) {
|
||||
/* Parse the path in user_path, starting at dir_ino. If the path is the empty
|
||||
* string, just return dir_ino. It is upto the caller to treat an empty
|
||||
* path in a special way. Otherwise, if the path consists of just one or
|
||||
|
||||
+3
-3
@@ -123,7 +123,7 @@ int fs_getdents(void)
|
||||
{
|
||||
int r;
|
||||
register struct puffs_node *pn;
|
||||
ino_t ino;
|
||||
pino_t ino;
|
||||
cp_grant_id_t gid;
|
||||
size_t size, buf_left;
|
||||
off_t pos;
|
||||
@@ -132,8 +132,8 @@ int fs_getdents(void)
|
||||
size_t written;
|
||||
PUFFS_MAKECRED(pcr, &global_kcred);
|
||||
|
||||
ino = (ino_t) fs_m_in.REQ_INODE_NR;
|
||||
gid = (gid_t) fs_m_in.REQ_GRANT;
|
||||
ino = (pino_t) fs_m_in.REQ_INODE_NR;
|
||||
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
|
||||
size = buf_left = (size_t) fs_m_in.REQ_MEM_SIZE;
|
||||
pos = (off_t) fs_m_in.REQ_SEEK_POS_LO;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ int fs_stat()
|
||||
register struct puffs_node *pn; /* target pnode */
|
||||
struct vattr va;
|
||||
struct stat statbuf;
|
||||
mode_t mo;
|
||||
pmode_t mo;
|
||||
int s;
|
||||
PUFFS_MAKECRED(pcr, &global_kcred);
|
||||
|
||||
|
||||
+1
-2
@@ -65,8 +65,7 @@ struct inode *init_inode()
|
||||
/*===========================================================================*
|
||||
* find_inode *
|
||||
*===========================================================================*/
|
||||
struct inode *find_inode(ino_nr)
|
||||
ino_t ino_nr;
|
||||
struct inode *find_inode(pino_t ino_nr)
|
||||
{
|
||||
/* Get an inode based on its inode number. Do not increase its reference count.
|
||||
*/
|
||||
|
||||
@@ -51,7 +51,7 @@ int mask; /* search access mask of the caller */
|
||||
/* Check whether the given inode may be accessed as directory.
|
||||
* Return OK or an appropriate error code.
|
||||
*/
|
||||
mode_t mode;
|
||||
pmode_t mode;
|
||||
|
||||
assert(attr->a_mask & SFFS_ATTR_MODE);
|
||||
|
||||
@@ -194,7 +194,7 @@ int do_lookup()
|
||||
{
|
||||
/* Resolve a path string to an inode.
|
||||
*/
|
||||
ino_t dir_ino_nr, root_ino_nr;
|
||||
pino_t dir_ino_nr, root_ino_nr;
|
||||
struct inode *cur_ino, *root_ino;
|
||||
struct inode *next_ino = NULL;
|
||||
struct sffs_attr attr;
|
||||
@@ -202,7 +202,7 @@ int do_lookup()
|
||||
char name[NAME_MAX+1];
|
||||
char *ptr, *last;
|
||||
vfs_ucred_t ucred;
|
||||
mode_t mask;
|
||||
pmode_t mask;
|
||||
size_t len;
|
||||
int r;
|
||||
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ void put_handle(struct inode *ino);
|
||||
|
||||
/* inode.c */
|
||||
struct inode *init_inode(void);
|
||||
struct inode *find_inode(ino_t ino_nr);
|
||||
struct inode *find_inode(pino_t ino_nr);
|
||||
void get_inode(struct inode *ino);
|
||||
void put_inode(struct inode *ino);
|
||||
void link_inode(struct inode *parent, struct inode *ino);
|
||||
@@ -58,7 +58,7 @@ int do_read(void);
|
||||
int do_getdents(void);
|
||||
|
||||
/* stat.c */
|
||||
mode_t get_mode(struct inode *ino, int mode);
|
||||
pmode_t get_mode(struct inode *ino, int mode);
|
||||
int do_stat(void);
|
||||
int do_chmod(void);
|
||||
int do_utime(void);
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
/*===========================================================================*
|
||||
* get_mode *
|
||||
*===========================================================================*/
|
||||
mode_t get_mode(ino, mode)
|
||||
pmode_t get_mode(ino, mode)
|
||||
struct inode *ino;
|
||||
int mode;
|
||||
{
|
||||
@@ -47,7 +47,7 @@ int do_stat()
|
||||
struct sffs_attr attr;
|
||||
struct stat stat;
|
||||
char path[PATH_MAX];
|
||||
ino_t ino_nr;
|
||||
pino_t ino_nr;
|
||||
int r;
|
||||
|
||||
ino_nr = m_in.REQ_INODE_NR;
|
||||
|
||||
@@ -426,7 +426,7 @@ struct inode *get_inode_by_index(struct inode *parent, index_t index)
|
||||
/*===========================================================================*
|
||||
* find_inode *
|
||||
*===========================================================================*/
|
||||
struct inode *find_inode(ino_t num)
|
||||
struct inode *find_inode(pino_t num)
|
||||
{
|
||||
/* Retrieve an inode by inode number.
|
||||
*/
|
||||
@@ -442,7 +442,7 @@ struct inode *find_inode(ino_t num)
|
||||
/*===========================================================================*
|
||||
* get_inode *
|
||||
*===========================================================================*/
|
||||
struct inode *get_inode(ino_t num)
|
||||
struct inode *get_inode(pino_t num)
|
||||
{
|
||||
/* Retrieve an inode by inode number, and increase its reference count.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ static int access_as_dir(struct inode *node, vfs_ucred_t *ucred)
|
||||
/* Check whether the given inode may be accessed as directory.
|
||||
* Return OK or an appropriate error code.
|
||||
*/
|
||||
mode_t mask;
|
||||
pmode_t mask;
|
||||
int i;
|
||||
|
||||
/* The inode must be a directory to begin with. */
|
||||
@@ -149,7 +149,7 @@ int fs_lookup(void)
|
||||
{
|
||||
/* Resolve a path string to an inode.
|
||||
*/
|
||||
ino_t dir_ino_nr, root_ino_nr;
|
||||
pino_t dir_ino_nr, root_ino_nr;
|
||||
struct inode *cur_ino, *next_ino, *root_ino;
|
||||
char path[PATH_MAX], name[PNAME_MAX+1];
|
||||
char *ptr, *last;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
void init_inodes(unsigned int inodes, struct inode_stat *stat, index_t
|
||||
nr_indexed_entries);
|
||||
void cleanup_inodes(void);
|
||||
struct inode *find_inode(ino_t num);
|
||||
struct inode *get_inode(ino_t num);
|
||||
struct inode *find_inode(pino_t num);
|
||||
struct inode *get_inode(pino_t num);
|
||||
void put_inode(struct inode *node);
|
||||
void ref_inode(struct inode *node);
|
||||
int get_inode_number(struct inode *node);
|
||||
|
||||
Reference in New Issue
Block a user