} mess_vfs_fs_slink;
_ASSERT_MSG_SIZE(mess_vfs_fs_slink);
+typedef struct {
+ ino_t inode;
+
+ cp_grant_id_t grant;
+
+ uint8_t data[44];
+} mess_vfs_fs_stat;
+_ASSERT_MSG_SIZE(mess_vfs_fs_stat);
+
typedef struct {
ino_t inode;
time_t actime;
mess_fs_vfs_readsuper m_fs_vfs_readsuper;
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_utime m_vfs_fs_utime;
mess_vfs_utimens m_vfs_utimens;
mess_vm_vfs_mmap m_vm_vfs_mmap;
register struct puffs_node *pn; /* target pnode */
struct vattr va;
struct stat statbuf;
- pmode_t mo;
+ mode_t mo;
int s;
PUFFS_MAKECRED(pcr, &global_kcred);
return(EINVAL);
}
- 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_stat.inode)) == NULL) {
lpuffs_debug("walk failed...\n");
return(EINVAL);
}
statbuf.st_gen = va.va_gen;
/* Copy the struct to user space. */
- r = sys_safecopyto(fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT,
+ r = sys_safecopyto(fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant,
(vir_bytes) 0, (vir_bytes) &statbuf,
(size_t) sizeof(statbuf));
pino_t ino_nr;
int r;
- ino_nr = m_in.REQ_INODE_NR;
+ ino_nr = m_in.m_vfs_fs_stat.inode;
/* Don't increase the inode refcount: it's already open anyway */
if ((ino = find_inode(ino_nr)) == NULL)
if (HAS_CHILDREN(ino)) stat.st_nlink++;
}
- return sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, 0,
+ return sys_safecopyto(m_in.m_source, m_in.m_vfs_fs_stat.grant, 0,
(vir_bytes) &stat, sizeof(stat));
}
struct inode *node;
int r;
- if ((node = find_inode(fs_m_in.REQ_INODE_NR)) == NULL)
+ if ((node = find_inode(fs_m_in.m_vfs_fs_stat.inode)) == NULL)
return EINVAL;
memset(&statbuf, 0, sizeof(struct stat));
statbuf.st_ctime = cur_time;
/* Copy the struct to user space. */
- return sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
+ return sys_safecopyto(fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant, 0,
(vir_bytes) &statbuf, (phys_bytes) sizeof(statbuf));
}
register int r; /* return value */
register struct inode *rip; /* target inode */
- 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_stat.inode)) == NULL)
return(EINVAL);
- r = stat_inode(rip, fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT);
+ r = stat_inode(rip, fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant);
put_inode(rip); /* release the inode */
return(r);
}
struct dir_record *dir;
r = EINVAL;
- if ((dir = get_dir_record(fs_m_in.REQ_INODE_NR)) != NULL) {
- r = stat_dir_record(dir, 0, fs_m_in.m_source, fs_m_in.REQ_GRANT);
+ if ((dir = get_dir_record(fs_m_in.m_vfs_fs_stat.inode)) != NULL) {
+ r = stat_dir_record(dir, 0, fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant);
release_dir_record(dir);
}
register int r; /* return value */
register struct inode *rip; /* target inode */
- 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_stat.inode)) == NULL)
return(EINVAL);
- r = stat_inode(rip, fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT);
+ r = stat_inode(rip, fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant);
put_inode(rip); /* release the inode */
return(r);
}
register int r; /* return value */
register struct inode *rip; /* target inode */
- if( (rip = find_inode(fs_m_in->REQ_INODE_NR)) == NULL) return(EINVAL);
+ if( (rip = find_inode(fs_m_in->m_vfs_fs_stat.inode)) == NULL) return(EINVAL);
get_inode(rip->i_dev, rip->i_num); /* mark inode in use */
- r = stat_inode(rip, fs_m_in->m_source, (cp_grant_id_t) fs_m_in->REQ_GRANT);
+ r = stat_inode(rip, fs_m_in->m_source, fs_m_in->m_vfs_fs_stat.grant);
put_inode(rip); /* release the inode */
return(r);
}
/* Fill in request message */
m.m_type = REQ_STAT;
- m.REQ_INODE_NR = (pino_t) inode_nr;
- m.REQ_GRANT = grant_id;
+ m.m_vfs_fs_stat.inode = inode_nr;
+ m.m_vfs_fs_stat.grant = grant_id;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);