_ASSERT_MSG_SIZE(mess_8);
typedef struct {
- uint64_t m9ull1;
+ uint64_t m9ull1, m9ull2;
long m9l1, m9l2, m9l3, m9l4, m9l5;
short m9s1, m9s2, m9s3, m9s4;
- uint8_t padding[20];
+ uint8_t padding[12];
} mess_9;
_ASSERT_MSG_SIZE(mess_9);
#define m9_s3 m_m9.m9s3
#define m9_s4 m_m9.m9s4
#define m9_ull1 m_m9.m9ull1
+#define m9_ull2 m_m9.m9ull2
#define m10_i1 m_m10.m10i1
#define m10_i2 m_m10.m10i2
#define REQ_REN_NEW_DIR m9_l4
#define REQ_REN_OLD_DIR m9_l3
#define REQ_ROOT_INO m9_l4
-#define REQ_SEEK_POS_HI m9_l3
-#define REQ_SEEK_POS_LO m9_l4
+#define REQ_SEEK_POS m9_ull2
#define REQ_TRC_END_HI m9_l4
#define REQ_TRC_END_LO m9_l5
#define REQ_TRC_START_HI m9_l2
{
block_t startblock, b, limitblock;
dev_t dev = m->REQ_DEV;
- off_t extra, pos = make64(m->REQ_SEEK_POS_LO, m->REQ_SEEK_POS_HI);
+ off_t extra, pos = m->REQ_SEEK_POS;
size_t len = m->REQ_NBYTES;
struct buf *bp;
/* Get the values from the request message */
rw_flag = (fs_m_in.m_type == REQ_READ ? READING : WRITING);
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
- pos = (off_t) fs_m_in.REQ_SEEK_POS_LO;
+ pos = (off_t) fs_m_in.REQ_SEEK_POS;
nrbytes = bytes_left = (size_t) fs_m_in.REQ_NBYTES;
if (nrbytes > RW_BUFSIZ)
ino = (pino_t) fs_m_in.REQ_INODE_NR;
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
size = buf_left = (size_t) fs_m_in.REQ_MEM_SIZE;
- pos = (off_t) fs_m_in.REQ_SEEK_POS_LO;
+ pos = (off_t) fs_m_in.REQ_SEEK_POS;
if ((pn = puffs_pn_nodewalk(global_pu, 0, &ino)) == NULL) {
lpuffs_debug("walk failed...\n");
if ((r = get_handle(ino)) != OK)
return r;
- pos = make64(m_in.REQ_SEEK_POS_LO, m_in.REQ_SEEK_POS_HI);
+ pos = m_in.REQ_SEEK_POS;
count = m_in.REQ_NBYTES;
assert(count > 0);
if ((ino = find_inode(m_in.REQ_INODE_NR)) == NULL)
return EINVAL;
- if (m_in.REQ_SEEK_POS_HI != 0) return EINVAL;
+ if(m_in.REQ_SEEK_POS >= ULONG_MAX) return EINVAL;
if (!IS_DIR(ino)) return ENOTDIR;
* the "." entry, the second position is for the ".." entry, and the next
* position numbers each represent a file in the directory.
*/
- for (pos = m_in.REQ_SEEK_POS_LO; ; pos++) {
+ for (pos = m_in.REQ_SEEK_POS; ; pos++) {
/* Determine which inode and name to use for this entry.
* We have no idea whether the host will give us "." and/or "..",
* so generate our own and skip those from the host.
if (IS_DIR(ino)) return EISDIR;
- pos = make64(m_in.REQ_SEEK_POS_LO, m_in.REQ_SEEK_POS_HI);
+ pos = m_in.REQ_SEEK_POS;
count = m_in.REQ_NBYTES;
grant = m_in.REQ_GRANT;
char *ptr;
int r;
- if (fs_m_in.REQ_SEEK_POS_HI != 0)
- return EIO;
-
/* Try to get inode by to its inode number. */
if ((node = find_inode(fs_m_in.REQ_INODE_NR)) == NULL)
return EINVAL;
/* Get the values from the request message. */
gid = fs_m_in.REQ_GRANT;
- pos = fs_m_in.REQ_SEEK_POS_LO;
+ pos = fs_m_in.REQ_SEEK_POS;
/* Call the read hook, if any. */
if (!is_inode_deleted(node) && vtreefs_hooks->read_hook != NULL) {
int r, skip, get_next, indexed;
static char buf[GETDENTS_BUFSIZ];
- if (fs_m_in.REQ_SEEK_POS_HI != 0)
+ if (fs_m_in.REQ_SEEK_POS >= ULONG_MAX)
return EIO;
if ((node = find_inode(fs_m_in.REQ_INODE_NR)) == NULL)
if (r != OK) return r;
}
- for (pos = fs_m_in.REQ_SEEK_POS_LO; ; pos++) {
+ for (pos = fs_m_in.REQ_SEEK_POS; ; pos++) {
/* Determine which inode and name to use for this entry. */
if (pos == 0) {
/* The "." entry. */
default: panic("odd request");
}
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
- position = (off_t) fs_m_in.REQ_SEEK_POS_LO;
+ position = (off_t) fs_m_in.REQ_SEEK_POS;
nrbytes = (size_t) fs_m_in.REQ_NBYTES;
rdwt_err = OK; /* set to EIO if disk error occurs */
/* 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 = make64((unsigned long) fs_m_in.REQ_SEEK_POS_LO,
- (unsigned long) fs_m_in.REQ_SEEK_POS_HI);
+ position = fs_m_in.REQ_SEEK_POS;
nrbytes = (size_t) fs_m_in.REQ_NBYTES;
block_size = get_block_size(fs_m_in.REQ_DEV);
ino = (pino_t) fs_m_in.REQ_INODE_NR;
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
size = (size_t) fs_m_in.REQ_MEM_SIZE;
- pos = (off_t) fs_m_in.REQ_SEEK_POS_LO;
+ pos = (off_t) fs_m_in.REQ_SEEK_POS;
/* Check whether the position is properly aligned */
if ((unsigned int) pos % DIR_ENTRY_ALIGN)
dir = get_dir_record(fs_m_in.REQ_INODE_NR);
if (dir == NULL) return(EINVAL); /* no inode found */
- position = fs_m_in.REQ_SEEK_POS_LO;
+ position = fs_m_in.REQ_SEEK_POS;
nrbytes = (unsigned) fs_m_in.REQ_NBYTES; /* number of bytes to read */
block_size = v_pri.logical_block_size_l;
gid = fs_m_in.REQ_GRANT;
rw_flag = (fs_m_in.m_type == REQ_BREAD ? READING : WRITING);
gid = fs_m_in.REQ_GRANT;
- position = make64(fs_m_in.REQ_SEEK_POS_LO, fs_m_in.REQ_SEEK_POS_HI);
+ position = fs_m_in.REQ_SEEK_POS;
nrbytes = (unsigned) fs_m_in.REQ_NBYTES;
block_size = v_pri.logical_block_size_l;
dir = v_pri.dir_rec_root;
/* Get input parameters */
ino = fs_m_in.REQ_INODE_NR;
gid = fs_m_in.REQ_GRANT;
- pos = fs_m_in.REQ_SEEK_POS_LO;
+ pos = fs_m_in.REQ_SEEK_POS;
block_size = v_pri.logical_block_size_l;
cur_pos = pos; /* The current position */
default: panic("odd request");
}
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
- position = (off_t) fs_m_in.REQ_SEEK_POS_LO;
+ position = (off_t) fs_m_in.REQ_SEEK_POS;
nrbytes = (size_t) fs_m_in.REQ_NBYTES;
lmfs_reset_rdwt_err();
/* 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 = make64((unsigned long) fs_m_in.REQ_SEEK_POS_LO,
- (unsigned long) fs_m_in.REQ_SEEK_POS_HI);
+ position = fs_m_in.REQ_SEEK_POS;
nrbytes = (size_t) fs_m_in.REQ_NBYTES;
block_size = get_block_size(target_dev);
ino = (pino_t) fs_m_in.REQ_INODE_NR;
gid = (cp_grant_id_t) fs_m_in.REQ_GRANT;
size = (size_t) fs_m_in.REQ_MEM_SIZE;
- pos = (off_t) fs_m_in.REQ_SEEK_POS_LO;
+ pos = (off_t) fs_m_in.REQ_SEEK_POS;
/* Check whether the position is properly aligned */
if( (unsigned int) pos % DIR_ENTRY_SIZE)
m.m_type = rw_flag == READING ? REQ_BREAD : REQ_BWRITE;
m.REQ_DEV = dev;
m.REQ_GRANT = grant_id;
- m.REQ_SEEK_POS_LO = ex64lo(pos);
- m.REQ_SEEK_POS_HI = ex64hi(pos);
+ m.REQ_SEEK_POS = pos;
m.REQ_NBYTES = num_of_bytes;
/* Send/rec request */
/* Fill in request message */
m.m_type = REQ_BPEEK;
m.REQ_DEV = dev;
- m.REQ_SEEK_POS_LO = ex64lo(pos);
- m.REQ_SEEK_POS_HI = ex64hi(pos);
+ m.REQ_SEEK_POS = pos;
m.REQ_NBYTES = num_of_bytes;
/* Send/rec request */
m.REQ_INODE_NR = (pino_t) inode_nr;
m.REQ_GRANT = grant_id;
m.REQ_MEM_SIZE = size;
- m.REQ_SEEK_POS_LO = ex64lo(pos);
- if (vmp->m_fs_flags & RES_64BIT) {
- m.REQ_SEEK_POS_HI = ex64hi(pos);
- } else if (pos > INT_MAX) {
+ m.REQ_SEEK_POS = pos;
+ if (!(vmp->m_fs_flags & RES_64BIT) && (pos > INT_MAX)) {
/* FS does not support 64-bit off_t and 32 bits is not enough */
return EINVAL;
- } else {
- m.REQ_SEEK_POS_HI = 0;
}
r = fs_sendrec(fs_e, &m);
m.m_type = rw_flag == READING ? REQ_READ : REQ_WRITE;
m.REQ_INODE_NR = (pino_t) inode_nr;
m.REQ_GRANT = grant_id;
- m.REQ_SEEK_POS_LO = ex64lo(pos);
- if (vmp->m_fs_flags & RES_64BIT) {
- m.REQ_SEEK_POS_HI = ex64hi(pos);
- } else if (pos > INT_MAX) {
+ m.REQ_SEEK_POS = pos;
+ if ((!(vmp->m_fs_flags & RES_64BIT)) && (pos > INT_MAX)) {
return EINVAL;
- } else {
- m.REQ_SEEK_POS_HI = 0;
}
m.REQ_NBYTES = num_of_bytes;
m.m_type = REQ_PEEK;
m.REQ_INODE_NR = inode_nr;
m.REQ_GRANT = -1;
- m.REQ_SEEK_POS_LO = ex64lo(pos);
- m.REQ_SEEK_POS_HI = 0; /* Not used for now, so clear it. */
+ m.REQ_SEEK_POS = pos;
m.REQ_NBYTES = bytes;
/* Send/rec request */