English

Submitted by: Submitted by

Views: 10

Words: 755

Pages: 4

Category: Business and Industry

Date Submitted: 11/18/2015 12:43 PM

Report This Essay

Throughout the next few assignments, we will be working with a file system format which is specified below. The “file system” is actually created in a number of files named “fusedata.X” and stored on an existing filesystem. The X in the filename corresponds to a simulated “block number” so that if we were to store these files on a block device, fusedata.0 would be in block 0 (sector 0) and fusedata.1 would be in block 1 (sector1). The idea is to simulate working with a block device to store file system data.

We are limited in our block sizes to 4096 bytes, this will not change in the foreseeable future so you can trust this. For now, we will likely use a block device with only 10,000 blocks but this could easily change in the future so you should NOT trust this. We are going to use pointers in a lot of places in the system so I’m going to tell you that a pointer takes up as much as 10 bytes. Which means that the maximum number of pointers you could store in one block is 400 (just trust this for now). All blocks contain text, the only binary data would be the material that is stored in a file.

First, we guarantee that block zero will store the “super block” which tells us about all of the other blocks in the system. The super block has the following format:

{creationTime: 1429434844, mounted: 5, devId:20, freeStart:1, freeEnd:25, root:26, maxBlocks:10000}

Creationtime is the UNIX EPOCH time that the file system was formatted. Mounted is the number of times the file system was mounted. DevID is the type of file system. freeStart is the starting block of the free list (probably 1), and endFree is the ending block. All blocks between freeStart and freeEnd contain the data which make up the free block list. Root is the location of the root directory. MaxBlocks is the number of blocks in the file system. The size of the free block list is directly related to the maxBlocks because we need the ability to indicate that all blocks are free (10000/400=25)....