} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ ino_t inode;
+
+ mode_t mode;
+
+ uint8_t data[44];
+} mess_vfs_fs_chmod;
+_ASSERT_MSG_SIZE(mess_vfs_fs_chmod);
+
+typedef struct {
+ mode_t mode;
+
+ uint8_t data[52];
+} mess_fs_vfs_chmod;
+_ASSERT_MSG_SIZE(mess_fs_vfs_chmod);
+
typedef struct {
ino_t inode;
mess_sigcalls m_sigcalls;
mess_vfs_fs_newnode m_vfs_fs_newnode;
mess_fs_vfs_newnode m_fs_vfs_newnode;
+ mess_vfs_fs_chmod m_vfs_fs_chmod;
+ mess_fs_vfs_chmod m_fs_vfs_chmod;
mess_vfs_fs_create m_vfs_fs_create;
mess_fs_vfs_create m_fs_vfs_create;
mess_vfs_fs_flush m_vfs_fs_flush;
if (global_pu->pu_ops.puffs_node_setattr == NULL)
return(EINVAL);
- mode = (mode_t) fs_m_in.REQ_MODE;
+ mode = fs_m_in.m_vfs_fs_chmod.mode;
- 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_chmod.inode)) == NULL)
return(EINVAL);
puffs_vattr_null(&va);
return(EINVAL);
/* Return full new mode to caller. */
- fs_m_out.RES_MODE = pn->pn_va.va_mode;
+ fs_m_out.m_fs_vfs_chmod.mode = pn->pn_va.va_mode;
return(OK);
}
if (state.s_read_only)
return EROFS;
- if ((ino = find_inode(m_in.REQ_INODE_NR)) == NULL)
+ if ((ino = find_inode(m_in.m_vfs_fs_chmod.inode)) == NULL)
return EINVAL;
if ((r = verify_inode(ino, path, NULL)) != OK)
/* Set the new file mode. */
attr.a_mask = SFFS_ATTR_MODE;
- attr.a_mode = m_in.REQ_MODE; /* no need to convert in this direction */
+ attr.a_mode = m_in.m_vfs_fs_chmod.mode; /* no need to convert in this direction */
if ((r = sffs_table->t_setattr(path, &attr)) != OK)
return r;
if ((r = verify_path(path, ino, &attr, NULL)) != OK)
return r;
- m_out.RES_MODE = get_mode(ino, attr.a_mode);
+ m_out.m_fs_vfs_chmod.mode = get_mode(ino, attr.a_mode);
return OK;
}
register struct inode *rip;
pmode_t mode;
- mode = (pmode_t) fs_m_in.REQ_MODE;
+ mode = fs_m_in.m_vfs_fs_chmod.mode;
/* 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_chmod.inode)) == NULL)
return(EINVAL);
/* Now make the change. Clear setgid bit if file is not in caller's grp */
rip->i_dirt = IN_DIRTY;
/* Return full new mode to caller. */
- fs_m_out.RES_MODE = rip->i_mode;
+ fs_m_out.m_fs_vfs_chmod.mode = rip->i_mode;
put_inode(rip);
return(OK);
register struct inode *rip;
pmode_t mode;
- mode = (pmode_t) fs_m_in.REQ_MODE;
+ mode = fs_m_in.m_vfs_fs_chmod.mode;
/* 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_chmod.inode)) == NULL)
return(EINVAL);
if(rip->i_sp->s_rd_only) {
IN_MARKDIRTY(rip);
/* Return full new mode to caller. */
- fs_m_out.RES_MODE = rip->i_mode;
+ fs_m_out.m_fs_vfs_chmod.mode = rip->i_mode;
put_inode(rip);
return(OK);
int fs_chmod(message *fs_m_in, message *fs_m_out)
{
struct inode *rip; /* target inode */
- mode_t mode = (mode_t) fs_m_in->REQ_MODE;
+ mode_t mode = fs_m_in->m_vfs_fs_chmod.mode;
- if( (rip = find_inode(fs_m_in->REQ_INODE_NR)) == NULL) return(EINVAL);
+ if( (rip = find_inode(fs_m_in->m_vfs_fs_chmod.inode)) == NULL) return(EINVAL);
get_inode(rip->i_dev, rip->i_num); /* mark inode in use */
rip->i_mode = (rip->i_mode & ~ALL_MODES) | (mode & ALL_MODES);
put_inode(rip); /* release the inode */
/* Fill in request message */
m.m_type = REQ_CHMOD;
- m.REQ_INODE_NR = (pino_t) inode_nr;
- m.REQ_MODE = (pmode_t) rmode;
+ m.m_vfs_fs_chmod.inode = inode_nr;
+ m.m_vfs_fs_chmod.mode = rmode;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);
/* Copy back actual mode. */
- *new_modep = (mode_t) m.RES_MODE;
+ *new_modep = m.m_fs_vfs_chmod.mode;
return(r);
}