64-bit RES_SEEK_POS

Change-Id: Id13f06417f2f600db167bec7b33bc825742cae79
This commit is contained in:
Ben Gras 2014-02-24 16:54:37 +01:00 committed by Lionel Sambuc
parent 978082bb0d
commit fdd85c4d08
10 changed files with 21 additions and 38 deletions

View file

@ -47,8 +47,7 @@
#define RES_MODE m9_s2
#define RES_NBYTES m9_l5
#define RES_OFFSET m9_s2
#define RES_SEEK_POS_HI m9_l3
#define RES_SEEK_POS_LO m9_l4
#define RES_SEEK_POS m9_ull2
#define RES_SYMLOOP m9_s3
#define RES_UID m9_s4
#define RES_FLAGS m9_s3

View file

@ -98,7 +98,7 @@ int fs_readwrite(void)
if (r != OK) return(EINVAL);
fs_m_out.RES_SEEK_POS_LO = pos + bytes_done;
fs_m_out.RES_SEEK_POS = pos + bytes_done;
fs_m_out.RES_NBYTES = bytes_done;
return(r);
@ -172,7 +172,7 @@ int fs_getdents(void)
update_timens(pn, ATIME, NULL);
fs_m_out.RES_NBYTES = written;
fs_m_out.RES_SEEK_POS_LO = pos;
fs_m_out.RES_SEEK_POS = pos;
return(OK);
}

View file

@ -67,8 +67,7 @@ int do_read(void)
if (r < 0)
return r;
m_out.RES_SEEK_POS_HI = ex64hi(pos);
m_out.RES_SEEK_POS_LO = ex64lo(pos);
m_out.RES_SEEK_POS = pos;
m_out.RES_NBYTES = off;
return OK;
@ -229,8 +228,7 @@ int do_getdents(void)
user_off += off;
}
m_out.RES_SEEK_POS_HI = 0;
m_out.RES_SEEK_POS_LO = pos;
m_out.RES_SEEK_POS = pos;
m_out.RES_NBYTES = user_off;
return OK;

View file

@ -103,8 +103,7 @@ int do_write(void)
if ((r = write_file(ino, &pos, &count, &grant)) != OK)
return r;
m_out.RES_SEEK_POS_HI = ex64hi(pos);
m_out.RES_SEEK_POS_LO = ex64lo(pos);
m_out.RES_SEEK_POS = pos;
m_out.RES_NBYTES = count;
return OK;

View file

@ -57,8 +57,7 @@ int fs_read(void)
}
if (r == OK) {
fs_m_out.RES_SEEK_POS_HI = 0;
fs_m_out.RES_SEEK_POS_LO = pos + len;
fs_m_out.RES_SEEK_POS = pos + len;
fs_m_out.RES_NBYTES = len;
}
@ -207,8 +206,7 @@ int fs_getdents(void)
user_off += off;
}
fs_m_out.RES_SEEK_POS_HI = 0;
fs_m_out.RES_SEEK_POS_LO = pos;
fs_m_out.RES_SEEK_POS = pos;
fs_m_out.RES_NBYTES = user_off;
return OK;

View file

