Chapter 40, file-implementation.pdf Figure 40.4: the first read of the bar inode is not needed; since the file is being created, the original inode contents are irrelevant. homework/file-implementation/README.md Example reference count for root directory should be 3, not 6: *** ORIG/README.md 2021-03-01 13:09:07.000000000 -0500 --- README.md 2021-06-04 16:19:49.618657707 -0400 *************** *** 77,83 **** ```sh inode bitmap 11110000 ! inodes [d a:0 r:6] [f a:1 r:1] [f a:-1 r:1] [d a:2 r:2] [] ... data bitmap 11100000 data [(.,0) (..,0) (y,1) (z,2) (f,3)] [u] [(.,3) (..,0)] [] ... ``` --- 77,83 ---- ```sh inode bitmap 11110000 ! inodes [d a:0 r:3] [f a:1 r:1] [f a:-1 r:1] [d a:2 r:2] [] ... data bitmap 11100000 data [(.,0) (..,0) (y,1) (z,2) (f,3)] [u] [(.,3) (..,0)] [] ... ``` homework/file-implementation/vsfs.py When writing data, should show the data value, otherwise can't answer the question: % python ./vsfs.py.ORIG -r -s 1 ... fd=open("/n/x", O_WRONLY|O_APPEND); write(fd, buf, BLOCKSIZE); close(fd); State of file system (inode bitmap, inodes, data bitmap, data)? ... % python ./vsfs.py -r -s 1 ... fd=open("/n/x", O_WRONLY|O_APPEND); write(fd, "o", BLOCKSIZE); close(fd); State of file system (inode bitmap, inodes, data bitmap, data)? ... Answer for data in above example needs to know that "o" was written: data [(.,0) (..,0) (n,1)] [(.,1) (..,0) (x,2)] [o] [] [] [] [] [] ---------------------------------------------------------^ fix: % diff vsfs.py.ORIG vsfs.py 392c392 < print('fd=open("%s", O_WRONLY|O_APPEND); write(fd, buf, BLOCKSIZE); close(fd);' % tfile) --- > print('fd=open("%s", O_WRONLY|O_APPEND); write(fd, "%c", BLOCKSIZE); close(fd);' % (tfile,data)) e %