mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
crimson/os/seastore/transaction_manager: only add pin if not already pending
If it's already pending, cache.duplicate_for_write is a noop and the extent will already have a pin. Also, add some debugging. Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
31d3057a35
commit
9016932fef
@ -136,10 +136,25 @@ public:
|
||||
|
||||
/// Obtain mutable copy of extent
|
||||
LogicalCachedExtentRef get_mutable_extent(Transaction &t, LogicalCachedExtentRef ref) {
|
||||
auto &logger = crimson::get_logger(ceph_subsys_filestore);
|
||||
auto ret = cache.duplicate_for_write(
|
||||
t,
|
||||
ref)->cast<LogicalCachedExtent>();
|
||||
ret->set_pin(ref->get_pin().duplicate());
|
||||
if (!ret->has_pin()) {
|
||||
logger.debug(
|
||||
"{}: duplicating {} for write: {}",
|
||||
__func__,
|
||||
*ref,
|
||||
*ret);
|
||||
ret->set_pin(ref->get_pin().duplicate());
|
||||
} else {
|
||||
logger.debug(
|
||||
"{}: {} already pending",
|
||||
__func__,
|
||||
*ref);
|
||||
assert(ref->is_pending());
|
||||
assert(&*ref == &*ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user