@ -106,7 +106,7 @@ int fs_readwrite(void)
position += (off_t) chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = position; /* It might change later and the VFS
fs_m_out.RES_SEEK_POS = position; /* It might change later and the VFS
has to know this value */
/* On write, update file size and access time. */
@ -190,8 +190,7 @@ int fs_breadwrite(void)
position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = ex64lo(position);
fs_m_out.RES_SEEK_POS_HI = ex64hi(position);
fs_m_out.RES_SEEK_POS = position;
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
if (rdwt_err == END_OF_FILE) r = OK;
@ -761,7 +760,7 @@ int fs_getdents(void)
r = EINVAL; /* The user's buffer is too small */
else {
fs_m_out.RES_NBYTES = userbuf_off;
fs_m_out.RES_SEEK_POS_LO = new_pos;
fs_m_out.RES_SEEK_POS = new_pos;
rip->i_update |= ATIME;
rip->i_dirt = IN_DIRTY;
r = OK;

View file

@ -67,7 +67,7 @@ int fs_read(void) {
position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = position;
fs_m_out.RES_SEEK_POS = position;
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
if (rdwt_err == END_OF_FILE) r = OK;
@ -125,8 +125,7 @@ int fs_bread(void)
position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = ex64lo(position);
fs_m_out.RES_SEEK_POS_HI = ex64hi(position);
fs_m_out.RES_SEEK_POS = position;
if (rdwt_err != OK) r = rdwt_err; /* check for disk error */
if (rdwt_err == END_OF_FILE) r = OK;
@ -279,7 +278,7 @@ int fs_getdents(void)
}
fs_m_out.RES_NBYTES = userbuf_off;
fs_m_out.RES_SEEK_POS_LO = cur_pos;
fs_m_out.RES_SEEK_POS = cur_pos;
release_dir_record(dir); /* release the inode */
return(OK);

View file

@ -113,7 +113,7 @@ int fs_readwrite(void)
position += (off_t) chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = position; /* It might change later and the VFS
fs_m_out.RES_SEEK_POS = position; /* It might change later and the VFS
has to know this value */
/* On write, update file size and access time. */
@ -199,8 +199,7 @@ int fs_breadwrite(void)
position += chunk; /* position within the file */
}
fs_m_out.RES_SEEK_POS_LO = ex64lo(position);
fs_m_out.RES_SEEK_POS_HI = ex64hi(position);
fs_m_out.RES_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;
@ -731,7 +730,7 @@ int fs_getdents(void)
r = EINVAL; /* The user's buffer is too small */
else {
fs_m_out.RES_NBYTES = userbuf_off;
fs_m_out.RES_SEEK_POS_LO = new_pos;
fs_m_out.RES_SEEK_POS = new_pos;
if(!rip->i_sp->s_rd_only) {
rip->i_update |= ATIME;
IN_MARKDIRTY(rip);

View file

@ -87,7 +87,7 @@ int fs_readwrite(message *fs_m_in, message *fs_m_out)
if (rw_flag == READING) rip->i_update |= ATIME;
if (rw_flag == WRITING) rip->i_update |= CTIME | MTIME;
fs_m_out->RES_NBYTES = (size_t) cum_io;
fs_m_out->RES_SEEK_POS_LO = rip->i_size;
fs_m_out->RES_SEEK_POS = rip->i_size;
put_inode(rip);
put_block(rip->i_dev, rip->i_num);

View file

@ -61,7 +61,7 @@ int req_breadwrite(
if (r != OK) return(r);
/* Fill in response structure */
*new_pos = make64(m.RES_SEEK_POS_LO, m.RES_SEEK_POS_HI);
*new_pos = m.RES_SEEK_POS;
*cum_iop = m.RES_NBYTES;
return(OK);
@ -328,11 +328,7 @@ int req_getdents(
cpf_revoke(grant_id);
if (r == OK) {
if (vmp->m_fs_flags & RES_64BIT) {
*new_pos = make64(m.RES_SEEK_POS_LO, m.RES_SEEK_POS_HI);
} else {
*new_pos = m.RES_SEEK_POS_LO;
}
*new_pos = m.RES_SEEK_POS;
r = m.RES_NBYTES;
}
@ -831,11 +827,7 @@ unsigned int *cum_iop)
if (r == OK) {
/* Fill in response structure */
if (vmp->m_fs_flags & RES_64BIT) {
*new_posp = make64(m.RES_SEEK_POS_LO, m.RES_SEEK_POS_HI);
} else {
*new_posp = m.RES_SEEK_POS_LO;
}
*new_posp = m.RES_SEEK_POS;
*cum_iop = m.RES_NBYTES;
}