Remove protocol version of {mode,ino,uid,gid}_t

Now that we have enough room in the message, remove these types.

Change-Id: Ib734c6f0209b259a14a1189b3886b9c8474e1b9a
This commit is contained in:
2014-07-28 17:05:29 +02:00
parent 56350a991b
commit b6aa3714a1
45 changed files with 127 additions and 135 deletions
+1 -1
View File
@@ -55,7 +55,7 @@
#define SUPER_BLOCK_BYTES (1024) /* bytes offset */
#define ROOT_INODE ((pino_t) 2) /* inode number for root directory */
#define ROOT_INODE ((ino_t) 2) /* inode number for root directory */
#define BOOT_BLOCK ((block_t) 0) /* block number of boot block */
#define START_BLOCK ((block_t) 2) /* first block of FS (not counting SB) */
#define BLOCK_ADDRESS_BYTES 4 /* bytes per address */
+2 -2
View File
@@ -29,7 +29,7 @@ static void wipe_inode(struct inode *rip);
/*===========================================================================*
* alloc_inode *
*===========================================================================*/
struct inode *alloc_inode(struct inode *parent, pmode_t bits)
struct inode *alloc_inode(struct inode *parent, mode_t bits)
{
/* Allocate a free inode on parent's dev, and return a pointer to it. */
@@ -125,7 +125,7 @@ struct inode *parent; /* parent of newly allocated inode */
int is_dir; /* inode will be a directory if it is TRUE */
{
int group;
pino_t inumber = NO_BIT;
ino_t inumber = NO_BIT;
bit_t bit;
struct buf *bp;
struct group_desc *gd;
+2 -2
View File
@@ -120,7 +120,7 @@ static void unhash_inode(struct inode *node)
*===========================================================================*/
struct inode *get_inode(
dev_t dev, /* device on which inode resides */
pino_t numb /* inode number (ANSI: may not be unshort) */
ino_t numb /* inode number (ANSI: may not be unshort) */
)
{
/* Find the inode in the hash table. If it is not there, get a free inode
@@ -198,7 +198,7 @@ struct inode *get_inode(
*===========================================================================*/
struct inode *find_inode(
dev_t dev, /* device on which inode resides */
pino_t numb /* inode number (ANSI: may not be unshort) */
ino_t numb /* inode number (ANSI: may not be unshort) */
)
{
/* Find the inode specified by the inode and device number. */
+1 -1
View File
@@ -71,7 +71,7 @@ EXTERN struct inode {
/* The following items are not present on the disk. */
dev_t i_dev; /* which device is the inode on */
pino_t i_num; /* inode number on its (minor) device */
ino_t i_num; /* inode number on its (minor) device */
int i_count; /* # times inode used; 0 means slot is free */
struct super_block *i_sp; /* pointer to super block for inode's device */
char i_dirt; /* CLEAN or DIRTY */
+6 -6
View File
@@ -271,7 +271,7 @@ char file_name[NAME_MAX + 1]; /* name of file to be removed */
{
/* Unlink 'file_name'; rip must be the inode of 'file_name' or NULL. */
pino_t numb; /* inode number */
ino_t numb; /* inode number */
int r;
/* If rip is not NULL, it is used to get faster access to the inode. */
@@ -310,7 +310,7 @@ int fs_rename()
int odir, ndir; /* TRUE iff {old|new} file is dir */
int same_pdir = 0; /* TRUE iff parent dirs are the same */
char old_name[NAME_MAX + 1], new_name[NAME_MAX + 1];
pino_t numb;
ino_t numb;
phys_bytes len;
/* Copy the last component of the old name */
@@ -334,7 +334,7 @@ int fs_rename()
NUL(new_name, len, sizeof(new_name));
/* Get old dir inode */
if( (old_dirp = get_inode(fs_dev, (pino_t) fs_m_in.m_vfs_fs_rename.dir_old)) == NULL)
if( (old_dirp = get_inode(fs_dev, fs_m_in.m_vfs_fs_rename.dir_old)) == NULL)
return(err_code);
old_ip = advance(old_dirp, old_name, IGN_PERM);
@@ -350,7 +350,7 @@ int fs_rename()
}
/* Get new dir inode */
if ((new_dirp = get_inode(fs_dev, (pino_t) fs_m_in.m_vfs_fs_rename.dir_new)) == NULL){
if ((new_dirp = get_inode(fs_dev, fs_m_in.m_vfs_fs_rename.dir_new)) == NULL){
put_inode(old_ip);
put_inode(old_dirp);
return(err_code);
@@ -483,7 +483,7 @@ int fs_rename()
r = search_dir(new_dirp, new_name, &numb, ENTER, IGN_PERM,
old_ip->i_mode & I_TYPE);
if(r == OK) {
(void) search_dir(old_dirp, old_name, (pino_t *) 0,
(void) search_dir(old_dirp, old_name, NULL,
DELETE, IGN_PERM, 0);
}
}
@@ -551,7 +551,7 @@ off_t newsize; /* inode must become this size */
* writing is done.
*/
int r;
pmode_t file_type;
mode_t file_type;
discard_preallocated_blocks(rip);
+4 -5
View File
@@ -12,7 +12,7 @@
#include "super.h"
#include <minix/vfsif.h>
static struct inode *new_node(struct inode *ldirp, char *string, pmode_t
static struct inode *new_node(struct inode *ldirp, char *string, mode_t
bits, block_t z0);
@@ -118,7 +118,7 @@ int fs_mknod()
int fs_mkdir()
{
int r1, r2; /* status codes */
pino_t dot, dotdot; /* inode numbers for . and .. */
ino_t dot, dotdot; /* inode numbers for . and .. */
struct inode *rip, *ldirp;
char lastc[NAME_MAX + 1]; /* last component */
phys_bytes len;
@@ -213,8 +213,7 @@ int fs_slink()
return(EINVAL);
/* Create the inode for the symlink. */
sip = new_node(ldirp, string, (pmode_t) (I_SYMBOLIC_LINK | RWX_MODES),
(block_t) 0);
sip = new_node(ldirp, string, (I_SYMBOLIC_LINK | RWX_MODES), 0);
/* If we can then create fast symlink (store it in inode),
* Otherwise allocate a disk block for the contents of the symlink and
@@ -278,7 +277,7 @@ int fs_slink()
* new_node *
*===========================================================================*/
static struct inode *new_node(struct inode *ldirp,
char *string, pmode_t bits, block_t b0)
char *string, mode_t bits, block_t b0)
{
/* New_node() is called by fs_open(), fs_mknod(), and fs_mkdir().
* In all cases it allocates a new inode, makes a directory entry for it in
+11 -11
View File
@@ -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 inode *rip, char *suffix);
static int parse_path(pino_t dir_ino, pino_t root_ino, int flags, struct
static int parse_path(ino_t dir_ino, ino_t root_ino, int flags, struct
inode **res_inop, size_t *offsetp, int *symlinkp);
/*===========================================================================*
@@ -41,7 +41,7 @@ int fs_lookup()
int r, r1, flags, symlinks;
unsigned int len;
size_t offset = 0, path_size;
pino_t dir_ino, root_ino;
ino_t dir_ino, root_ino;
struct inode *rip;
grant = fs_m_in.m_vfs_fs_lookup.grant_path;
@@ -121,8 +121,8 @@ int fs_lookup()
* parse_path *
*===========================================================================*/
static int parse_path(dir_ino, root_ino, flags, res_inop, offsetp, symlinkp)
pino_t dir_ino;
pino_t root_ino;
ino_t dir_ino;
ino_t root_ino;
int flags;
struct inode **res_inop;
size_t *offsetp;
@@ -370,7 +370,7 @@ int chk_perm; /* check permissions when string is looked up*/
* the directory, find the inode, open it, and return a pointer to its inode
* slot.
*/
pino_t numb;
ino_t numb;
struct inode *rip;
/* If 'string' is empty, return an error. */
@@ -483,7 +483,7 @@ char string[NAME_MAX+1]; /* component extracted from 'old_name' */
int search_dir(ldir_ptr, string, numb, flag, check_permissions, ftype)
register struct inode *ldir_ptr; /* ptr to inode for dir to search */
const char string[NAME_MAX + 1]; /* component to search for */
pino_t *numb; /* pointer to inode number */
ino_t *numb; /* pointer to inode number */
int flag; /* LOOK_UP, ENTER, DELETE or IS_EMPTY */
int check_permissions; /* check permissions when flag is !IS_EMPTY */
int ftype; /* used when ENTER and
@@ -502,7 +502,7 @@ int ftype; /* used when ENTER and
register struct ext2_disk_dir_desc *prev_dp = NULL;
register struct buf *bp = NULL;
int i, r, e_hit, t, match;
pmode_t bits;
mode_t bits;
off_t pos;
unsigned new_slots;
int extended = 0;
@@ -576,10 +576,10 @@ int ftype; /* used when ENTER and
r = OK;
if (flag == IS_EMPTY) r = ENOTEMPTY;
else if (flag == DELETE) {
if (dp->d_name_len >= sizeof(pino_t)) {
if (dp->d_name_len >= sizeof(ino_t)) {
/* Save d_ino for recovery. */
t = dp->d_name_len - sizeof(pino_t);
*((pino_t *) &dp->d_name[t])= dp->d_ino;
t = dp->d_name_len - sizeof(ino_t);
*((ino_t *) &dp->d_name[t])= dp->d_ino;
}
dp->d_ino = NO_ENTRY; /* erase entry */
lmfs_markdirty(bp);
@@ -619,7 +619,7 @@ int ftype; /* used when ENTER and
}
} else {
/* 'flag' is LOOK_UP */
*numb = (pino_t) conv4(le_CPU, dp->d_ino);
*numb = (ino_t) conv4(le_CPU, dp->d_ino);
}
assert(lmfs_dev(bp) != NO_DEV);
put_block(bp, DIRECTORY_BLOCK);
+3 -3
View File
@@ -18,7 +18,7 @@ int fs_chmod()
/* Perform the chmod(name, mode) system call. */
register struct inode *rip;
pmode_t mode;
mode_t mode;
mode = fs_m_in.m_vfs_fs_chmod.mode;
@@ -72,7 +72,7 @@ int fs_chown()
/*===========================================================================*
* forbidden *
*===========================================================================*/
int forbidden(register struct inode *rip, pmode_t access_desired)
int forbidden(struct inode *rip, mode_t access_desired)
{
/* Given a pointer to an inode, 'rip', and the access desired, determine
* if the access is allowed, and if not why not. The routine looks up the
@@ -81,7 +81,7 @@ int forbidden(register struct inode *rip, pmode_t access_desired)
*/
register struct inode *old_rip = rip;
register pmode_t bits, perm_bits;
mode_t bits, perm_bits;
int r, shift;
/* Isolate the relevant rwx bits from the mode. */
+5 -5
View File
@@ -19,15 +19,15 @@ block_t alloc_block(struct inode *rip, block_t goal);
void free_block(struct super_block *sp, bit_t bit);
/* ialloc.c */
struct inode *alloc_inode(struct inode *parent, pmode_t bits);
struct inode *alloc_inode(struct inode *parent, mode_t bits);
void free_inode(struct inode *rip);
/* inode.c */
void dup_inode(struct inode *ip);
struct inode *find_inode(dev_t dev, pino_t numb);
struct inode *find_inode(dev_t dev, ino_t numb);
int fs_putnode(void);
void init_inode_cache(void);
struct inode *get_inode(dev_t dev, pino_t numb);
struct inode *get_inode(dev_t dev, ino_t numb);
void put_inode(struct inode *rip);
void update_times(struct inode *rip);
void rw_inode(struct inode *rip, int rw_flag);
@@ -62,14 +62,14 @@ int fs_slink(void);
int fs_lookup(void);
struct inode *advance(struct inode *dirp, char string[NAME_MAX + 1], int
chk_perm);
int search_dir(struct inode *ldir_ptr, const char string [NAME_MAX + 1], pino_t
int search_dir(struct inode *ldir_ptr, const char string [NAME_MAX + 1], ino_t
*numb, int flag, int check_permissions, int ftype);
/* protect.c */
int fs_chmod(void);
int fs_chown(void);
int fs_getdents(void);
int forbidden(struct inode *rip, pmode_t access_desired);
int forbidden(struct inode *rip, mode_t access_desired);
int read_only(struct inode *ip);
/* read.c */
+1 -1
View File
@@ -23,7 +23,7 @@ static int stat_inode(
/* Common code for stat and fstat system calls. */
struct stat statbuf;
pmode_t mo;
mode_t mo;
int r, s;
/* Update the atime, ctime, and mtime fields in the inode, if need be. */