Debug code to see remote kmsgs
[akaros.git] / kern / src / kfs.c
index 14fea7b..c5e876c 100644 (file)
@@ -137,24 +137,21 @@ int kfs_readpage(struct page_map *pm, struct page *page)
                memset(page2kva(page) + copy_amt, 0, PGSIZE - copy_amt);
        }
        struct buffer_head *bh = kmem_cache_alloc(bh_kcache, 0);
-       if (!bh) {
-               unlock_page(page);
+       if (!bh)
                return -1;                      /* untested, un-thought-through */
-       }
        /* KFS does a 1:1 BH to page mapping */
        bh->bh_page = page;                                                             /* weak ref */
        bh->bh_buffer = page2kva(page);
        bh->bh_flags = 0;                                                               /* whatever... */
        bh->bh_next = 0;                                                                /* only one BH needed */
        bh->bh_bdev = pm->pm_host->i_sb->s_bdev;                /* uncounted */
-       bh->bh_blocknum = page->pg_index;
-       bh->bh_numblock = 1;                                                    /* sector size = PGSIZE */
+       bh->bh_sector = page->pg_index;
+       bh->bh_nr_sector = 1;                                                   /* sector size = PGSIZE */
        page->pg_private = bh;
        /* This is supposed to be done in the IO system when the operation is
         * complete.  Since we aren't doing a real IO request, and it is already
         * done, we can do it here. */
        page->pg_flags |= PG_UPTODATE;
-       unlock_page(page);
        return 0;
 }
 
@@ -916,7 +913,7 @@ void parse_cpio_entries(struct super_block *sb, void *cpio_b)
                }
                c_bhdr->c_filename = (char*)c_hdr + sizeof(*c_hdr);
                namesize = cpio_strntol(buf, c_hdr->c_namesize, 8);
-               printd("Namesize: %d\n", size);
+               printd("Namesize: %d\n", namesize);
                if (!strcmp(c_bhdr->c_filename, "TRAILER!!!"))
                        break;
                c_bhdr->c_ino = cpio_strntol(buf, c_hdr->c_ino, 8);