} mess_vfs_fs_stat;
_ASSERT_MSG_SIZE(mess_vfs_fs_stat);
+typedef struct {
+ ino_t inode;
+
+ cp_grant_id_t grant;
+ size_t path_len;
+
+ uint8_t data[40];
+} mess_vfs_fs_unlink;
+_ASSERT_MSG_SIZE(mess_vfs_fs_unlink);
+
typedef struct {
ino_t inode;
time_t actime;
mess_vfs_fs_rename m_vfs_fs_rename;
mess_vfs_fs_slink m_vfs_fs_slink;
mess_vfs_fs_stat m_vfs_fs_stat;
+ mess_vfs_fs_unlink m_vfs_fs_unlink;
mess_vfs_fs_utime m_vfs_fs_utime;
mess_vfs_utimens m_vfs_utimens;
mess_vm_vfs_mmap m_vm_vfs_mmap;
int len;
/* Copy the last component */
- len = fs_m_in.REQ_PATH_LEN;
+ len = fs_m_in.m_vfs_fs_unlink.path_len;
pcn.pcn_namelen = len - 1;
if (pcn.pcn_namelen > NAME_MAX)
return(ENAMETOOLONG);
- 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_unlink.grant,
(vir_bytes) 0, (vir_bytes) pcn.pcn_name,
(size_t) len);
if (r != OK) return (r);
NUL(pcn.pcn_name, len, sizeof(pcn.pcn_name));
- if ((pn_dir = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL)
+ if ((pn_dir = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.m_vfs_fs_unlink.inode)) == NULL)
return(EINVAL);
/* The last directory exists. Does the file also exist? */
return EROFS;
/* Get the path string and possibly preexisting inode for the given path. */
- if ((r = get_name(m_in.REQ_GRANT, m_in.REQ_PATH_LEN, name)) != OK)
+ if ((r = get_name(m_in.m_vfs_fs_unlink.grant, m_in.m_vfs_fs_unlink.path_len, name)) != OK)
return r;
if (!strcmp(name, ".") || !strcmp(name, "..")) return EPERM;
- if ((parent = find_inode(m_in.REQ_INODE_NR)) == NULL)
+ if ((parent = find_inode(m_in.m_vfs_fs_unlink.inode)) == NULL)
return EINVAL;
if ((r = verify_dentry(parent, name, path, &ino)) != OK)
return EROFS;
/* Get the path string and possibly preexisting inode for the given path. */
- if ((r = get_name(m_in.REQ_GRANT, m_in.REQ_PATH_LEN, name)) != OK)
+ if ((r = get_name(m_in.m_vfs_fs_unlink.grant, m_in.m_vfs_fs_unlink.path_len, name)) != OK)
return r;
if (!strcmp(name, ".")) return EINVAL;
if (!strcmp(name, "..")) return ENOTEMPTY;
- if ((parent = find_inode(m_in.REQ_INODE_NR)) == NULL)
+ if ((parent = find_inode(m_in.m_vfs_fs_unlink.inode)) == NULL)
return EINVAL;
if ((r = verify_dentry(parent, name, path, &ino)) != OK)
phys_bytes len;
/* Copy the last component */
- len = fs_m_in.REQ_PATH_LEN; /* including trailing '\0' */
+ len = fs_m_in.m_vfs_fs_unlink.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,
+ r = sys_safecopyfrom(VFS_PROC_NR, fs_m_in.m_vfs_fs_unlink.grant,
(vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
/* Temporarily open the dir. */
- if( (rldirp = get_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL)
+ if((rldirp = get_inode(fs_dev, fs_m_in.m_vfs_fs_unlink.inode)) == NULL)
return(EINVAL);
/* The last directory exists. Does the file also exist? */
phys_bytes len;
/* Copy the last component */
- len = min( (unsigned) fs_m_in.REQ_PATH_LEN, sizeof(string));
- r = sys_safecopyfrom(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ len = min(fs_m_in.m_vfs_fs_unlink.path_len, sizeof(string));
+ r = sys_safecopyfrom(VFS_PROC_NR, fs_m_in.m_vfs_fs_unlink.grant,
(vir_bytes) 0, (vir_bytes) string, (size_t) len);
if (r != OK) return r;
NUL(string, len, sizeof(string));
/* Temporarily open the dir. */
- if( (rldirp = get_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL)
+ if((rldirp = get_inode(fs_dev, fs_m_in.m_vfs_fs_unlink.inode)) == NULL)
return(EINVAL);
/* The last directory exists. Does the file also exist? */
/* Fill in request message */
m.m_type = REQ_RMDIR;
- m.REQ_INODE_NR = (pino_t) inode_nr;
- m.REQ_GRANT = grant_id;
- m.REQ_PATH_LEN = len;
+ m.m_vfs_fs_unlink.inode = inode_nr;
+ m.m_vfs_fs_unlink.grant = grant_id;
+ m.m_vfs_fs_unlink.path_len = len;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);
/* Fill in request message */
m.m_type = REQ_UNLINK;
- m.REQ_INODE_NR = (pino_t) inode_nr;
- m.REQ_GRANT = grant_id;
- m.REQ_PATH_LEN = len;
+ m.m_vfs_fs_unlink.inode = inode_nr;
+ m.m_vfs_fs_unlink.grant = grant_id;
+ m.m_vfs_fs_unlink.path_len = len;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);