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

@ -28,17 +28,17 @@ struct block_device {
size_t lba_start;
struct block_device *part_of; /* if it is a partition */
void *priv;
void *priv;
size_t sg_max_len;
size_t sg_max_segments;
size_t sg_max_len;
size_t sg_max_segments;
struct block_ops ops;
struct disk disk;
};
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);

View file

@ -4,6 +4,6 @@
#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 */

View file

@ -80,7 +80,7 @@ ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_
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) {
offset += dev->lba_start;