Skip to content

Commit

Permalink
Merge pull request #7017 from efirs/ef_atomic_ceph_tid
Browse files Browse the repository at this point in the history
osd: use atomic to generate ceph_tid

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
liewegas committed Jan 1, 2016
2 parents c6f88ec + 70b0962 commit 68a7c04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ OSDService::OSDService(OSD *osd) :
backfill_request_lock("OSD::backfill_request_lock"),
backfill_request_timer(cct, backfill_request_lock, false),
last_tid(0),
tid_lock("OSDService::tid_lock"),
reserver_finisher(cct),
local_reserver(&reserver_finisher, cct->_conf->osd_max_backfills,
cct->_conf->osd_min_recovery_priority),
Expand Down
9 changes: 2 additions & 7 deletions src/osd/OSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -798,14 +798,9 @@ class OSDService {

// -- tids --
// for ops i issue
ceph_tid_t last_tid;
Mutex tid_lock;
atomic_t last_tid;
ceph_tid_t get_tid() {
ceph_tid_t t;
tid_lock.Lock();
t = ++last_tid;
tid_lock.Unlock();
return t;
return (ceph_tid_t)last_tid.inc();
}

// -- backfill_reservation --
Expand Down

0 comments on commit 68a7c04

Please sign in to comment.