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

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

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

CHAPTER 3. HFS ARCHITECTURE 25<br />

Block cache entry<br />

Directory content<br />

1. 2. 3.<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

¦¦¦¦¦¦¦¦<br />

disk<br />

ORS cache entry<br />

Partial block index<br />

<strong>of</strong> directory<br />

For loading <strong>of</strong> ORS cache entry,<br />

see trace <strong>of</strong> getAttribute() diagram.<br />

Block cache entry<br />

Complete block index<br />

<strong>of</strong> directory<br />

Figure 3.8: Cache trace <strong>of</strong> path name lookup.<br />

block numbers. It identifies <strong>the</strong> disk block that contains <strong>the</strong> packed data <strong>and</strong> allows it to be loaded<br />

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

4. If <strong>the</strong> block index is not found, <strong>the</strong> block cache is searched a third time but for <strong>the</strong> file index. The file<br />

index identifies <strong>the</strong> disk block that contains <strong>the</strong> block index <strong>of</strong> <strong>the</strong> packed data file <strong>and</strong> allows it to be<br />

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

5. If <strong>the</strong> file index cannot be found, <strong>the</strong> indirect file index in <strong>the</strong> superblock is consulted, which is always<br />

resident in memory. At this point in <strong>the</strong> call chain, <strong>the</strong> execution is reversed <strong>and</strong> <strong>the</strong> missing block<br />

cache <strong>and</strong> ORS cache entries are filled from disk. The indirect file index leads to <strong>the</strong> direct file index,<br />

which leads to <strong>the</strong> block index <strong>of</strong> <strong>the</strong> packed data file. The packed data block cache is filled <strong>and</strong> <strong>the</strong><br />

ORS cache extracts <strong>the</strong> packed data from <strong>the</strong> block cache to fill <strong>the</strong> ORS cache entry. The ORS cache<br />

now contains <strong>the</strong> attributes <strong>of</strong> <strong>the</strong> target file.<br />

The general idea is that in <strong>the</strong> common case, meta-data is in <strong>the</strong> caches <strong>and</strong> that is why <strong>the</strong> caches are<br />

always checked first. If <strong>the</strong> meta-data is not found in <strong>the</strong> cache, it is placed into <strong>the</strong> cache by following<br />

<strong>the</strong> meta-data chain <strong>and</strong> using that information to access <strong>the</strong> disk. This is a recursive process that repeats<br />

as necessary. The read <strong>and</strong> write file system operations interact with <strong>the</strong> cache system in a similar fashion<br />

using steps 3, 4, <strong>and</strong> 5.<br />

3.6.2 Path Name Lookup<br />

The path name lookup operation returns a file token identifier for a given path name, such as /usr/bin/diff.<br />

The file token, which is similar to an inode number under Berkeley FFS, allows for easy identification <strong>of</strong> <strong>the</strong><br />

target file by <strong>the</strong> file system <strong>and</strong> is used by clients to identify specific files. The token is a concatenation <strong>of</strong><br />

<strong>the</strong> file number, file type, <strong>and</strong> disk number. The root directory is a well-known file token <strong>and</strong> this is where<br />

<strong>the</strong> operation begins. The task involves tracing <strong>the</strong> path name recursively by using <strong>the</strong> file token <strong>of</strong> <strong>the</strong><br />

disk

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

Saved successfully!

Ooh no, something went wrong!