slab: replace struct slab with slab_t
This type should never be modified by the user, and only passed into the functions in slab.c. Using a typedef to notifies the user semantically of this fact
This commit is contained in:
parent
0395b65ad8
commit
29a0435cf6
13 changed files with 196 additions and 46 deletions
10
fs/block.c
10
fs/block.c
|
|
@ -40,7 +40,17 @@ inline int block_read(struct block_device *bdev, void *buf, size_t offset, size_
|
|||
return bdev->ops.read(bdev, buf, offset, size);
|
||||
}
|
||||
|
||||
inline int block_readp(struct block_part *part, void *buf, size_t offset, size_t size)
|
||||
{
|
||||
return part->bdev->ops.read(part->bdev, buf, part->lba_start + offset, size);
|
||||
}
|
||||
|
||||
inline int block_write(struct block_device *bdev, void *buf, size_t offset, size_t size)
|
||||
{
|
||||
return bdev->ops.write(bdev, buf, offset, size);
|
||||
}
|
||||
|
||||
inline int block_writep(struct block_part *part, void *buf, size_t offset, size_t size)
|
||||
{
|
||||
return part->bdev->ops.write(part->bdev, buf, part->lba_start + offset, size);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue