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

disk index: use bits in ref count to store occupied #31004

Merged

Conversation

jeffwashington
Copy link
Contributor

Problem

See #30711

We'll be moving 0 or 1 slot entries into the index entry instead of the data file. This is a step in that direction.

Summary of Changes

Store the occupied/free bit in the refcount spare bits as an enum.

Fixes #

@jeffwashington jeffwashington force-pushed the mm38_occupied_in_refount branch 2 times, most recently from 2711027 to f677c55 Compare March 31, 2023 15:46
@jeffwashington jeffwashington force-pushed the mm38_occupied_in_refount branch from f677c55 to fb977ce Compare March 31, 2023 16:09
@jeffwashington jeffwashington marked this pull request as ready for review March 31, 2023 16:10
Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -190,6 +190,18 @@ impl<O: BucketOccupied> BucketStorage<O> {
unsafe { slice.get_unchecked_mut(0) }
}

pub(crate) fn get_mut_from_parts<T: Sized>(item_slice: &mut [u8]) -> &mut T {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We can remove the Sized bound from these two functions now. (Can be done in a different PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this up in the next one.

@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Merging #31004 (fb977ce) into master (db5cdbe) will increase coverage by 0.0%.
The diff coverage is 95.1%.

@@           Coverage Diff           @@
##           master   #31004   +/-   ##
=======================================
  Coverage    81.5%    81.5%           
=======================================
  Files         728      728           
  Lines      205456   205494   +38     
=======================================
+ Hits       167562   167626   +64     
+ Misses      37894    37868   -26     

@jeffwashington jeffwashington merged commit a2797eb into solana-labs:master Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants