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:
Michael Shaw 2023-05-19 16:49:34 -04:00
commit 29a0435cf6
13 changed files with 196 additions and 46 deletions

View file

@ -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);
}