Ticket #5707: bfs_DeviceBlockSize.patch
File bfs_DeviceBlockSize.patch, 2.0 KB (added by , 14 years ago) |
---|
-
src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
87 87 size_t size, struct file_io_vec* vecs, size_t* _count) 88 88 { 89 89 Inode* inode = (Inode*)cookie; 90 return file_map_translate(inode->Map(), offset, size, vecs, _count, 512); 91 // TODO: Use the actual block size of the underlying device for the 92 // alignment! 90 uint32 deviceBlockSize = inode->GetVolume()->BlockSize(); 91 92 return file_map_translate(inode->Map(), offset, size, vecs, _count, 93 deviceBlockSize); 93 94 } 94 95 95 96 -
src/add-ons/kernel/file_systems/bfs/Volume.cpp
344 344 345 345 // check if the device size is large enough to hold the file system 346 346 off_t diskSize; 347 if (opener.GetSize(&diskSize ) != B_OK)347 if (opener.GetSize(&diskSize, &fDeviceBlockSize) != B_OK) 348 348 RETURN_ERROR(B_ERROR); 349 349 if (diskSize < (NumBlocks() << BlockShift())) 350 350 RETURN_ERROR(B_BAD_VALUE); -
src/add-ons/kernel/file_systems/bfs/Volume.h
65 65 off_t FreeBlocks() const 66 66 { return NumBlocks() - UsedBlocks(); } 67 67 68 uint32 DeviceBlockSize() const { return fDeviceBlockSize; } 68 69 uint32 BlockSize() const { return fBlockSize; } 69 70 uint32 BlockShift() const { return fBlockShift; } 70 71 uint32 InodeSize() const … … 141 142 fs_volume* fVolume; 142 143 int fDevice; 143 144 disk_super_block fSuperBlock; 144 145 146 uint32 fDeviceBlockSize; 145 147 uint32 fBlockSize; 146 148 uint32 fBlockShift; 147 149 uint32 fAllocationGroupShift;