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 17<br />

Indirect <strong>File</strong> Index<br />

(per disk)<br />

section# => disk block #<br />

0<br />

1<br />

n<br />

<strong>File</strong> Indices<br />

(per disk)<br />

file # => disk block #<br />

m<br />

0<br />

1<br />

n<br />

file # => disk block #<br />

Figure 3.2: Indices.<br />

Block Indices<br />

(per file)<br />

file block # => disk block #<br />

0<br />

1<br />

n<br />

0<br />

1<br />

n<br />

start<br />

block<br />

num<br />

blocks<br />

etc...<br />

R<strong>and</strong>om−Access<br />

Extent−Based<br />

location <strong>of</strong> all file index blocks. The indirect file index resides in a meta-data structure called <strong>the</strong> superblock,<br />

which occupies exactly one physical disk block at a well-known, fixed location.<br />

The layout <strong>of</strong> <strong>the</strong> meta-data on disk is shown in Figure 3.2. To obtain <strong>the</strong> block index <strong>of</strong> file #N, <strong>the</strong><br />

following calculations are done. Using st<strong>and</strong>ard C <strong>and</strong> C library terminology:<br />

• Let A = floor(N / # <strong>of</strong> file index blocks)<br />

• Let B = N % # <strong>of</strong> file index blocks<br />

By looking up <strong>the</strong> A th entry in <strong>the</strong> indirect file index, <strong>the</strong> appropriate file index block is found. By<br />

looking up <strong>the</strong> B th entry in that file index block, <strong>the</strong> block index <strong>of</strong> file #N is obtained.<br />

Under <strong>the</strong> “block indices” column <strong>of</strong> <strong>the</strong> diagram, two types <strong>of</strong> block indices are shown for two different<br />

types <strong>of</strong> files, r<strong>and</strong>om-access <strong>and</strong> extent-based. An extent-based file allocates physical disk blocks in contigu-<br />

ous groups called extents. An extent is specified by its starting block <strong>and</strong> <strong>the</strong> number <strong>of</strong> blocks it occupies.<br />

HFS supports o<strong>the</strong>r file types <strong>and</strong> <strong>the</strong>se all have <strong>the</strong>ir own unique block index structure. O<strong>the</strong>r supported file<br />

types, not shown in <strong>the</strong> figure, include sparse-data, small-data, fixed-sized record-store, striped, replicated,<br />

distribution, checkpoint, parity, <strong>and</strong> application-specific distribution. Details <strong>of</strong> <strong>the</strong>se file types can be found<br />

in [34].

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

Saved successfully!

Ooh no, something went wrong!