feat: mount point flags check
[lunaix-os.git] / lunaix-os / kernel / block.c
index d88017da73198d73a9be3a49035c73c4521dad59..b855910ffc18fc12a1506e105540dda74fc62964 100644 (file)
@@ -39,10 +39,7 @@ block_init()
 }
 
 int
-__block_read(struct device* dev,
-             void* buf,
-             unsigned int offset,
-             unsigned int len)
+__block_read(struct device* dev, void* buf, size_t offset, size_t len)
 {
     int errno;
     struct block_dev* bdev = (struct block_dev*)dev->underlay;
@@ -72,10 +69,7 @@ error:
 }
 
 int
-__block_write(struct device* dev,
-              void* buf,
-              unsigned int offset,
-              unsigned int len)
+__block_write(struct device* dev, void* buf, size_t offset, size_t len)
 {
     int errno;
     struct block_dev* bdev = (struct block_dev*)dev->underlay;
@@ -134,7 +128,7 @@ __block_register(struct block_dev* bdev)
         return 0;
     }
 
-    struct device* dev = device_add(NULL, bdev, "sd%c", 'a' + free_slot);
+    struct device* dev = device_addvol(NULL, bdev, "sd%c", 'a' + free_slot);
     dev->write = __block_write;
     dev->read = __block_read;