} mess_fs_vfs_getdents;
_ASSERT_MSG_SIZE(mess_fs_vfs_getdents);
+typedef struct {
+ ino_t inode;
+ ino_t dir_ino;
+
+ cp_grant_id_t grant;
+ size_t path_len;
+
+ uint8_t data[32];
+} mess_vfs_fs_link;
+_ASSERT_MSG_SIZE(mess_vfs_fs_link);
+
typedef struct {
ino_t dir_ino;
ino_t root_ino;
mess_vfs_fs_ftrunc m_vfs_fs_ftrunc;
mess_vfs_fs_getdents m_vfs_fs_getdents;
mess_fs_vfs_getdents m_fs_vfs_getdents;
+ mess_vfs_fs_link m_vfs_fs_link;
mess_vfs_fs_lookup m_vfs_fs_lookup;
mess_fs_vfs_lookup m_fs_vfs_lookup;
mess_vfs_fs_mountpoint m_vfs_fs_mountpoint;
return(OK);
/* Copy the link name's last component */
- len = fs_m_in.REQ_PATH_LEN;
+ len = fs_m_in.m_vfs_fs_link.path_len;
if (len > NAME_MAX + 1)
return(ENAMETOOLONG);
- r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT, 0,
+ r = sys_safecopyfrom(VFS_PROC_NR, fs_m_in.m_vfs_fs_link.grant, 0,
(vir_bytes) string, (size_t) len);
if (r != OK) return(r);
NUL(string, len, sizeof(string));
- if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL)
+ if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.m_vfs_fs_link.inode)) == NULL)
return(EINVAL);
/* Check to see if the file has maximum number of links already. */
if ((pn->pn_va.va_mode & I_TYPE) == I_DIRECTORY && caller_uid != SU_UID)
return(EPERM);
- if ((pn_dir = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_DIR_INO)) == NULL)
+ if ((pn_dir = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.m_vfs_fs_link.dir_ino)) == NULL)
return(EINVAL);
if (pn_dir->pn_va.va_nlink == NO_LINK) {
phys_bytes len;
/* Copy the link name's last component */
- len = fs_m_in.REQ_PATH_LEN; /* including trailing '\0' */
+ len = fs_m_in.m_vfs_fs_link.path_len; /* including trailing '\0' */
if (len > NAME_MAX + 1 || len > EXT2_NAME_MAX + 1)
return(ENAMETOOLONG);
- r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT, 0,
+ r = sys_safecopyfrom(VFS_PROC_NR, fs_m_in.m_vfs_fs_link.grant, 0,
(vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
/* Temporarily open the file. */
- if( (rip = get_inode(fs_dev, fs_m_in.REQ_INODE_NR)) == NULL)
+ if( (rip = get_inode(fs_dev, fs_m_in.m_vfs_fs_link.inode)) == NULL)
return(EINVAL);
/* Check to see if the file has maximum number of links already. */
}
/* Temporarily open the last dir */
- if( (ip = get_inode(fs_dev, fs_m_in.REQ_DIR_INO)) == NULL) {
+ if( (ip = get_inode(fs_dev, fs_m_in.m_vfs_fs_link.dir_ino)) == NULL) {
put_inode(rip);
return(EINVAL);
}
struct inode *new_ip;
phys_bytes len;
- len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
+ len = min(fs_m_in.m_vfs_fs_link.path_len, sizeof(string));
/* Copy the link name's last component */
- r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyfrom(VFS_PROC_NR, fs_m_in.m_vfs_fs_link.grant,
(vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
/* Temporarily open the file. */
- if( (rip = get_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL)
+ if( (rip = get_inode(fs_dev, fs_m_in.m_vfs_fs_link.inode)) == NULL)
return(EINVAL);
/* Check to see if the file has maximum number of links already. */
}
/* Temporarily open the last dir */
- if( (ip = get_inode(fs_dev, (pino_t) fs_m_in.REQ_DIR_INO)) == NULL) {
+ if( (ip = get_inode(fs_dev, fs_m_in.m_vfs_fs_link.dir_ino)) == NULL) {
put_inode(rip);
return(EINVAL);
}
/* Fill in request message */
m.m_type = REQ_LINK;
- m.REQ_INODE_NR = (pino_t) linked_file;
- m.REQ_DIR_INO = (pino_t) link_parent;
- m.REQ_GRANT = grant_id;
- m.REQ_PATH_LEN = len;
+ m.m_vfs_fs_link.inode = linked_file;
+ m.m_vfs_fs_link.dir_ino = link_parent;
+ m.m_vfs_fs_link.grant = grant_id;
+ m.m_vfs_fs_link.path_len = len;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);