} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ dev_t device;
+ off_t seek_pos;
+
+ cp_grant_id_t grant;
+ size_t nbytes;
+
+ uint8_t data[32];
+} mess_vfs_fs_breadwrite;
+_ASSERT_MSG_SIZE(mess_vfs_fs_breadwrite);
+
+typedef struct {
+ off_t seek_pos;
+
+ size_t nbytes;
+
+ uint8_t data[44];
+} mess_fs_vfs_breadwrite;
+_ASSERT_MSG_SIZE(mess_fs_vfs_breadwrite);
+
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_breadwrite m_vfs_fs_breadwrite;
+ mess_fs_vfs_breadwrite m_fs_vfs_breadwrite;
mess_vfs_fs_chmod m_vfs_fs_chmod;
mess_fs_vfs_chmod m_fs_vfs_chmod;
mess_vfs_fs_chown m_vfs_fs_chown;
int lmfs_do_bpeek(message *m)
{
block_t startblock, b, limitblock;
- dev_t dev = m->REQ_DEV;
- off_t extra, pos = m->REQ_SEEK_POS;
- size_t len = m->REQ_NBYTES;
+ dev_t dev = m->m_vfs_fs_breadwrite.device;
+ off_t extra, pos = m->m_vfs_fs_breadwrite.seek_pos;
+ size_t len = m->m_vfs_fs_breadwrite.nbytes;
struct buf *bp;
assert(m->m_type == REQ_BPEEK);
/* Get the values from the request message */
rw_flag = (fs_m_in.m_type == REQ_BREAD ? READING : WRITING);
- gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
- position = fs_m_in.REQ_SEEK_POS;
- nrbytes = (size_t) fs_m_in.REQ_NBYTES;
+ gid = fs_m_in.m_vfs_fs_breadwrite.grant;
+ position = fs_m_in.m_vfs_fs_breadwrite.seek_pos;
+ nrbytes = fs_m_in.m_vfs_fs_breadwrite.nbytes;
- block_size = get_block_size(fs_m_in.REQ_DEV);
+ block_size = get_block_size(fs_m_in.m_vfs_fs_breadwrite.device);
- rip.i_block[0] = (block_t) fs_m_in.REQ_DEV;
+ rip.i_block[0] = (block_t) fs_m_in.m_vfs_fs_breadwrite.device;
rip.i_mode = I_BLOCK_SPECIAL;
rip.i_size = 0;
position += chunk; /* position within the file */
}
- fs_m_out.RES_SEEK_POS = position;
+ fs_m_out.m_fs_vfs_breadwrite.seek_pos = position;
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
if (rdwt_err == END_OF_FILE) r = OK;
- fs_m_out.RES_NBYTES = cum_io;
+ fs_m_out.m_fs_vfs_breadwrite.nbytes = cum_io;
return(r);
}
r = OK;
rw_flag = (fs_m_in.m_type == REQ_BREAD ? READING : WRITING);
- gid = fs_m_in.REQ_GRANT;
- position = fs_m_in.REQ_SEEK_POS;
- nrbytes = (unsigned) fs_m_in.REQ_NBYTES;
+ gid = fs_m_in.m_vfs_fs_breadwrite.grant;
+ position = fs_m_in.m_vfs_fs_breadwrite.seek_pos;
+ nrbytes = fs_m_in.m_vfs_fs_breadwrite.nbytes;
block_size = v_pri.logical_block_size_l;
dir = v_pri.dir_rec_root;
position += chunk; /* position within the file */
}
- fs_m_out.RES_SEEK_POS = position;
+ fs_m_out.m_fs_vfs_breadwrite.seek_pos = position;
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
if (rdwt_err == END_OF_FILE) r = OK;
- fs_m_out.RES_NBYTES = cum_io;
+ fs_m_out.m_fs_vfs_breadwrite.nbytes = cum_io;
return(r);
}
r = OK;
- target_dev = fs_m_in.REQ_DEV;
+ target_dev = fs_m_in.m_vfs_fs_breadwrite.device;
/* Get the values from the request message */
rw_flag = (fs_m_in.m_type == REQ_BREAD ? READING : WRITING);
- gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
- position = fs_m_in.REQ_SEEK_POS;
- nrbytes = (size_t) fs_m_in.REQ_NBYTES;
+ gid = fs_m_in.m_vfs_fs_breadwrite.grant;
+ position = fs_m_in.m_vfs_fs_breadwrite.seek_pos;
+ nrbytes = fs_m_in.m_vfs_fs_breadwrite.nbytes;
block_size = get_block_size(target_dev);
position += chunk; /* position within the file */
}
- fs_m_out.RES_SEEK_POS = position;
+ fs_m_out.m_fs_vfs_breadwrite.seek_pos = position;
if (lmfs_rdwt_err() != OK) r = lmfs_rdwt_err(); /* check for disk error */
if (lmfs_rdwt_err() == END_OF_FILE) r = OK;
- fs_m_out.RES_NBYTES = cum_io;
+ fs_m_out.m_fs_vfs_breadwrite.nbytes = cum_io;
return(r);
}
/* Fill in request message */
m.m_type = rw_flag == READING ? REQ_BREAD : REQ_BWRITE;
- m.REQ_DEV = dev;
- m.REQ_GRANT = grant_id;
- m.REQ_SEEK_POS = pos;
- m.REQ_NBYTES = num_of_bytes;
+ m.m_vfs_fs_breadwrite.device = dev;
+ m.m_vfs_fs_breadwrite.grant = grant_id;
+ m.m_vfs_fs_breadwrite.seek_pos = pos;
+ m.m_vfs_fs_breadwrite.nbytes = num_of_bytes;
/* Send/rec request */
r = fs_sendrec(fs_e, &m);
if (r != OK) return(r);
/* Fill in response structure */
- *new_pos = m.RES_SEEK_POS;
- *cum_iop = m.RES_NBYTES;
+ *new_pos = m.m_fs_vfs_breadwrite.seek_pos;
+ *cum_iop = m.m_fs_vfs_breadwrite.nbytes;
return(OK);
}
/* Fill in request message */
m.m_type = REQ_BPEEK;
- m.REQ_DEV = dev;
- m.REQ_SEEK_POS = pos;
- m.REQ_NBYTES = num_of_bytes;
+ m.m_vfs_fs_breadwrite.device = dev;
+ m.m_vfs_fs_breadwrite.seek_pos = pos;
+ m.m_vfs_fs_breadwrite.nbytes = num_of_bytes;
/* Send/rec request */
return fs_sendrec(fs_e, &m);