Now that we have enough room in the message, remove these types.
Change-Id: Ib734c6f0209b259a14a1189b3886b9c8474e1b9a
gid_t vu_sgroups[NGROUPS_MAX];
} vfs_ucred_t;
-/* Some system types are larger than what the protocol and FSes use */
-typedef u16_t puid_t; /* Protocol version of uid_t */
-typedef u16_t pgid_t; /* Protocol version of gid_t */
-typedef u16_t pmode_t; /* Protocol version of mode_t */
-typedef u32_t pino_t; /* Protocol version of ino_t */
-
/* Request numbers */
#define REQ_GETNODE (FS_BASE + 1) /* Should be removed */
#define REQ_PUTNODE (FS_BASE + 2)
static char *get_name(char *name, char string[NAME_MAX+1]);
static int ltraverse(struct puffs_node *pn, 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
puffs_node **res_inop, size_t *offsetp, int *symlinkp);
/*===========================================================================*
* parse_path *
*===========================================================================*/
static int parse_path(
- pino_t dir_ino,
- pino_t root_ino,
+ ino_t dir_ino,
+ ino_t root_ino,
int flags,
struct puffs_node **res_inop,
size_t *offsetp,
/*===========================================================================*
* find_inode *
*===========================================================================*/
-struct inode *find_inode(pino_t ino_nr)
+struct inode *find_inode(ino_t ino_nr)
{
/* Get an inode based on its inode number. Do not increase its reference count.
*/
/* Check whether the given inode may be accessed as directory.
* Return OK or an appropriate error code.
*/
- pmode_t mode;
+ mode_t mode;
assert(attr->a_mask & SFFS_ATTR_MODE);
/* inode.c */
struct inode *init_inode(void);
-struct inode *find_inode(pino_t ino_nr);
+struct inode *find_inode(ino_t ino_nr);
void get_inode(struct inode *ino);
void put_inode(struct inode *ino);
void link_inode(struct inode *parent, struct inode *ino);
int do_getdents(void);
/* stat.c */
-pmode_t get_mode(struct inode *ino, int mode);
+mode_t get_mode(struct inode *ino, int mode);
int do_stat(void);
int do_chmod(void);
int do_utime(void);
/*===========================================================================*
* get_mode *
*===========================================================================*/
-pmode_t get_mode(struct inode *ino, int mode)
+mode_t get_mode(struct inode *ino, int mode)
{
/* Return the mode for an inode, given the inode and the retrieved mode.
*/
struct sffs_attr attr;
struct stat stat;
char path[PATH_MAX];
- pino_t ino_nr;
+ ino_t ino_nr;
int r;
ino_nr = m_in.m_vfs_fs_stat.inode;
/*===========================================================================*
* find_inode *
*===========================================================================*/
-struct inode *find_inode(pino_t num)
+struct inode *find_inode(ino_t num)
{
/* Retrieve an inode by inode number.
*/
/*===========================================================================*
* get_inode *
*===========================================================================*/
-struct inode *get_inode(pino_t num)
+struct inode *get_inode(ino_t num)
{
/* Retrieve an inode by inode number, and increase its reference count.
*/
/* Check whether the given inode may be accessed as directory.
* Return OK or an appropriate error code.
*/
- pmode_t mask;
+ mode_t mask;
int i;
/* The inode must be a directory to begin with. */
void init_inodes(unsigned int inodes, struct inode_stat *stat, index_t
nr_indexed_entries);
void cleanup_inodes(void);
-struct inode *find_inode(pino_t num);
-struct inode *get_inode(pino_t num);
+struct inode *find_inode(ino_t num);
+struct inode *get_inode(ino_t num);
void put_inode(struct inode *node);
void ref_inode(struct inode *node);
int get_inode_number(struct inode *node);
#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 */
/*===========================================================================*
* 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. */
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;
*===========================================================================*/
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
*===========================================================================*/
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. */
/* 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 */
{
/* 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. */
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 */
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);
}
/* 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);
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);
}
}
* writing is done.
*/
int r;
- pmode_t file_type;
+ mode_t file_type;
discard_preallocated_blocks(rip);
#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);
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;
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
* 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
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);
/*===========================================================================*
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;
* 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;
* 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. */
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
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;
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);
}
} 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);
/* 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;
/*===========================================================================*
* 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
*/
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. */
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);
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 */
/* 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. */
* get_dir_record *
*===========================================================================*/
struct dir_record *get_dir_record(id_dir_record)
-pino_t id_dir_record;
+ino_t id_dir_record;
{
struct dir_record *dir = NULL;
u32_t address;
/* Set physical address of the dir record */
dir->d_phy_addr = address;
- dir->d_ino_nr = (pino_t) address; /* u32_t e ino_t are the same datatype so
- * the cast is safe */
+ dir->d_ino_nr = address;
+
return(OK);
}
/* Memory attrs */
u8_t d_count; /* Count if the dir_record is in use or not */
- pmode_t d_mode; /* file type, protection, etc. */
+ mode_t d_mode; /* file type, protection, etc. */
/* struct hash_idi_entry *id; */ /* id associated */
u32_t d_phy_addr; /* physical address of this dir record */
- pino_t d_ino_nr; /* inode number (identical to the address) */
+ ino_t d_ino_nr; /* inode number (identical to the address) */
char d_mountpoint; /* true if mounted on */
struct dir_record *d_next; /* In case the file consists in more file sections
this points to the next one */
#include "buf.h"
static char *get_name(char *name, char string[NAME_MAX+1]);
-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
dir_record **res_inop, size_t *offsetp);
int search_dir(
register struct dir_record *ldir_ptr, /* dir record parent */
char string[NAME_MAX], /* component to search for */
- pino_t *numb /* pointer to new dir record */
+ ino_t *numb /* pointer to new dir record */
) {
struct dir_record *dir_tmp;
register struct buf *bp;
* parse_path *
*===========================================================================*/
static int parse_path(
-pino_t dir_ino,
-pino_t root_ino,
+ino_t dir_ino,
+ino_t root_ino,
int flags,
struct dir_record **res_inop,
size_t *offsetp
/* Find starting inode inode according to the request message */
if ((start_dir = get_dir_record(dir_ino)) == NULL) {
- printf("ISOFS: couldn't find starting inode %u\n", dir_ino);
+ printf("ISOFS: couldn't find starting inode %llu\n", dir_ino);
return(ENOENT);
}
register struct dir_record *rip = NULL;
int r;
- pino_t numb;
+ ino_t numb;
/* If 'string' is empty, yield same inode straight away. */
if (string[0] == '\0') {
int create_ext_attr(struct ext_attr_rec *ext, char *buffer);
int fs_getnode(void);
int fs_putnode(void);
-struct dir_record *get_dir_record(pino_t id_dir);
+struct dir_record *get_dir_record(ino_t id_dir);
struct dir_record *get_free_dir_record(void);
struct ext_attr_rec *get_free_ext_attr(void);
struct dir_record *load_dir_record_from_disk(u32_t address);
int fs_lookup(void);
int advance(struct dir_record *dirp, char string[NAME_MAX], struct
dir_record **resp);
-int search_dir(struct dir_record *ldir_ptr,char string [NAME_MAX],pino_t *numb);
+int search_dir(struct dir_record *ldir_ptr, char string [NAME_MAX], ino_t *numb);
/* read.c */
int fs_read(void);
int fs_getdents(void)
{
struct dir_record *dir;
- pino_t ino;
+ ino_t ino;
cp_grant_id_t gid;
size_t block_size;
off_t pos, block_pos, block, cur_pos, tmpbuf_offset, userbuf_off;
#define END_OF_FILE (-104) /* eof detected */
-#define ROOT_INODE ((pino_t) 1) /* inode number for root directory */
+#define ROOT_INODE ((ino_t) 1) /* inode number for root directory */
#define BOOT_BLOCK ((block_t) 0) /* block number of boot block */
#define SUPER_BLOCK_BYTES (1024) /* bytes offset */
#define START_BLOCK ((block_t) 2) /* first block of FS (not counting SB) */
static void addhash_inode(struct inode *node);
-static void free_inode(dev_t dev, pino_t numb);
+static void free_inode(dev_t dev, ino_t numb);
static void new_icopy(struct inode *rip, d2_inode *dip, int direction,
int norm);
static void unhash_inode(struct inode *node);
*===========================================================================*/
struct inode *get_inode(
dev_t dev, /* device on which inode resides */
- pino_t numb /* inode number */
+ ino_t numb /* inode number */
)
{
/* Find the inode in the hash table. If it is not there, get a free inode
*===========================================================================*/
struct inode *find_inode(
dev_t dev, /* device on which inode resides */
- pino_t numb /* inode number */
+ ino_t numb /* inode number */
)
{
/* Find the inode specified by the inode and device number.
/*===========================================================================*
* alloc_inode *
*===========================================================================*/
-struct inode *alloc_inode(dev_t dev, pmode_t bits)
+struct inode *alloc_inode(dev_t dev, mode_t bits)
{
/* Allocate a free inode on 'dev', and return a pointer to it. */
*===========================================================================*/
static void free_inode(
dev_t dev, /* on which device is the inode? */
- pino_t inumb /* number of the inode to be freed */
+ ino_t inumb /* number of the inode to be freed */
)
{
/* Return an inode to the pool of unallocated inodes. */
if (direction == READING) {
/* Copy V2.x inode to the in-core table, swapping bytes if need be. */
- rip->i_mode = (pmode_t) conv2(norm,dip->d2_mode);
+ rip->i_mode = (mode_t) conv2(norm,dip->d2_mode);
rip->i_uid = (uid_t) conv2(norm,dip->d2_uid);
rip->i_nlinks = (nlink_t) conv2(norm,dip->d2_nlinks);
rip->i_gid = (gid_t) conv2(norm,dip->d2_gid);
/* 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 */
unsigned int i_ndzones; /* # direct zones (Vx_NR_DZONES) */
unsigned int i_nindirs; /* # indirect zones per indirect block */
{
/* 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. */
int odir, ndir; /* TRUE iff {old|new} file is dir */
int same_pdir; /* TRUE iff parent dirs are the same */
char old_name[MFS_NAME_MAX], new_name[MFS_NAME_MAX];
- pino_t numb;
+ ino_t numb;
phys_bytes len;
/* Copy the last component of the old name */
}
/* 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);
* writing is done.
*/
int r;
- pmode_t file_type;
+ mode_t file_type;
file_type = rip->i_mode & I_TYPE; /* check to see if file is special */
if (file_type == I_CHAR_SPECIAL || file_type == I_BLOCK_SPECIAL)
*/
register struct inode *rip;
int r = OK;
- pmode_t bits;
+ mode_t bits;
/* Temporarily open the file. */
if( (rip = get_inode(fs_dev, fs_m_in.m_vfs_fs_mountpoint.inode)) == NULL)
#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, zone_t z0);
/*===========================================================================*
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[MFS_NAME_MAX]; /* last component */
phys_bytes len;
/* It was not possible to enter . or .. probably disk was full -
* links counts haven't been touched. */
if(search_dir(ldirp, lastc, NULL, DELETE, IGN_PERM) != OK)
- panic("Dir disappeared: %ul", rip->i_num);
+ panic("Dir disappeared: %llu", rip->i_num);
rip->i_nlinks--; /* undo the increment done in new_node() */
}
IN_MARKDIRTY(rip); /* either way, i_nlinks has changed */
return(EINVAL);
/* Create the inode for the symlink. */
- sip = new_node(ldirp, string, (pmode_t) (I_SYMBOLIC_LINK | RWX_MODES),
- (zone_t) 0);
+ sip = new_node(ldirp, string, (I_SYMBOLIC_LINK | RWX_MODES), 0);
/* Allocate a disk block for the contents of the symlink.
* Copy contents of symlink (the name pointed to) into first disk block. */
* new_node *
*===========================================================================*/
static struct inode *new_node(struct inode *ldirp,
- char *string, pmode_t bits, zone_t z0)
+ char *string, mode_t bits, zone_t z0)
{
/* 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
static char *get_name(char *name, char string[MFS_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);
* parse_path *
*===========================================================================*/
static int parse_path(
-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,
* 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. */
int search_dir(ldir_ptr, string, numb, flag, check_permissions)
register struct inode *ldir_ptr; /* ptr to inode for dir to search */
char string[MFS_NAME_MAX]; /* 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 */
{
register struct direct *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, old_slots;
struct super_block *sp;
if (flag == IS_EMPTY) r = ENOTEMPTY;
else if (flag == DELETE) {
/* Save d_ino for recovery. */
- t = MFS_NAME_MAX - sizeof(pino_t);
- *((pino_t *) &dp->mfs_d_name[t]) = dp->mfs_d_ino;
+ t = MFS_NAME_MAX - sizeof(ino_t);
+ *((ino_t *) &dp->mfs_d_name[t]) = dp->mfs_d_ino;
dp->mfs_d_ino = NO_ENTRY; /* erase entry */
MARKDIRTY(bp);
ldir_ptr->i_update |= CTIME | MTIME;
ldir_ptr->i_last_dpos = pos;
} else {
sp = ldir_ptr->i_sp; /* 'flag' is LOOK_UP */
- *numb = (pino_t) conv4(sp->s_native,
+ *numb = (ino_t) conv4(sp->s_native,
(int) dp->mfs_d_ino);
}
assert(lmfs_dev(bp) != NO_DEV);
/* 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;
/*===========================================================================*
* 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
*/
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. */
void free_zone(dev_t dev, zone_t numb);
/* inode.c */
-struct inode *alloc_inode(dev_t dev, pmode_t bits);
+struct inode *alloc_inode(dev_t dev, mode_t bits);
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);
int fs_lookup(void);
struct inode *advance(struct inode *dirp, char string[MFS_NAME_MAX], int
chk_perm);
-int search_dir(struct inode *ldir_ptr, char string [MFS_NAME_MAX], pino_t
+int search_dir(struct inode *ldir_ptr, char string [MFS_NAME_MAX], ino_t
*numb, int flag, int check_permissions);
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 */
r = OK;
/* Find the inode referred */
- if ((rip = find_inode(fs_dev, (pino_t) fs_m_in.m_vfs_fs_readwrite.inode)) == NULL)
+ if ((rip = find_inode(fs_dev, fs_m_in.m_vfs_fs_readwrite.inode)) == NULL)
return(EINVAL);
mode_word = rip->i_mode & I_TYPE;
register struct inode *rip;
int o, r, done;
unsigned int block_size, len, reclen;
- pino_t ino;
+ ino_t ino;
cp_grant_id_t gid;
size_t size, tmpbuf_off, userbuf_off;
off_t pos, off, block_pos, new_pos, ent_pos;
/* 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. */
/* If the super block has the wrong byte order, swap the fields; the magic
* number doesn't need conversion. */
- sp->s_ninodes = (pino_t) conv4(native, (int) sp->s_ninodes);
+ sp->s_ninodes = (ino_t) conv4(native, (int) sp->s_ninodes);
sp->s_nzones = (zone1_t) conv2(native, (int) sp->s_nzones);
sp->s_imap_blocks = (short) conv2(native, (int) sp->s_imap_blocks);
sp->s_zmap_blocks = (short) conv2(native, (int) sp->s_zmap_blocks);
/* Header portion of the buffer. */
struct buf *b_next; /* used to link all free bufs in a chain */
struct buf *b_prev; /* used to link all free bufs the other way */
- pino_t b_num; /* inode number on minor device */
+ ino_t b_num; /* inode number on minor device */
dev_t b_dev; /* major | minor device where block resides */
int b_bytes; /* Number of bytes allocated in bp */
int b_count; /* Number of users of this buffer */
#include <stdlib.h>
#include <string.h>
-static struct buf *new_block(dev_t dev, pino_t inum);
+static struct buf *new_block(dev_t dev, ino_t inum);
/*===========================================================================*
* buf_pool *
/*===========================================================================*
* get_block *
*===========================================================================*/
-struct buf *get_block(dev_t dev, pino_t inum)
+struct buf *get_block(dev_t dev, ino_t inum)
{
struct buf *bp = front;
/*===========================================================================*
* new_block *
*===========================================================================*/
-static struct buf *new_block(dev_t dev, pino_t inum)
+static struct buf *new_block(dev_t dev, ino_t inum)
{
/* Allocate a new buffer and add it to the double linked buffer list */
struct buf *bp;
/*===========================================================================*
* put_block *
*===========================================================================*/
-void put_block(dev_t dev, pino_t inum)
+void put_block(dev_t dev, ino_t inum)
{
struct buf *bp;
rip = find_inode(fs_m_in->m_vfs_fs_putnode.inode);
if(!rip) {
- printf("%s:%d put_inode: inode #%ld not found\n", __FILE__,
+ printf("%s:%d put_inode: inode #%llu not found\n", __FILE__,
__LINE__, fs_m_in->m_vfs_fs_putnode.inode);
panic("fs_putnode failed");
}
*===========================================================================*/
struct inode *get_inode(
dev_t dev, /* device on which inode resides */
- pino_t numb /* inode number */
+ ino_t numb /* inode number */
)
{
/* Find the inode in the hash table. If it is not there, get a free inode
/*===========================================================================*
* find_inode *
*===========================================================================*/
-struct inode *find_inode(pino_t numb /* inode number */)
+struct inode *find_inode(ino_t numb /* inode number */)
{
/* Find the inode specified by the inode and device number.
*/
/*===========================================================================*
* alloc_inode *
*===========================================================================*/
-struct inode *alloc_inode(dev_t dev, pmode_t bits, uid_t uid, gid_t gid)
+struct inode *alloc_inode(dev_t dev, mode_t bits, uid_t uid, gid_t gid)
{
/* Allocate a free inode on 'dev', and return a pointer to it. */
register struct inode *rip;
bit_t b;
- pino_t i_num;
+ ino_t i_num;
int print_oos_msg = 1;
b = alloc_bit();
print_oos_msg = 0; /* Don't repeat message */
return(NULL);
}
- i_num = (pino_t) b;
+ i_num = (ino_t) b;
print_oos_msg = 1;
bit_t b;
- if (rip->i_num <= (pino_t) 0 || rip->i_num >= (pino_t) PFS_NR_INODES) return;
+ if (rip->i_num <= 0 || rip->i_num >= PFS_NR_INODES) return;
b = (bit_t) rip->i_num;
free_bit(b);
}
#include <sys/queue.h>
EXTERN struct inode {
- pmode_t i_mode; /* file type, protection, etc. */
+ mode_t i_mode; /* file type, protection, etc. */
nlink_t i_nlinks; /* how many links to this file */
uid_t i_uid; /* user id of the file's owner */
gid_t i_gid; /* group number */
struct inode;
/* buffer.c */
-struct buf *get_block(dev_t dev, pino_t inum);
-void put_block(dev_t dev, pino_t inum);
+struct buf *get_block(dev_t dev, ino_t inum);
+void put_block(dev_t dev, ino_t inum);
/* cache.c */
void buf_pool(void);
/* inode.c */
-struct inode *alloc_inode(dev_t dev, pmode_t mode, uid_t uid, gid_t gid);
+struct inode *alloc_inode(dev_t dev, mode_t mode, uid_t uid, gid_t gid);
void dup_inode(struct inode *ip);
-struct inode *find_inode(pino_t numb);
+struct inode *find_inode(ino_t numb);
void free_inode(struct inode *rip);
int fs_putnode(message *fs_m_in, message *fs_m_out);
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 wipe_inode(struct inode *rip);
struct buf *bp;
cp_grant_id_t gid;
off_t position, f_size;
- unsigned int nrbytes, cum_io;
+ size_t nrbytes, cum_io;
mode_t mode_word;
struct inode *rip;
ino_t inumb;
/* Get the values from the request message */
rw_flag = (fs_m_in->m_type == REQ_READ ? READING : WRITING);
gid = fs_m_in->m_vfs_fs_readwrite.grant;
- nrbytes = (unsigned) fs_m_in->m_vfs_fs_readwrite.nbytes;
+ nrbytes = fs_m_in->m_vfs_fs_readwrite.nbytes;
/* We can't read beyond the max file position */
if (nrbytes > PIPE_BUF) return(EFBIG);
if (rw_flag == WRITING) rip->i_update |= CTIME | MTIME;
}
- fs_m_out->m_fs_vfs_readwrite.nbytes = (size_t) cum_io;
+ fs_m_out->m_fs_vfs_readwrite.nbytes = cum_io;
fs_m_out->m_fs_vfs_readwrite.seek_pos = rip->i_size;
put_inode(rip);
)
{
/* Common code for stat and fstat system calls. */
- pmode_t type;
+ mode_t type;
struct stat statbuf;
u32_t blocks; /* The unit of this is 512 */
int r, s;
*/
struct file {
char *name; /* file name, maximum length PNAME_MAX */
- pmode_t mode; /* file mode, including file type */
+ mode_t mode; /* file mode, including file type */
data_t data; /* custom data associated with this file */
};
*===========================================================================*/
static int req_readwrite_actual(endpoint_t fs_e, ino_t inode_nr, off_t pos,
int rw_flag, endpoint_t user_e, vir_bytes user_addr,
- unsigned int num_of_bytes, off_t *new_posp, unsigned int *cum_iop,
+ unsigned int num_of_bytes, off_t *new_posp, size_t *cum_iop,
int cpflag)
{
struct vmnt *vmp;