summaryrefslogtreecommitdiff
path: root/kernel/fs/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/mount.c')
-rw-r--r--kernel/fs/mount.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/fs/mount.c b/kernel/fs/mount.c
index 9cdf49b..e4d3636 100644
--- a/kernel/fs/mount.c
+++ b/kernel/fs/mount.c
@@ -7,15 +7,17 @@ struct super_block sblocks[NRSUPER];
void mount_root(void) {
int ret;
- char buf[BLOCK_SIZE];
- struct super_block *s = (void*) buf;
+ struct buffer *b;
+ struct super_block *s;
- ret = block_read(buf, 1);
- if(ret < 0) {
+ b = buffer_get_block(1, 1);
+ if(!b) {
printk("[fs] Failed to read super block\n");
return;
}
+ s = b->b_data;
+
if(s->s_magic != SUPER_MAGIC) {
printk("[fs] Invalid magic number in super block!\n");
return;
@@ -31,5 +33,5 @@ void mount_root(void) {
printk(" Max file size: 0x%01x\n", s->s_max_size);
/* copy the super block into the table */
- memcpy(sblocks, buf, ((unsigned) &s->s_imap - (unsigned) s));
+ memcpy(sblocks, s, ((unsigned) &s->s_imap - (unsigned) s));
}