28.07.2013 Views

Performance Analysis and Optimization of the Hurricane File System ...

Performance Analysis and Optimization of the Hurricane File System ...

Performance Analysis and Optimization of the Hurricane File System ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 3. HFS ARCHITECTURE 26<br />

current path component, such as /, to extract <strong>the</strong> subsequent file token <strong>of</strong> <strong>the</strong> next path component, such<br />

as /usr/. The caches are accessed as follows (Figure 3.8):<br />

1. The directory contents <strong>of</strong> <strong>the</strong> current path component is acquired from <strong>the</strong> block cache. The directory<br />

contents may occupy several block cache entries <strong>and</strong> each one is searched until <strong>the</strong> path name component<br />

is found or until <strong>the</strong> end <strong>of</strong> <strong>the</strong> directory contents is reached.<br />

2. If a directory block is not found in <strong>the</strong> block cache, <strong>the</strong> ORS cache is searched for <strong>the</strong> partial directory<br />

block index. If <strong>the</strong> ORS cache entry cannot be found, <strong>the</strong> procedure for ORS cache miss h<strong>and</strong>ling is<br />

similar to <strong>the</strong> previous description <strong>of</strong> <strong>the</strong> getAttribute() file system call. The partial directory block<br />

index indicates <strong>the</strong> disk block <strong>of</strong> <strong>the</strong> desired directory block <strong>and</strong> allows it to be loaded from disk into<br />

<strong>the</strong> block cache.<br />

3. If <strong>the</strong> complete directory block index is required, <strong>the</strong> block cache is searched. If <strong>the</strong> index cannot be<br />

found, is it loaded from disk <strong>and</strong> placed into <strong>the</strong> block cache. The target disk block, which contains <strong>the</strong><br />

complete directory block index, is indicated in <strong>the</strong> very last entry <strong>of</strong> <strong>the</strong> partial directory block index.<br />

Once loaded into <strong>the</strong> block cache, <strong>the</strong> complete index can be used to load <strong>the</strong> appropriate directory<br />

content block from disk into <strong>the</strong> block cache.<br />

The above steps are repeated recursively for each component <strong>of</strong> <strong>the</strong> directory path until <strong>the</strong> path name is<br />

resolved <strong>and</strong> <strong>the</strong> final target file token is found. The getDents() file system call, which returns <strong>the</strong> contents<br />

<strong>of</strong> a directory ra<strong>the</strong>r than <strong>the</strong> file token <strong>of</strong> a particular file <strong>of</strong> directory, interacts with <strong>the</strong> cache system in a<br />

similar fashion.<br />

The getAttribute() <strong>and</strong> path name lookup operations cover most <strong>of</strong> <strong>the</strong> important code paths <strong>and</strong> <strong>the</strong>ir<br />

traces have demonstrated <strong>the</strong> role <strong>of</strong> <strong>the</strong> meta-data caches <strong>and</strong> <strong>the</strong> general operation <strong>of</strong> HFS.

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

Saved successfully!

Ooh no, something went wrong!