block: make write buf const

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-19 20:38:25 -04:00
commit be701fdd0b
3 changed files with 6 additions and 6 deletions

View file

@ -38,7 +38,7 @@ struct block_device {
}; };
ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_blocks); ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_blocks);
ssize_t block_write(struct block_device *dev, char *buf, size_t offset, size_t n_blocks); ssize_t block_write(struct block_device *dev, const char *buf, size_t offset, size_t n_blocks);
int block_check_partitions(struct block_device *bdev); int block_check_partitions(struct block_device *bdev);

View file

@ -4,6 +4,6 @@
#include <kernel/types.h> #include <kernel/types.h>
void cache_flush_range(void *addr, size_t len); void cache_flush_range(const void *addr, size_t len);
#endif /* _CACHE_H */ #endif /* _CACHE_H */

View file

@ -80,7 +80,7 @@ ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_
return ret; return ret;
} }
ssize_t block_write(struct block_device *dev, char *buf, size_t offset, size_t n_blocks) ssize_t block_write(struct block_device *dev, const char *buf, size_t offset, size_t n_blocks)
{ {
while (dev->part_of) { while (dev->part_of) {
offset += dev->lba_start; offset += dev->lba_start;