mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
* uninit mem bug in ebofs
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1495 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
d1436d2b5a
commit
2f5718f4bc
@ -1512,7 +1512,7 @@ void Ebofs::alloc_write(Onode *on,
|
||||
|
||||
|
||||
|
||||
void Ebofs::apply_write(Onode *on, off_t off, size_t len, bufferlist& bl)
|
||||
void Ebofs::apply_write(Onode *on, off_t off, size_t len, const bufferlist& bl)
|
||||
{
|
||||
ObjectCache *oc = on->get_oc(&bc);
|
||||
|
||||
@ -2319,7 +2319,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t)
|
||||
|
||||
|
||||
|
||||
int Ebofs::_write(object_t oid, off_t offset, size_t length, bufferlist& bl)
|
||||
int Ebofs::_write(object_t oid, off_t offset, size_t length, const bufferlist& bl)
|
||||
{
|
||||
dout(7) << "_write " << oid << " " << offset << "~" << length << endl;
|
||||
assert(bl.length() == length);
|
||||
@ -2384,7 +2384,7 @@ int Ebofs::_write(object_t oid, off_t offset, size_t length, bufferlist& bl)
|
||||
|
||||
int Ebofs::write(object_t oid,
|
||||
off_t off, size_t len,
|
||||
bufferlist& bl, Context *onsafe)
|
||||
const bufferlist& bl, Context *onsafe)
|
||||
{
|
||||
ebofs_lock.Lock();
|
||||
assert(len > 0);
|
||||
@ -2399,9 +2399,9 @@ int Ebofs::write(object_t oid,
|
||||
if (journal) {
|
||||
Transaction t;
|
||||
t.write(oid, off, len, bl);
|
||||
bufferlist bl;
|
||||
t._encode(bl);
|
||||
if (journal->submit_entry(bl, onsafe)) break;
|
||||
bufferlist tbl;
|
||||
t._encode(tbl);
|
||||
if (journal->submit_entry(tbl, onsafe)) break;
|
||||
}
|
||||
if (onsafe) commit_waiters[super_epoch].push_back(onsafe);
|
||||
break;
|
||||
|
@ -188,7 +188,7 @@ protected:
|
||||
block_t start, block_t len,
|
||||
interval_set<block_t>& alloc,
|
||||
block_t& old_bfirst, block_t& old_blast);
|
||||
void apply_write(Onode *on, off_t off, size_t len, bufferlist& bl);
|
||||
void apply_write(Onode *on, off_t off, size_t len, const bufferlist& bl);
|
||||
bool attempt_read(Onode *on, off_t off, size_t len, bufferlist& bl,
|
||||
Cond *will_wait_on, bool *will_wait_on_bool);
|
||||
|
||||
@ -275,7 +275,7 @@ protected:
|
||||
int read(object_t, off_t off, size_t len, bufferlist& bl);
|
||||
int is_cached(object_t oid, off_t off, size_t len);
|
||||
|
||||
int write(object_t oid, off_t off, size_t len, bufferlist& bl, Context *onsafe);
|
||||
int write(object_t oid, off_t off, size_t len, const bufferlist& bl, Context *onsafe);
|
||||
void trim_from_cache(object_t oid, off_t off, size_t len);
|
||||
int truncate(object_t oid, off_t size, Context *onsafe=0);
|
||||
int truncate_front(object_t oid, off_t size, Context *onsafe=0);
|
||||
@ -339,7 +339,7 @@ private:
|
||||
int _getattrs(object_t oid, map<string,bufferptr> &aset);
|
||||
|
||||
bool _write_will_block();
|
||||
int _write(object_t oid, off_t off, size_t len, bufferlist& bl);
|
||||
int _write(object_t oid, off_t off, size_t len, const bufferlist& bl);
|
||||
void _trim_from_cache(object_t oid, off_t off, size_t len);
|
||||
int _truncate(object_t oid, off_t size);
|
||||
int _truncate_front(object_t oid, off_t size);
|
||||
|
@ -48,6 +48,7 @@ int FileJournal::create()
|
||||
dout(1) << "open " << fn << " " << st.st_size << " bytes" << endl;
|
||||
|
||||
// write empty header
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.clear();
|
||||
header.fsid = ebofs->get_fsid();
|
||||
header.max_size = st.st_size;
|
||||
@ -274,7 +275,7 @@ bool FileJournal::submit_entry(bufferlist& e, Context *oncommit)
|
||||
<< endl;
|
||||
full = true;
|
||||
print_header();
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// we haven't wrapped.
|
||||
|
Loading…
Reference in New Issue
Block a user