fixed trace_convert to write to previous offset

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1249 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
anwleung 2007-03-16 00:07:21 +00:00
parent 183857fe7e
commit 974c3fe013
2 changed files with 8 additions and 12 deletions

View File

@ -2838,7 +2838,7 @@ int Client::read(fh_t fh, char *buf, off_t size, off_t offset,
tout << size << endl;
tout << offset << endl;
assert(offset >= 0);
//assert(offset >= 0);
assert(fh_map.count(fh));
Fh *f = fh_map[fh];
Inode *in = f->inode;
@ -2988,7 +2988,7 @@ int Client::write(fh_t fh, const char *buf, off_t size, off_t offset,
tout << size << endl;
tout << offset << endl;
assert(offset >= 0);
//assert(offset >= 0);
assert(fh_map.count(fh));
Fh *f = fh_map[fh];
Inode *in = f->inode;

View File

@ -66,12 +66,10 @@ for $file_handle(@files) {
($before, $after) = split(/\) *=/, $line);
@replies = split(/\s/, $after);
$read_size = $replies[1];
if (! $read_size) {
print "$file_handle $line read_size=$read_size\n";
}
# FIXME hack to reads aren't empty
print OUT "write\n$ret_val\n$read_size\n0\n";
print OUT "read\n$ret_val\n$read_size\n0\n";
# FIXME hack so reads aren't empty
print OUT "write\n$ret_val\n$read_size\n-1\n";
print OUT "read\n$ret_val\n$read_size\n-1\n";
}
elsif ($op =~ /write/) {
my $before;
@ -84,10 +82,8 @@ for $file_handle(@files) {
($before, $after) = split(/\) *=/, $line);
@replies = split(/\s/, $after);
$write_size = $replies[1];
if (! $write_size) {
print "$file_handle $line write_size=$write_size\n";
}
print OUT "write\n$ret_val\n$write_size\n0\n";
print OUT "write\n$ret_val\n$write_size\n-1\n";
}
}
close(FILE);