File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ int ErasureCode::encode_prepare(const bufferlist &raw,
247247 for (unsigned int i = 0 ; i < k - padded_chunks; i++) {
248248 bufferlist &chunk = encoded[chunk_index (i)];
249249 chunk.substr_of (prepared, i * blocksize, blocksize);
250- chunk.rebuild_aligned_size_and_memory (blocksize, SIMD_ALIGN);
250+ chunk.rebuild_aligned_size_and_memory (blocksize, SIMD_ALIGN, 1 );
251251 ceph_assert (chunk.is_contiguous ());
252252 }
253253 if (padded_chunks) {
@@ -285,7 +285,7 @@ int ErasureCode::encode_prepare(const bufferlist &raw,
285285 for (raw_shard_id_t i; i < k - padded_chunks; ++i) {
286286 bufferlist &chunk = encoded[chunk_index (i)];
287287 chunk.substr_of (prepared, (int )i * blocksize, blocksize);
288- chunk.rebuild_aligned_size_and_memory (blocksize, SIMD_ALIGN);
288+ chunk.rebuild_aligned_size_and_memory (blocksize, SIMD_ALIGN, 1 );
289289 ceph_assert (chunk.is_contiguous ());
290290 }
291291 if (padded_chunks) {
Original file line number Diff line number Diff line change @@ -1867,6 +1867,9 @@ TEST(BufferList, rebuild_aligned_size_and_memory) {
18671867 EXPECT_TRUE (bl.is_n_align_sized (BUFFER_SIZE));
18681868 EXPECT_EQ (3U , bl.get_num_buffers ());
18691869
1870+ bl.rebuild_aligned_size_and_memory (BUFFER_SIZE, SIMD_ALIGN, 1 );
1871+ EXPECT_EQ (1U , bl.get_num_buffers ());
1872+
18701873 {
18711874 /* bug replicator, to test rebuild_aligned_size_and_memory() in the
18721875 * scenario where the first bptr is both size and memory aligned and
You can’t perform that action at this time.
0 commit comments