64-bit REQ_TRC_START, REQ_TRC_END
Change-Id: I567804209695b5ec0d83a453d93e36cbf8900f1a
This commit is contained in:
parent
e6daf20a69
commit
3f3e78ef59
7 changed files with 15 additions and 29 deletions
|
@ -31,10 +31,8 @@
|
||||||
#define REQ_REN_OLD_DIR m9_l3
|
#define REQ_REN_OLD_DIR m9_l3
|
||||||
#define REQ_ROOT_INO m9_l4
|
#define REQ_ROOT_INO m9_l4
|
||||||
#define REQ_SEEK_POS m9_ull2
|
#define REQ_SEEK_POS m9_ull2
|
||||||
#define REQ_TRC_END_HI m9_l4
|
#define REQ_TRC_START m9_ull1
|
||||||
#define REQ_TRC_END_LO m9_l5
|
#define REQ_TRC_END m9_ull2
|
||||||
#define REQ_TRC_START_HI m9_l2
|
|
||||||
#define REQ_TRC_START_LO m9_l3
|
|
||||||
#define REQ_UCRED_SIZE m9_s4
|
#define REQ_UCRED_SIZE m9_s4
|
||||||
#define REQ_UID m9_s4
|
#define REQ_UID m9_s4
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ int fs_ftrunc(void)
|
||||||
if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL)
|
if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL)
|
||||||
return(EINVAL);
|
return(EINVAL);
|
||||||
|
|
||||||
start = fs_m_in.REQ_TRC_START_LO;
|
start = fs_m_in.REQ_TRC_START;
|
||||||
end = fs_m_in.REQ_TRC_END_LO;
|
end = fs_m_in.REQ_TRC_END;
|
||||||
|
|
||||||
if (end == 0) {
|
if (end == 0) {
|
||||||
struct vattr va;
|
struct vattr va;
|
||||||
|
|
|
@ -131,8 +131,8 @@ int do_ftrunc(void)
|
||||||
|
|
||||||
if (IS_DIR(ino)) return EISDIR;
|
if (IS_DIR(ino)) return EISDIR;
|
||||||
|
|
||||||
start = make64(m_in.REQ_TRC_START_LO, m_in.REQ_TRC_START_HI);
|
start = m_in.REQ_TRC_START;
|
||||||
end = make64(m_in.REQ_TRC_END_LO, m_in.REQ_TRC_END_HI);
|
end = m_in.REQ_TRC_END;
|
||||||
|
|
||||||
if (end == 0) {
|
if (end == 0) {
|
||||||
/* Truncate or expand the file. */
|
/* Truncate or expand the file. */
|
||||||
|
|
|
@ -523,8 +523,8 @@ int fs_ftrunc(void)
|
||||||
if( (rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL)
|
if( (rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL)
|
||||||
return(EINVAL);
|
return(EINVAL);
|
||||||
|
|
||||||
start = fs_m_in.REQ_TRC_START_LO;
|
start = fs_m_in.REQ_TRC_START;
|
||||||
end = fs_m_in.REQ_TRC_END_LO;
|
end = fs_m_in.REQ_TRC_END;
|
||||||
|
|
||||||
if (end == 0)
|
if (end == 0)
|
||||||
r = truncate_inode(rip, start);
|
r = truncate_inode(rip, start);
|
||||||
|
|
|
@ -498,8 +498,8 @@ int fs_ftrunc(void)
|
||||||
if(rip->i_sp->s_rd_only) {
|
if(rip->i_sp->s_rd_only) {
|
||||||
r = EROFS;
|
r = EROFS;
|
||||||
} else {
|
} else {
|
||||||
start = fs_m_in.REQ_TRC_START_LO;
|
start = fs_m_in.REQ_TRC_START;
|
||||||
end = fs_m_in.REQ_TRC_END_LO;
|
end = fs_m_in.REQ_TRC_END;
|
||||||
|
|
||||||
if (end == 0)
|
if (end == 0)
|
||||||
r = truncate_inode(rip, start);
|
r = truncate_inode(rip, start);
|
||||||
|
|
|
@ -16,7 +16,7 @@ int fs_ftrunc(message *fs_m_in, message *fs_m_out)
|
||||||
|
|
||||||
if( (rip = find_inode(inumb)) == NULL) return(EINVAL);
|
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);
|
return truncate_inode(rip, start);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 */
|
/* Fill in request message */
|
||||||
m.m_type = REQ_FTRUNC;
|
m.m_type = REQ_FTRUNC;
|
||||||
m.REQ_INODE_NR = (pino_t) inode_nr;
|
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) &&
|
||||||
if (vmp->m_fs_flags & RES_64BIT) {
|
((start > INT_MAX) || (end > INT_MAX))) {
|
||||||
m.REQ_TRC_START_HI = ex64hi(start);
|
|
||||||
} else if (start > INT_MAX) {
|
|
||||||
/* FS does not support 64-bit off_t and 32 bits is not enough */
|
/* FS does not support 64-bit off_t and 32 bits is not enough */
|
||||||
return EINVAL;
|
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 */
|
/* Send/rec request */
|
||||||
|
|
Loading…
Reference in a new issue