} mess_fs_vfs_newnode;
_ASSERT_MSG_SIZE(mess_fs_vfs_newnode);
+typedef struct {
+ ino_t inode;
+
+ cp_grant_id_t grant;
+ size_t mem_size;
+
+ uint8_t data[40];
+} mess_vfs_fs_rdlink;
+_ASSERT_MSG_SIZE(mess_vfs_fs_rdlink);
+
+typedef struct {
+ size_t nbytes;
+
+ uint8_t data[52];
+} mess_fs_vfs_rdlink;
+_ASSERT_MSG_SIZE(mess_fs_vfs_rdlink);
+
typedef struct {
dev_t device;
mess_fs_vfs_lookup m_fs_vfs_lookup;
mess_vfs_fs_mountpoint m_vfs_fs_mountpoint;
mess_vfs_fs_new_driver m_vfs_fs_new_driver;
+ mess_vfs_fs_rdlink m_vfs_fs_rdlink;
+ mess_fs_vfs_rdlink m_fs_vfs_rdlink;
mess_vfs_fs_readsuper m_vfs_fs_readsuper;
mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_vfs_fs_rename m_vfs_fs_rename;
char path[PATH_MAX];
PUFFS_MAKECRED(pcr, &global_kcred);
- copylen = (size_t) fs_m_in.REQ_MEM_SIZE < UMAX_FILE_POS ?
- (size_t) fs_m_in.REQ_MEM_SIZE : UMAX_FILE_POS;
+ copylen = fs_m_in.m_vfs_fs_rdlink.mem_size < UMAX_FILE_POS ?
+ fs_m_in.m_vfs_fs_rdlink.mem_size : UMAX_FILE_POS;
assert(copylen <= PATH_MAX);
- 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_rdlink.inode)) == NULL)
return(EINVAL);
if (!S_ISLNK(pn->pn_va.va_mode))
return(r);
}
- r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyto(VFS_PROC_NR, fs_m_in.m_vfs_fs_rdlink.grant,
(vir_bytes) 0, (vir_bytes) path, (size_t) copylen);
if (r == OK)
- fs_m_out.RES_NBYTES = copylen;
+ fs_m_out.m_fs_vfs_rdlink.nbytes = copylen;
return(r);
}
size_t len;
int r;
- if ((node = find_inode(fs_m_in.REQ_INODE_NR)) == NULL)
+ if ((node = find_inode(fs_m_in.m_vfs_fs_rdlink.inode)) == NULL)
return EINVAL;
/* Call the rdlink hook. */
len = strlen(path);
assert(len > 0 && len < sizeof(path));
- if (len > fs_m_in.REQ_MEM_SIZE)
- len = fs_m_in.REQ_MEM_SIZE;
+ if (len > fs_m_in.m_vfs_fs_rdlink.mem_size)
+ len = fs_m_in.m_vfs_fs_rdlink.mem_size;
/* Copy out the result. */
- r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
+ r = sys_safecopyto(fs_m_in.m_source, fs_m_in.m_vfs_fs_rdlink.grant, 0,
(vir_bytes) path, len);
if (r != OK) return r;
- fs_m_out.RES_NBYTES = len;
+ fs_m_out.m_fs_vfs_rdlink.nbytes = len;
return OK;
}
register int r; /* return value */
size_t copylen;
- copylen = min( (size_t) fs_m_in.REQ_MEM_SIZE, UMAX_FILE_POS);
+ copylen = min(fs_m_in.m_vfs_fs_rdlink.mem_size, UMAX_FILE_POS);
/* 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_rdlink.inode)) == NULL)
return(EINVAL);
if (rip->i_size >= MAX_FAST_SYMLINK_LENGTH) {
/* We can safely cast to unsigned, because copylen is guaranteed to be
below max file size */
copylen = min( copylen, (unsigned) rip->i_size);
- r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyto(VFS_PROC_NR, fs_m_in.m_vfs_fs_rdlink.grant,
(vir_bytes) 0, (vir_bytes) link_text,
(size_t) copylen);
put_block(bp, DIRECTORY_BLOCK);
if (r == OK)
- fs_m_out.RES_NBYTES = copylen;
+ fs_m_out.m_fs_vfs_rdlink.nbytes = copylen;
}
put_inode(rip);
register int r; /* return value */
size_t copylen;
- copylen = min( (size_t) fs_m_in.REQ_MEM_SIZE, UMAX_FILE_POS);
+ copylen = min(fs_m_in.m_vfs_fs_rdlink.mem_size, UMAX_FILE_POS);
/* 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_rdlink.inode)) == NULL)
return(EINVAL);
if(!S_ISLNK(rip->i_mode))
/* We can safely cast to unsigned, because copylen is guaranteed to be
below max file size */
copylen = min( copylen, (unsigned) rip->i_size);
- r = sys_safecopyto(VFS_PROC_NR, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyto(VFS_PROC_NR, fs_m_in.m_vfs_fs_rdlink.grant,
(vir_bytes) 0, (vir_bytes) b_data(bp),
(size_t) copylen);
put_block(bp, DIRECTORY_BLOCK);
if (r == OK)
- fs_m_out.RES_NBYTES = copylen;
+ fs_m_out.m_fs_vfs_rdlink.nbytes = copylen;
}
put_inode(rip);
/* Fill in request message */
m.m_type = REQ_RDLINK;
- m.REQ_INODE_NR = (pino_t) inode_nr;
- m.REQ_GRANT = grant_id;
- m.REQ_MEM_SIZE = len;
+ m.m_vfs_fs_rdlink.inode = inode_nr;
+ m.m_vfs_fs_rdlink.grant = grant_id;
+ m.m_vfs_fs_rdlink.mem_size = len;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);
cpf_revoke(grant_id);
- if (r == OK) r = m.RES_NBYTES;
+ if (r == OK) r = m.m_fs_vfs_rdlink.nbytes;
return(r);
}