} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ dev_t device;
+
+ uint32_t flags;
+ size_t path_len;
+ cp_grant_id_t grant;
+
+ uint8_t data[36];
+} mess_vfs_fs_readsuper;
+_ASSERT_MSG_SIZE(mess_vfs_fs_readsuper);
+
+typedef struct {
+ off_t file_size;
+ dev_t device;
+ ino_t inode;
+
+ uint32_t flags;
+ mode_t mode;
+ uid_t uid;
+ gid_t gid;
+
+ uint16_t con_reqs;
+
+ uint8_t data[14];
+} mess_fs_vfs_readsuper;
+_ASSERT_MSG_SIZE(mess_fs_vfs_readsuper);
+
typedef struct {
time_t atime;
time_t mtime;
mess_mmap m_mmap;
mess_notify m_notify;
mess_sigcalls m_sigcalls;
+ mess_vfs_fs_readsuper m_vfs_fs_readsuper;
+ mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_vfs_utimens m_vfs_utimens;
mess_vm_vfs_mmap m_vm_vfs_mmap;
mess_vmmcp m_vmmcp;
{
struct vattr *root_va;
- fs_dev = fs_m_in.REQ_DEV;
- is_readonly_fs = (fs_m_in.REQ_FLAGS & REQ_RDONLY) ? 1 : 0;
- is_root_fs = (fs_m_in.REQ_FLAGS & REQ_ISROOT) ? 1 : 0;
+ fs_dev = fs_m_in.m_vfs_fs_readsuper.device;
+ is_readonly_fs = (fs_m_in.m_vfs_fs_readsuper.flags & REQ_RDONLY) ? 1 : 0;
+ is_root_fs = (fs_m_in.m_vfs_fs_readsuper.flags & REQ_ISROOT) ? 1 : 0;
/* Open root pnode */
global_pu->pu_pn_root->pn_count = 1;
/* Root pnode properties */
root_va = &global_pu->pu_pn_root->pn_va;
- fs_m_out.RES_INODE_NR = root_va->va_fileid;
- fs_m_out.RES_MODE = root_va->va_mode;
- fs_m_out.RES_FILE_SIZE = root_va->va_size;
- fs_m_out.RES_UID = root_va->va_uid;
- fs_m_out.RES_GID = root_va->va_gid;
- fs_m_out.RES_FLAGS = RES_NOFLAGS;
+ fs_m_out.m_fs_vfs_readsuper.inode = root_va->va_fileid;
+ fs_m_out.m_fs_vfs_readsuper.mode = root_va->va_mode;
+ fs_m_out.m_fs_vfs_readsuper.file_size = root_va->va_size;
+ fs_m_out.m_fs_vfs_readsuper.uid = root_va->va_uid;
+ fs_m_out.m_fs_vfs_readsuper.gid = root_va->va_gid;
+ fs_m_out.m_fs_vfs_readsuper.flags = RES_NOFLAGS;
return(OK);
}
int r;
dprintf(("%s: readsuper (dev %x, flags %x)\n",
- sffs_name, m_in.REQ_DEV, m_in.REQ_FLAGS));
+ sffs_name, m_in.m_vfs_fs_readsuper.device, m_in.vfs_fs_readsuper.flags));
- if (m_in.REQ_FLAGS & REQ_ISROOT) {
+ if (m_in.m_vfs_fs_readsuper.flags & REQ_ISROOT) {
printf("%s: attempt to mount as root device\n", sffs_name);
return EINVAL;
}
- state.s_read_only = !!(m_in.REQ_FLAGS & REQ_RDONLY);
- state.s_dev = m_in.REQ_DEV;
+ state.s_read_only = !!(m_in.m_vfs_fs_readsuper.flags & REQ_RDONLY);
+ state.s_dev = m_in.m_vfs_fs_readsuper.device;
init_dentry();
ino = init_inode();
return r;
}
- m_out.RES_INODE_NR = INODE_NR(ino);
- m_out.RES_MODE = get_mode(ino, attr.a_mode);
- m_out.RES_FILE_SIZE = attr.a_size;
- m_out.RES_UID = sffs_params->p_uid;
- m_out.RES_GID = sffs_params->p_gid;
- m_out.RES_DEV = NO_DEV;
- m_out.RES_FLAGS = RES_64BIT;
+ m_out.m_fs_vfs_readsuper.inode = INODE_NR(ino);
+ m_out.m_fs_vfs_readsuper.mode = get_mode(ino, attr.a_mode);
+ m_out.m_fs_vfs_readsuper.file_size = attr.a_size;
+ m_out.m_fs_vfs_readsuper.uid = sffs_params->p_uid;
+ m_out.m_fs_vfs_readsuper.gid = sffs_params->p_gid;
+ m_out.m_fs_vfs_readsuper.device = NO_DEV;
+ m_out.m_fs_vfs_readsuper.flags = RES_64BIT;
state.s_mounted = TRUE;
struct inode *root;
/* Get the device number, for stat requests. */
- fs_dev = fs_m_in.REQ_DEV;
+ fs_dev = fs_m_in.m_vfs_fs_readsuper.device;
/* The VTreeFS must not be mounted as a root file system. */
- if (fs_m_in.REQ_FLAGS & REQ_ISROOT)
+ if (fs_m_in.m_vfs_fs_readsuper.flags & REQ_ISROOT)
return EINVAL;
/* Get the root inode and increase its reference count. */
vtreefs_hooks->init_hook();
/* Return the root inode's properties. */
- fs_m_out.RES_INODE_NR = get_inode_number(root);
- fs_m_out.RES_MODE = root->i_stat.mode;
- fs_m_out.RES_FILE_SIZE = root->i_stat.size;
- fs_m_out.RES_UID = root->i_stat.uid;
- fs_m_out.RES_GID = root->i_stat.gid;
- fs_m_out.RES_DEV = NO_DEV;
- fs_m_out.RES_FLAGS = RES_NOFLAGS;
+ fs_m_out.m_fs_vfs_readsuper.inode = get_inode_number(root);
+ fs_m_out.m_fs_vfs_readsuper.mode = root->i_stat.mode;
+ fs_m_out.m_fs_vfs_readsuper.file_size = root->i_stat.size;
+ fs_m_out.m_fs_vfs_readsuper.uid = root->i_stat.uid;
+ fs_m_out.m_fs_vfs_readsuper.gid = root->i_stat.gid;
+ fs_m_out.m_fs_vfs_readsuper.device = NO_DEV;
+ fs_m_out.m_fs_vfs_readsuper.flags = RES_NOFLAGS;
fs_mounted = TRUE;
int readonly, isroot;
u32_t mask;
- fs_dev = fs_m_in.REQ_DEV;
- label_gid = fs_m_in.REQ_GRANT;
- label_len = fs_m_in.REQ_PATH_LEN;
- readonly = (fs_m_in.REQ_FLAGS & REQ_RDONLY) ? 1 : 0;
- isroot = (fs_m_in.REQ_FLAGS & REQ_ISROOT) ? 1 : 0;
+ fs_dev = fs_m_in.m_vfs_fs_readsuper.device;
+ label_gid = fs_m_in.m_vfs_fs_readsuper.grant;
+ label_len = fs_m_in.m_vfs_fs_readsuper.path_len;
+ readonly = (fs_m_in.m_vfs_fs_readsuper.flags & REQ_RDONLY) ? 1 : 0;
+ isroot = (fs_m_in.m_vfs_fs_readsuper.flags & REQ_ISROOT) ? 1 : 0;
if (label_len > sizeof(fs_dev_label))
return(EINVAL);
}
/* Root inode properties */
- fs_m_out.RES_INODE_NR = root_ip->i_num;
- fs_m_out.RES_MODE = root_ip->i_mode;
- fs_m_out.RES_FILE_SIZE = root_ip->i_size;
- fs_m_out.RES_UID = root_ip->i_uid;
- fs_m_out.RES_GID = root_ip->i_gid;
- fs_m_out.RES_FLAGS = RES_HASPEEK;
+ fs_m_out.m_fs_vfs_readsuper.inode = root_ip->i_num;
+ fs_m_out.m_fs_vfs_readsuper.mode = root_ip->i_mode;
+ fs_m_out.m_fs_vfs_readsuper.file_size = root_ip->i_size;
+ fs_m_out.m_fs_vfs_readsuper.uid = root_ip->i_uid;
+ fs_m_out.m_fs_vfs_readsuper.gid = root_ip->i_gid;
+ fs_m_out.m_fs_vfs_readsuper.flags = RES_HASPEEK;
return(r);
}
size_t label_len;
int r = OK;
- fs_dev = fs_m_in.REQ_DEV;
- label_gid = fs_m_in.REQ_GRANT;
- label_len = fs_m_in.REQ_PATH_LEN;
+ fs_dev = fs_m_in.m_vfs_fs_readsuper.device;
+ label_gid = fs_m_in.m_vfs_fs_readsuper.grant;
+ label_len = fs_m_in.m_vfs_fs_readsuper.path_len;
if (label_len > sizeof(fs_dev_label))
return(EINVAL);
lmfs_set_blocksize(v_pri.logical_block_size_l, major(fs_dev));
/* Return some root inode properties */
- fs_m_out.RES_INODE_NR = ID_DIR_RECORD(v_pri.dir_rec_root);
- fs_m_out.RES_MODE = v_pri.dir_rec_root->d_mode;
- fs_m_out.RES_FILE_SIZE = v_pri.dir_rec_root->d_file_size;
- fs_m_out.RES_UID = SYS_UID; /* Always root */
- fs_m_out.RES_GID = SYS_GID; /* operator */
- fs_m_out.RES_FLAGS = RES_NOFLAGS;
+ fs_m_out.m_fs_vfs_readsuper.inode = ID_DIR_RECORD(v_pri.dir_rec_root);
+ fs_m_out.m_fs_vfs_readsuper.mode = v_pri.dir_rec_root->d_mode;
+ fs_m_out.m_fs_vfs_readsuper.file_size = v_pri.dir_rec_root->d_file_size;
+ fs_m_out.m_fs_vfs_readsuper.uid = SYS_UID; /* Always root */
+ fs_m_out.m_fs_vfs_readsuper.gid = SYS_GID; /* operator */
+ fs_m_out.m_fs_vfs_readsuper.flags = RES_NOFLAGS;
return(r);
}
int r;
int readonly, isroot;
- fs_dev = fs_m_in.REQ_DEV;
- label_gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
- label_len = (size_t) fs_m_in.REQ_PATH_LEN;
- readonly = (fs_m_in.REQ_FLAGS & REQ_RDONLY) ? 1 : 0;
- isroot = (fs_m_in.REQ_FLAGS & REQ_ISROOT) ? 1 : 0;
+ fs_dev = fs_m_in.m_vfs_fs_readsuper.device;
+ label_gid = fs_m_in.m_vfs_fs_readsuper.grant;
+ label_len = fs_m_in.m_vfs_fs_readsuper.path_len;
+ readonly = (fs_m_in.m_vfs_fs_readsuper.flags & REQ_RDONLY) ? 1 : 0;
+ isroot = (fs_m_in.m_vfs_fs_readsuper.flags & REQ_ISROOT) ? 1 : 0;
if (label_len > sizeof(fs_dev_label))
return(EINVAL);
superblock.s_is_root = isroot;
/* Root inode properties */
- fs_m_out.RES_INODE_NR = root_ip->i_num;
- fs_m_out.RES_MODE = root_ip->i_mode;
- fs_m_out.RES_FILE_SIZE = root_ip->i_size;
- fs_m_out.RES_UID = root_ip->i_uid;
- fs_m_out.RES_GID = root_ip->i_gid;
- fs_m_out.RES_FLAGS = RES_HASPEEK;
+ fs_m_out.m_fs_vfs_readsuper.inode = root_ip->i_num;
+ fs_m_out.m_fs_vfs_readsuper.mode = root_ip->i_mode;
+ fs_m_out.m_fs_vfs_readsuper.file_size = root_ip->i_size;
+ fs_m_out.m_fs_vfs_readsuper.uid = root_ip->i_uid;
+ fs_m_out.m_fs_vfs_readsuper.gid = root_ip->i_gid;
+ fs_m_out.m_fs_vfs_readsuper.flags = RES_HASPEEK;
/* Mark it dirty */
if(!superblock.s_rd_only) {
/* Fill in request message */
m.m_type = REQ_READSUPER;
- m.REQ_FLAGS = 0;
- if(readonly) m.REQ_FLAGS |= REQ_RDONLY;
- if(isroot) m.REQ_FLAGS |= REQ_ISROOT;
- m.REQ_GRANT = grant_id;
- m.REQ_DEV = dev;
- m.REQ_PATH_LEN = len;
+ m.m_vfs_fs_readsuper.flags = 0;
+ if(readonly) m.m_vfs_fs_readsuper.flags |= REQ_RDONLY;
+ if(isroot) m.m_vfs_fs_readsuper.flags |= REQ_ISROOT;
+ m.m_vfs_fs_readsuper.grant = grant_id;
+ m.m_vfs_fs_readsuper.device = dev;
+ m.m_vfs_fs_readsuper.path_len = len;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);
if(r == OK) {
/* Fill in response structure */
res->fs_e = m.m_source;
- res->inode_nr = (ino_t) m.RES_INODE_NR;
- res->fmode = (mode_t) m.RES_MODE;
- res->fsize = m.RES_FILE_SIZE;
- res->uid = (uid_t) m.RES_UID;
- res->gid = (gid_t) m.RES_GID;
- *fs_flags = m.RES_FLAGS;
+ res->inode_nr = m.m_fs_vfs_readsuper.inode;
+ res->fmode = m.m_fs_vfs_readsuper.mode;
+ res->fsize = m.m_fs_vfs_readsuper.file_size;
+ res->uid = m.m_fs_vfs_readsuper.uid;
+ res->gid = m.m_fs_vfs_readsuper.gid;
+ *fs_flags = m.m_fs_vfs_readsuper.flags;
}
return(r);