add btrie_map() for allocating free slot, remove isrm
[lunaix-os.git] / lunaix-os / includes / lunaix / block.h
index 0ddd00058cb585a22fdf6b17095d26582c85b00c..075ed3783ff92875b6e0b4c50cc89ff480427865 100644 (file)
@@ -31,6 +31,7 @@ struct block_dev
     u64_t end_lba;
     u32_t blk_size;
     struct block_dev_ops ops;
+    struct devclass* class;
 };
 
 // Lunaix Partition Table
@@ -47,6 +48,12 @@ typedef u64_t partition_t;
 typedef u32_t bdev_t;
 typedef void (*devfs_exporter)(struct block_dev* bdev, void* fsnode);
 
+static inline struct block_dev*
+block_dev(struct device* dev) 
+{
+    return (struct block_dev*)dev->underlay;
+}
+
 void
 block_init();