Skip to content
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: readability improvements and doxygen fix #11895

Merged
merged 2 commits into from Nov 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 13 additions & 10 deletions src/os/bluestore/BlueStore.h
Expand Up @@ -542,7 +542,7 @@ class BlueStore : public ObjectStore,
uint32_t blob_offset = 0; ///< blob offset
uint32_t length = 0; ///< length
uint8_t blob_depth = 0; ///< blob overlapping count
BlobRef blob; ///< the blob with our data
BlobRef blob; ///< the blob with our data

/// ctor for lookup only
explicit Extent(uint32_t lo) : logical_offset(lo) { }
Expand Down Expand Up @@ -577,19 +577,22 @@ class BlueStore : public ObjectStore,
return a.logical_offset == b.logical_offset;
}

uint32_t blob_start() {
return logical_offset - blob_offset;
}

uint32_t blob_end() {
return logical_offset + blob->get_blob().get_logical_length() -
blob_offset;
return blob_start() + blob->get_blob().get_logical_length();
}

uint32_t end() const {
return logical_offset + length;
}

// return true if any piece of the blob is out of
// the given range [o, o + l].
bool blob_escapes_range(uint32_t o, uint32_t l) {
uint32_t bstart = logical_offset - blob_offset;
return (bstart < o ||
bstart + blob->get_blob().get_logical_length() > o + l);
return blob_start() < o || blob_end() > o + l;
}
};
typedef boost::intrusive::set<Extent> extent_map_t;
Expand Down Expand Up @@ -955,10 +958,10 @@ class BlueStore : public ObjectStore,

onode_lru_list_t onode_lru;

buffer_list_t buffer_hot; //< "Am" hot buffers
buffer_list_t buffer_warm_in; //< "A1in" newly warm buffers
buffer_list_t buffer_warm_out; //< "A1out" empty buffers we've evicted
uint64_t buffer_bytes = 0; //< bytes
buffer_list_t buffer_hot; ///< "Am" hot buffers
buffer_list_t buffer_warm_in; ///< "A1in" newly warm buffers
buffer_list_t buffer_warm_out; ///< "A1out" empty buffers we've evicted
uint64_t buffer_bytes = 0; ///< bytes

enum {
BUFFER_NEW = 0,
Expand Down