From: Ben Gras Date: Mon, 24 Feb 2014 15:54:37 +0000 (+0100) Subject: 64-bit RES_SEEK_POS X-Git-Tag: v3.3.0~427 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=fdd85c4d0832ff8b60bd7e71ac9554052c0aeb8f;p=minix.git 64-bit RES_SEEK_POS Change-Id: Id13f06417f2f600db167bec7b33bc825742cae79 --- diff --git a/include/minix/vfsif.h b/include/minix/vfsif.h index 71ae426c4..e2e4752cc 100644 --- a/include/minix/vfsif.h +++ b/include/minix/vfsif.h @@ -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 diff --git a/lib/libpuffs/read.c b/lib/libpuffs/read.c index 299517fb8..ded210067 100644 --- a/lib/libpuffs/read.c +++ b/lib/libpuffs/read.c @@ -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); } diff --git a/lib/libsffs/read.c b/lib/libsffs/read.c index ef9acc374..180aafe87 100644 --- a/lib/libsffs/read.c +++ b/lib/libsffs/read.c @@ -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; diff --git a/lib/libsffs/write.c b/lib/libsffs/write.c index ce6282a72..68fe2402c 100644 --- a/lib/libsffs/write.c +++ b/lib/libsffs/write.c @@ -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; diff --git a/lib/libvtreefs/read.c b/lib/libvtreefs/read.c index ca8a50cda..3de271d20 100644 --- a/lib/libvtreefs/read.c +++ b/lib/libvtreefs/read.c @@ -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; diff --git a/servers/ext2/read.c b/servers/ext2/read.c index c1cb257c5..be856b578 100644 --- a/servers/ext2/read.c +++ b/servers/ext2/read.c @@ -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; diff --git a/servers/iso9660fs/read.c b/servers/iso9660fs/read.c index 36b0dfea4..cec013a0a 100644 --- a/servers/iso9660fs/read.c +++ b/servers/iso9660fs/read.c @@ -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); diff --git a/servers/mfs/read.c b/servers/mfs/read.c index f38e157dc..b89afd452 100644 --- a/servers/mfs/read.c +++ b/servers/mfs/read.c @@ -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); diff --git a/servers/pfs/read.c b/servers/pfs/read.c index f5359a096..157ed67cb 100644 --- a/servers/pfs/read.c +++ b/servers/pfs/read.c @@ -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); diff --git a/servers/vfs/request.c b/servers/vfs/request.c index 106f2b267..81740c6f1 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -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; }