Skip to content

Commit

Permalink
Improved checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert van Renesse committed Mar 27, 2024
1 parent 19c1d74 commit 1742f36
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/file_btest.hny
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from file import *

const N_FILES = 2
const N_FILES = 3
const MAX_FILE_SIZE = 2

const N_READ = 1
Expand Down
4 changes: 2 additions & 2 deletions code/file_inode.hny
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ from alloc import * # malloc/free
from list import subseq # list slicing
import wal # disk with a write-ahead-log

const N_BLOCKS = 10 # total number of disk blocks
const INODES_PER_BLOCK = 1 # number of inodes that fit in a block
const N_BLOCKS = 12 # total number of disk blocks
const INODES_PER_BLOCK = 2 # number of inodes that fit in a block
const INDIR_PER_BLOCK = 4 # number of block pointers per block

#/ FREELIST
Expand Down
8 changes: 4 additions & 4 deletions code/wal.hny
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from alloc import malloc

const BITS_PER_BLOCK = 16
const BITS_PER_BLOCK = 3

def new(n_blocks) returns wal:
wal = malloc([ None, ] * n_blocks)

def getsize(wal) returns size:
atomically size = len !wal
size = len !wal

def read(wal, bno) returns block:
atomically block = (!wal)[bno]
block = (!wal)[bno]

def write(wal, bno, block):
atomically (!wal)[bno] = block
(!wal)[bno] = block

def txbegin(wal, id):
pass
Expand Down

0 comments on commit 1742f36

Please sign in to comment.