File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ def __init__(self, config):
2929 # WRONG: WE HAVE A FUNCTION TO DO THIS DON'T GUESS
3030 self .block_size = config .get ("block_size" ) or DEFAULT_BLOCK_SIZE
3131 self .map_path = self .cache .with_suffix (f"{ self .cache .suffix } .log" )
32- self .diskmap = DiskMap (self .map_path )
32+
33+ # Get device size for DiskMap
34+ device_size = get_device_size (self .device )
35+ self .diskmap = DiskMap (self .map_path , device_size )
3336
3437 # Initialize cache
3538 self ._initialize ()
Original file line number Diff line number Diff line change 1111 DEFAULT_BLOCK_SIZE ,
1212)
1313
14- # Import Cache class
15- from blkcache .cache .cache import Cache
14+ # Import BlockCache class
15+ from blkcache .cache .through import BlockCache
1616
1717# Global state
1818DEV : Path | None = None
@@ -57,9 +57,8 @@ def config_complete() -> None:
5757 raise RuntimeError ("device= and cache= are required" )
5858
5959 # Create a BlockCache instance
60- CACHE_INSTANCE = BlockCache (
61- device_path = DEV , cache_path = CACHE , block_size = BLOCK if BLOCK != DEFAULT_BLOCK_SIZE else None
62- )
60+ config = {"device_path" : DEV , "cache_path" : CACHE , "block_size" : BLOCK if BLOCK != DEFAULT_BLOCK_SIZE else None }
61+ CACHE_INSTANCE = BlockCache (config )
6362
6463 # The BlockCache initialization will handle:
6564 # - Loading the mapfile if it exists
Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ def test_auto_detection_failure(mock_get_sector_size):
6464 assert error_msg in updates ["block_size_source" ]
6565
6666
67-
6867def testdetermine_block_size_with_auto_detect ():
6968 """When auto-detection succeeds, the detected size should be used."""
7069 # We'll test the higher-level determine_block_size function instead
You can’t perform that action at this time.
0 commit comments