Skip to content

Commit 9293a32

Browse files
authored
Merge pull request ceph#65166 from myoungwon/wip-fix-rbm-mergeable-block
crimson/os/seastore: correct possible mergeable size for ool extents Reviewed-by: Xuehan Xu <[email protected]>
2 parents 8e926a0 + 552499f commit 9293a32

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/crimson/os/seastore/extent_placement_manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ RandomBlockOolWriter::do_write(
10731073

10741074
// TODO : allocate a consecutive address based on a transaction
10751075
if (writes.size() != 0 &&
1076-
writes.back().offset + writes.back().bp.length() == paddr) {
1076+
writes.back().offset + writes.back().get_mergeable_length() == paddr) {
10771077
// We can write both the currrent extent and the previous one at once
10781078
// if the extents are located in a row
10791079
if (writes.back().mergeable_bps.size() == 0) {

src/crimson/os/seastore/extent_placement_manager.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,17 @@ class RandomBlockOolWriter : public ExtentOolWriter {
195195
ceph::bufferptr bp;
196196
RandomBlockManager* rbm;
197197
std::list<ceph::bufferptr> mergeable_bps;
198+
199+
extent_len_t get_mergeable_length() const {
200+
if (mergeable_bps.size() == 0) {
201+
return bp.length();
202+
}
203+
extent_len_t len = 0;
204+
for (auto &p : mergeable_bps) {
205+
len += p.length();
206+
}
207+
return len;
208+
}
198209
};
199210
alloc_write_iertr::future<> do_write(
200211
Transaction& t,

0 commit comments

Comments
 (0)