File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1641,7 +1641,6 @@ class Cache : public ExtentTransViewRetriever {
16411641 // absent, add to top (back)
16421642 if (extent_loaded_length > 0 ) {
16431643 current_size += extent_loaded_length;
1644- get_by_ext (sizes_by_ext, extent.get_type ()).account_in (extent_loaded_length);
16451644 overall_io.in_sizes .account_in (extent_loaded_length);
16461645 if (p_src) {
16471646 get_by_ext (
@@ -1651,6 +1650,7 @@ class Cache : public ExtentTransViewRetriever {
16511650 }
16521651 } // else: the extent isn't loaded upon touch_extent()/on_cache(),
16531652 // account the io later in increase_cached_size() upon read_extent()
1653+ get_by_ext (sizes_by_ext, extent.get_type ()).account_in (extent_loaded_length);
16541654 intrusive_ptr_add_ref (&extent);
16551655 lru.push_back (extent);
16561656
@@ -1669,7 +1669,7 @@ class Cache : public ExtentTransViewRetriever {
16691669 // present, increase size
16701670 assert (lru.size () > 0 );
16711671 current_size += increased_length;
1672- get_by_ext (sizes_by_ext, extent.get_type ()).account_in (increased_length);
1672+ get_by_ext (sizes_by_ext, extent.get_type ()).account_parital_in (increased_length);
16731673 overall_io.in_sizes .account_in (increased_length);
16741674 if (p_src) {
16751675 get_by_ext (
Original file line number Diff line number Diff line change @@ -2874,6 +2874,10 @@ struct cache_size_stats_t {
28742874 ++num_extents;
28752875 }
28762876
2877+ void account_parital_in (extent_len_t sz) {
2878+ size += sz;
2879+ }
2880+
28772881 void account_out (extent_len_t sz) {
28782882 assert (size >= sz);
28792883 assert (num_extents > 0 );
You can’t perform that action at this time.
0 commit comments