mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:22:43 +00:00 
			
		
		
		
	Ext2FS: Move block list computation from Ext2FS to Ext2FSInode
Since the inode is the logical owner of its block list, let's move the code that computes the block list there, and also stop hogging the FS lock while we compute the block list, as there is no need for it.
This commit is contained in:
		
							parent
							
								
									c09921b9be
								
							
						
					
					
						commit
						c3a0fd4b7a
					
				
					 2 changed files with 40 additions and 30 deletions
				
			
		|  | @ -82,6 +82,10 @@ private: | |||
|     bool populate_lookup_cache() const; | ||||
|     KResult resize(u64); | ||||
|     KResult flush_block_list(); | ||||
|     Vector<BlockBasedFS::BlockIndex> compute_block_list() const; | ||||
|     Vector<BlockBasedFS::BlockIndex> compute_block_list_with_meta_blocks() const; | ||||
|     Vector<BlockBasedFS::BlockIndex> compute_block_list_impl(bool include_block_list_blocks) const; | ||||
|     Vector<BlockBasedFS::BlockIndex> compute_block_list_impl_internal(const ext2_inode& e2inode, bool include_block_list_blocks) const; | ||||
| 
 | ||||
|     Ext2FS& fs(); | ||||
|     const Ext2FS& fs() const; | ||||
|  | @ -145,9 +149,6 @@ private: | |||
|     GroupIndex group_index_from_inode(InodeIndex) const; | ||||
|     GroupIndex group_index_from_block_index(BlockIndex) const; | ||||
| 
 | ||||
|     Vector<BlockIndex> block_list_for_inode_impl(const ext2_inode&, bool include_block_list_blocks = false) const; | ||||
|     Vector<BlockIndex> block_list_for_inode(const ext2_inode&, bool include_block_list_blocks = false) const; | ||||
| 
 | ||||
|     KResultOr<bool> get_inode_allocation_state(InodeIndex) const; | ||||
|     KResult set_inode_allocation_state(InodeIndex, bool); | ||||
|     KResult set_block_allocation_state(BlockIndex, bool); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling