# HG changeset patch # User menikon # Date 1580363582 -32400 # Node ID 7ec574dfe64fee954468f0cbeb807d5bdb724a23 # Parent edc8e6c71dc6a99025964965adf39784af9e5104 fix readsb diff -r edc8e6c71dc6 -r 7ec574dfe64f src/impl/fs_impl.cbc --- 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(...); }