Skip to content

Commit

Permalink
Merge pull request #7095 from xiexingguo/xxg-wip-14204
Browse files Browse the repository at this point in the history
osd: kstore: small fixes to kstore

Reviewed-by: Sage Weil <sage@newdream.net>
  • Loading branch information
liewegas committed Jan 6, 2016
2 parents 1db6eee + a9b7c0d commit 8daafba
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/os/kstore/KStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ int KStore::_write_fsid()
}
r = ::fsync(fsid_fd);
if (r < 0) {
r = -errno;
derr << __func__ << " fsid fsync failed: " << cpp_strerror(r) << dendl;
return r;
}
Expand Down Expand Up @@ -854,8 +855,6 @@ int KStore::_open_db(bool create)
fn);
if (!db) {
derr << __func__ << " error creating db" << dendl;
delete db;
db = NULL;
return -EIO;
}
string options;
Expand Down Expand Up @@ -3127,7 +3126,7 @@ int KStore::_truncate(TransContext *txc,

RWLock::WLocker l(c->lock);
OnodeRef o = c->get_onode(oid, false);
if (!o->exists) {
if (!o || !o->exists) {
r = -ENOENT;
goto out;
}
Expand All @@ -3144,7 +3143,6 @@ int KStore::_do_remove(TransContext *txc,
OnodeRef o)
{
string key;
o->exists = false;

_do_truncate(txc, o, 0);

Expand Down Expand Up @@ -3412,10 +3410,6 @@ int KStore::_omap_rmkeys(TransContext *txc,
r = 0;
goto out;
}
if (!o->onode.omap_head) {
o->onode.omap_head = o->onode.nid;
txc->write_onode(o);
}
::decode(num, p);
while (num--) {
string key;
Expand Down Expand Up @@ -3695,7 +3689,6 @@ int KStore::_remove_collection(TransContext *txc, coll_t cid,
{
dout(15) << __func__ << " " << cid << dendl;
int r;
bufferlist empty;

{
RWLock::WLocker l(coll_lock);
Expand Down

0 comments on commit 8daafba

Please sign in to comment.