*** empty log message ***

git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@550 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
sage 2005-12-30 05:10:51 +00:00
parent 110a6f0ed3
commit 1a15a59968
4 changed files with 27 additions and 11 deletions

View File

@ -642,8 +642,8 @@ int SyntheticClient::make_dirs(const char *basedir, int dirs, int files, int dep
int SyntheticClient::write_file(string& fn, int size, int wrsize) // size is in MB, wrsize in bytes
{
//__uint64_t wrsize = 1024*256;
char *buf = new char[wrsize]; // 1 MB
memset(buf, 1, wrsize);
char *buf = new char[wrsize+100]; // 1 MB
memset(buf, 7, wrsize);
__uint64_t chunks = (__uint64_t)size * (__uint64_t)(1024*1024) / (__uint64_t)wrsize;
int fd = client->open(fn.c_str(), O_WRONLY|O_CREAT);
@ -653,6 +653,20 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize) // size is i
for (unsigned i=0; i<chunks; i++) {
if (time_to_stop()) break;
dout(2) << "writing block " << i << "/" << chunks << endl;
// fill buf with a fingerprint
int *p = (int*)buf;
while ((char*)p < buf + wrsize) {
*p = (char*)p - buf;
p++;
*p = i;
p++;
*p = client->get_nodeid();
p++;
*p = 0;
p++;
}
client->write(fd, buf, wrsize, i*wrsize);
}

View File

@ -80,7 +80,7 @@ int BlockDevice::io_thread_entry()
io_queue_map.erase(bio);
io_queue.erase(prev);
if (i == io_queue.end()) break;
if (true || i == io_queue.end()) break;
}
lock.Unlock();
@ -120,7 +120,7 @@ int BlockDevice::io_thread_entry()
io_queue_map.erase(bio);
io_queue.erase(prev);
if (begin) break;
if (true || begin) break;
}
lock.Unlock();
@ -338,7 +338,8 @@ int BlockDevice::_write(unsigned bno, unsigned num, bufferlist& bl)
assert(fd > 0);
off_t offset = bno * EBOFS_BLOCK_SIZE;
off_t offset = (off_t)bno << EBOFS_BLOCK_BITS;
assert((off_t)bno * (off_t)EBOFS_BLOCK_SIZE == offset);
off_t actual = lseek(fd, offset, SEEK_SET);
assert(actual == offset);

View File

@ -510,7 +510,7 @@ Onode* Ebofs::get_onode(object_t oid)
p += sizeof(len);
on->attr[key] = AttrVal(p, len);
p += len;
dout(10) << "get_onode " << *on << " attr " << key << " len " << len << endl;
dout(15) << "get_onode " << *on << " attr " << key << " len " << len << endl;
}
// parse extents
@ -519,7 +519,7 @@ Onode* Ebofs::get_onode(object_t oid)
for (int i=0; i<eo->num_extents; i++) {
Extent ex = *((Extent*)p);
on->extents.push_back(ex);
dout(10) << "get_onode " << *on << " ex " << i << ": " << ex << endl;
dout(15) << "get_onode " << *on << " ex " << i << ": " << ex << endl;
n += ex.length;
p += sizeof(Extent);
}
@ -592,14 +592,14 @@ void Ebofs::write_onode(Onode *on)
off += sizeof(int);
bl.copy_in(off, i->second.len, i->second.data);
off += i->second.len;
dout(10) << "write_onode " << *on << " attr " << i->first << " len " << i->second.len << endl;
dout(15) << "write_onode " << *on << " attr " << i->first << " len " << i->second.len << endl;
}
// extents
for (unsigned i=0; i<on->extents.size(); i++) {
bl.copy_in(off, sizeof(Extent), (char*)&on->extents[i]);
off += sizeof(Extent);
dout(10) << "write_onode " << *on << " ex " << i << ": " << on->extents[i] << endl;
dout(15) << "write_onode " << *on << " ex " << i << ": " << on->extents[i] << endl;
}
// write
@ -825,7 +825,7 @@ Cnode* Ebofs::get_cnode(object_t cid)
p += sizeof(len);
cn->attr[key] = AttrVal(p, len);
p += len;
dout(10) << "get_cnode " << *cn << " attr " << key << " len " << len << endl;
dout(15) << "get_cnode " << *cn << " attr " << key << " len " << len << endl;
}
// wake up other waiters
@ -880,7 +880,7 @@ void Ebofs::write_cnode(Cnode *cn)
bl.copy_in(off, i->second.len, i->second.data);
off += i->second.len;
dout(10) << "write_cnode " << *cn << " attr " << i->first << " len " << i->second.len << endl;
dout(15) << "write_cnode " << *cn << " attr " << i->first << " len " << i->second.len << endl;
}
// write

View File

@ -63,6 +63,7 @@ namespace __gnu_cxx {
typedef __uint64_t block_t; // disk location/sector/block
static const int EBOFS_BLOCK_SIZE = 4096;
static const int EBOFS_BLOCK_BITS = 12; // 1<<12 == 4096
class Extent {
public: