From: Ben Gras Date: Mon, 24 Feb 2014 16:28:29 +0000 (+0100) Subject: 64-bit REQ_TRC_START, REQ_TRC_END X-Git-Tag: v3.3.0~422 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc.html?a=commitdiff_plain;h=3f3e78ef590c69a720e82e50177a9525873fd6a5;p=minix.git 64-bit REQ_TRC_START, REQ_TRC_END Change-Id: I567804209695b5ec0d83a453d93e36cbf8900f1a --- diff --git a/include/minix/vfsif.h b/include/minix/vfsif.h index 2044b55ff..9ced295a2 100644 --- a/include/minix/vfsif.h +++ b/include/minix/vfsif.h @@ -31,10 +31,8 @@ #define REQ_REN_OLD_DIR m9_l3 #define REQ_ROOT_INO 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 -#define REQ_TRC_START_LO m9_l3 +#define REQ_TRC_START m9_ull1 +#define REQ_TRC_END m9_ull2 #define REQ_UCRED_SIZE m9_s4 #define REQ_UID m9_s4 diff --git a/lib/libpuffs/link.c b/lib/libpuffs/link.c index 931f78c26..f934d0777 100644 --- a/lib/libpuffs/link.c +++ b/lib/libpuffs/link.c @@ -22,8 +22,8 @@ int fs_ftrunc(void) if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL) return(EINVAL); - start = fs_m_in.REQ_TRC_START_LO; - end = fs_m_in.REQ_TRC_END_LO; + start = fs_m_in.REQ_TRC_START; + end = fs_m_in.REQ_TRC_END; if (end == 0) { struct vattr va; diff --git a/lib/libsffs/write.c b/lib/libsffs/write.c index 68fe2402c..4d852ea99 100644 --- a/lib/libsffs/write.c +++ b/lib/libsffs/write.c @@ -131,8 +131,8 @@ int do_ftrunc(void) if (IS_DIR(ino)) return EISDIR; - start = make64(m_in.REQ_TRC_START_LO, m_in.REQ_TRC_START_HI); - end = make64(m_in.REQ_TRC_END_LO, m_in.REQ_TRC_END_HI); + start = m_in.REQ_TRC_START; + end = m_in.REQ_TRC_END; if (end == 0) { /* Truncate or expand the file. */ diff --git a/servers/ext2/link.c b/servers/ext2/link.c index 514714132..d4144acab 100644 --- a/servers/ext2/link.c +++ b/servers/ext2/link.c @@ -523,8 +523,8 @@ int fs_ftrunc(void) if( (rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL) return(EINVAL); - start = fs_m_in.REQ_TRC_START_LO; - end = fs_m_in.REQ_TRC_END_LO; + start = fs_m_in.REQ_TRC_START; + end = fs_m_in.REQ_TRC_END; if (end == 0) r = truncate_inode(rip, start); diff --git a/servers/mfs/link.c b/servers/mfs/link.c index a0bb32a1c..d6d482ca2 100644 --- a/servers/mfs/link.c +++ b/servers/mfs/link.c @@ -498,8 +498,8 @@ int fs_ftrunc(void) if(rip->i_sp->s_rd_only) { r = EROFS; } else { - start = fs_m_in.REQ_TRC_START_LO; - end = fs_m_in.REQ_TRC_END_LO; + start = fs_m_in.REQ_TRC_START; + end = fs_m_in.REQ_TRC_END; if (end == 0) r = truncate_inode(rip, start); diff --git a/servers/pfs/link.c b/servers/pfs/link.c index fe3938221..3648c4e04 100644 --- a/servers/pfs/link.c +++ b/servers/pfs/link.c @@ -16,7 +16,7 @@ int fs_ftrunc(message *fs_m_in, message *fs_m_out) if( (rip = find_inode(inumb)) == NULL) return(EINVAL); - start = fs_m_in->REQ_TRC_START_LO; + start = fs_m_in->REQ_TRC_START; return truncate_inode(rip, start); } diff --git a/servers/vfs/request.c b/servers/vfs/request.c index 58a64061d..09389dc1a 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -252,25 +252,13 @@ int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end) /* Fill in request message */ m.m_type = REQ_FTRUNC; m.REQ_INODE_NR = (pino_t) inode_nr; + m.REQ_TRC_START = start; + m.REQ_TRC_END = end; - m.REQ_TRC_START_LO = ex64lo(start); - if (vmp->m_fs_flags & RES_64BIT) { - m.REQ_TRC_START_HI = ex64hi(start); - } else if (start > INT_MAX) { + if (!(vmp->m_fs_flags & RES_64BIT) && + ((start > INT_MAX) || (end > INT_MAX))) { /* FS does not support 64-bit off_t and 32 bits is not enough */ return EINVAL; - } else { - m.REQ_TRC_START_HI = 0; - } - - m.REQ_TRC_END_LO = ex64lo(end); - if (vmp->m_fs_flags & RES_64BIT) { - m.REQ_TRC_END_HI = ex64hi(end); - } else if (end > INT_MAX) { - /* FS does not support 64-bit off_t and 32 bits is not enough */ - return EINVAL; - } else { - m.REQ_TRC_END_HI = 0; } /* Send/rec request */