]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
FileStore: replace op_queue_throttle with op_queue_reserve_throttle
authorSamuel Just <samuel.just@dreamhost.com>
Tue, 22 Mar 2011 21:52:15 +0000 (14:52 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 23 Mar 2011 23:53:28 +0000 (16:53 -0700)
commitc866536bff5bdd9c31772dfa1e63e26faba49b4c
tree84c1b1d713044c777f7495ac147007bc1d8c06d4
parent6346702371d1a9e6c2699af07166e1eccd8f6441
FileStore: replace op_queue_throttle with op_queue_reserve_throttle

Previously, queue_op would call op_queue_throttle while holding the
journal_lock.  op_queue_throttle, however, can sleep.

We fix the problem by:
1) Factor build_op out of queue_op
2) op_queue_throttle is now op_queue_reserve_throttle and takes an op as
an argument.  op_queue_reserve_throttle can be called before the journal
lock is taken.  This also avoids the race between calling throttle and
incrementing op_queue_bytes and op_queue_len.
3) queue_op now takes the op generated using build_op as an argument.
4) _journaled_ahead no longer needs to call throttle as
queue_transactions has already reserved space.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/os/FileStore.cc
src/os/FileStore.h