changeset 301:7ec574dfe64f

fix readsb
author menikon
date Thu, 30 Jan 2020 14:53:02 +0900
parents edc8e6c71dc6
children bc2f3d24faa9
files src/impl/fs_impl.cbc
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/impl/fs_impl.cbc	Wed Jan 29 22:53:44 2020 +0900
+++ b/src/impl/fs_impl.cbc	Thu Jan 30 14:53:02 2020 +0900
@@ -1,4 +1,7 @@
 #include "../../context.h"
+#include "defs.h"
+#include "fs.h"
+#include "buf.h"
 #interface "fs.dg"
 
 // ----
@@ -39,6 +42,12 @@
 typedef struct superblock superblock;
 __code readsbfs_impl(struct fs_impl* fs, uint dev, struct superblock* sb, __code next(...)) { //:skip
 
+    struct buf* bp;
+
+    bp = bread(dev, 1);
+    memmove(sb, bp->data, sizeof(*sb));
+    brelse(bp);
+
     goto next(...);
 }