add btrie_map() for allocating free slot, remove isrm
[lunaix-os.git] / lunaix-os / includes / lunaix / block.h
index c574dd346d32e9d789b3f29680530e1af3e39047..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
@@ -44,9 +45,15 @@ struct lpt_header
 } __attribute__((packed));
 
 typedef u64_t partition_t;
-typedef uint32_t bdev_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();