Merge pull request #7017 from efirs/ef_atomic_ceph_tid

osd: use atomic to generate ceph_tid

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2016-01-01 09:48:10 -05:00
commit 68a7c04b83
2 changed files with 2 additions and 8 deletions

View File

@ -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),

View File

@ -798,14 +798,9 @@ public:
// -- 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 --