30.07.2013 Views

Development and Implementation of a File System for Gannet Virtual ...

Development and Implementation of a File System for Gannet Virtual ...

Development and Implementation of a File System for Gannet Virtual ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The next fields are size <strong>and</strong> nlink which store in<strong>for</strong>mation regarding size <strong>of</strong> file in<br />

byte <strong>and</strong> number <strong>of</strong> entries that referenced to the corresponding inode, respectively.<br />

The last three data members are data block management which provides the<br />

connection between the file <strong>and</strong> the location where those bytes reside on ram<br />

memory. It provides a way to map from a logical file position to a file system block<br />

at some location on memory storage. Block_direct is an array <strong>of</strong> pointers to the data<br />

blocks in a file. It contain pointer to the actual data block on memory storage.<br />

There<strong>for</strong>e, it allows inode to keep track the list <strong>of</strong> blocks on actual memory that<br />

belong to a particular file. From high level perspective, a file appears as a contiguous<br />

stream <strong>of</strong> bytes, but on the low level actually the file data is spread over the<br />

memory.<br />

For somewhat larger file, block_indirect1 can be used. This field contains a single<br />

indirect pointer that points to a single indirect block <strong>of</strong> pointers that point to the<br />

actual data block. For bigger file, singe indirect block, block_indirect1, can be<br />

exhausted. To accommodate this kind <strong>of</strong> file, double indirect block block_indirect2<br />

should be used as it is a pointer to a block <strong>of</strong> pointers to pointers to data block. In<br />

other words, it contains two levels <strong>of</strong> pointer be<strong>for</strong>e reaching the actual data block.<br />

Figure 3.3 illustrated how direct <strong>and</strong> indirect blocks reach the data blocks.<br />

However, first <strong>and</strong> higher level index approach has an issue regarding the<br />

per<strong>for</strong>mance aspect. The higher the index level <strong>of</strong> data block, the more time<br />

required <strong>for</strong> accessing data block. Direct block has time per<strong>for</strong>mance O(1) as it<br />

contains the actual data blocks. A single indirect block has per<strong>for</strong>mance OLog(n) as<br />

it points to an index block which contains the addresses <strong>of</strong> actual data. Then, the<br />

double indirect block has the worst per<strong>for</strong>mance, O (nLogn), since <strong>for</strong> accessing a<br />

block would require reading in all index blocks to follow the pointer chain until the<br />

target block finally could be reached. However, the per<strong>for</strong>mance <strong>of</strong> single <strong>and</strong><br />

double indirect block is not worse than linked list allocation.<br />

29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!