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 @@ -1642,7 +1642,6 @@ class Cache : public ExtentTransViewRetriever {
16421642 // absent, add to top (back)
16431643 if (extent_loaded_length > 0 ) {
16441644 current_size += extent_loaded_length;
1645- get_by_ext (sizes_by_ext, extent.get_type ()).account_in (extent_loaded_length);
16461645 overall_io.in_sizes .account_in (extent_loaded_length);
16471646 if (p_src) {
16481647 get_by_ext (
@@ -1652,6 +1651,7 @@ class Cache : public ExtentTransViewRetriever {
16521651 }
16531652 } // else: the extent isn't loaded upon touch_extent()/on_cache(),
16541653 // account the io later in increase_cached_size() upon read_extent()
1654+ get_by_ext (sizes_by_ext, extent.get_type ()).account_in (extent_loaded_length);
16551655 intrusive_ptr_add_ref (&extent);
16561656 lru.push_back (extent);
16571657
@@ -1670,7 +1670,7 @@ class Cache : public ExtentTransViewRetriever {
16701670 // present, increase size
16711671 assert (lru.size () > 0 );
16721672 current_size += increased_length;
1673- get_by_ext (sizes_by_ext, extent.get_type ()).account_in (increased_length);
1673+ get_by_ext (sizes_by_ext, extent.get_type ()).account_parital_in (increased_length);
16741674 overall_io.in_sizes .account_in (increased_length);
16751675 if (p_src) {
16761676 get_by_ext (
Original file line number Diff line number Diff line change @@ -2853,6 +2853,10 @@ struct cache_size_stats_t {
28532853 ++num_extents;
28542854 }
28552855
2856+ void account_parital_in (extent_len_t sz) {
2857+ size += sz;
2858+ }
2859+
28562860 void account_out (extent_len_t sz) {
28572861 assert (size >= sz);
28582862 assert (num_extents > 0 );
You can’t perform that action at this time.
0 commit comments