fixed iounit based issues in ixp2, wmiibar uses 256 byte iounit (in this fs we don't need more)

This commit is contained in:
Anselm R. Garbe 2006-01-30 19:13:54 +02:00
parent ec0d3809c8
commit f137735249
3 changed files with 9 additions and 13 deletions

View File

@ -92,10 +92,10 @@ static char *version[] = {
static void
usage()
{
fprintf(stderr, "%s %d",
fprintf(stderr, "%s",
"usage: wmiibar -a <server address> [-v]\n"
" -a server address \n"
" -v version info\n", 0);
" -v version info\n");
exit(1);
}
@ -443,8 +443,7 @@ xopen(IXPConn *c)
}
c->fcall->id = ROPEN;
c->fcall->qid = m->qid;
c->fcall->iounit = c->fcall->maxmsg
- (sizeof(unsigned char) + sizeof(unsigned short) + 2 * sizeof(unsigned int));
c->fcall->iounit = 256;
return 0;
}

View File

@ -43,6 +43,7 @@ write_data(unsigned int fid)
size_t len = 0;
while((len = read(0, data, c.fcall.iounit)) > 0) {
fprintf(stderr, "read=%d, bufsz=%d\n", len, c.fcall.iounit);
if(ixp_client_write
(&c, fid, offset, len, data) != len) {
fprintf(stderr, "wmiir: cannot write file: %s\n", c.errstr);

View File

@ -137,10 +137,8 @@ int
ixp_client_read(IXPClient * c, unsigned int fid, unsigned long long offset,
void *result, unsigned int res_len)
{
unsigned int bytes =
c->fcall.maxmsg - (sizeof(unsigned char) + sizeof(unsigned short) +
2 * sizeof(unsigned int) +
sizeof(unsigned long long));
unsigned int bytes = c->fcall.iounit;
/* read */
c->fcall.id = TREAD;
c->fcall.tag = IXP_NOTAG;
@ -158,11 +156,9 @@ ixp_client_write(IXPClient * c, unsigned int fid,
unsigned long long offset, unsigned int count,
unsigned char *data)
{
if(count >
c->fcall.maxmsg - (sizeof(unsigned char) + sizeof(unsigned short) +
2 * sizeof(unsigned int) +
sizeof(unsigned long long))) {
c->errstr = "message size exceeds buffer size";
if(count > c->fcall.iounit)
{
c->errstr = "iounit exceeded";
return -1;
}
/* write */