New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore: remove CephContext* from BmapEntry. #13651

Merged
merged 1 commit into from Mar 1, 2017
Jump to file or symbol
Failed to load files and symbols.
+6 −10
Diff settings

Always

Just for now

@@ -123,8 +123,7 @@ void BmapEntry::_init_bit_mask()
BmapEntry::m_bit_mask_init = true;
}
BmapEntry::BmapEntry(CephContext* cct, bool full)
: cct(cct)
BmapEntry::BmapEntry(CephContext*, const bool full)

This comment has been minimized.

@ifed01

ifed01 Feb 27, 2017

Contributor

Suggest to remove CephContext parameter...

@ifed01

ifed01 Feb 27, 2017

Contributor

Suggest to remove CephContext parameter...

This comment has been minimized.

@rzarzynski

rzarzynski Mar 1, 2017

Contributor

You're right. I deferred the clean-up to not introduce dependencies between patches as I'm going to touch BitMapZone as well. Having CephContext* there costs us additional 2 MiB in the case of 1 TiB SSD. :-(

@rzarzynski

rzarzynski Mar 1, 2017

Contributor

You're right. I deferred the clean-up to not introduce dependencies between patches as I'm going to touch BitMapZone as well. Having CephContext* there costs us additional 2 MiB in the case of 1 TiB SSD. :-(

{
BmapEntry::_init_bit_mask();
@@ -334,7 +333,7 @@ BmapEntry::find_first_set_bits(int64_t required_blocks,
return allocated;
}
void BmapEntry::dump_state(int& count)
void BmapEntry::dump_state(CephContext* const cct, const int& count)
{
dout(0) << count << ":: 0x" << std::hex << m_bits << std::dec << dendl;
}
@@ -628,7 +627,7 @@ void BitMapZone::dump_state(int& count)
m_bmap_list, 0);
dout(0) << __func__ << " zone " << count << " dump start " << dendl;
while ((bmap = (BmapEntry *) iter.next())) {
bmap->dump_state(bmap_idx);
bmap->dump_state(cct, bmap_idx);
bmap_idx++;
}
dout(0) << __func__ << " zone " << count << " dump end " << dendl;
@@ -139,8 +139,6 @@ typedef unsigned long bmap_t;
typedef mempool::bluestore_alloc::vector<bmap_t> bmap_mask_vec_t;
class BmapEntry {
CephContext* cct;
private:
bmap_t m_bits;
static bool m_bit_mask_init;
@@ -157,12 +155,11 @@ class BmapEntry {
static bmap_t align_mask(int x);
static bmap_t bit_mask(int bit_num);
bmap_t atomic_fetch();
BmapEntry(CephContext* cct, bool val);
BmapEntry(CephContext* cct) : cct(cct) {
BmapEntry(CephContext*, bool val);
BmapEntry(CephContext*) {
m_bits = 0;
}
BmapEntry(const BmapEntry& bmap) {
cct = bmap.cct;
m_bits = bmap.m_bits;
}
@@ -179,7 +176,7 @@ class BmapEntry {
int find_first_set_bits(int64_t required_blocks, int bit_offset,
int *start_offset, int64_t *scanned);
void dump_state(int& count);
void dump_state(CephContext* cct, const int& count);
~BmapEntry();
};
ProTip! Use n and p to navigate between commits in a pull request.