File Systems (III)
(Chapters 39-43,45)
CS 4410 Operating Systems
[R. Agarwal, L. Alvisi, A. Bracy, M. George, F.B. Schneider, E. Sirer, R. Van Renesse]
File Systems (III) (Chapters 39-43,45) CS 4410 Operating Systems - - PowerPoint PPT Presentation
File Systems (III) (Chapters 39-43,45) CS 4410 Operating Systems [R. Agarwal, L. Alvisi, A. Bracy, M. George, F.B. Schneider, E. Sirer, R. Van Renesse] File Storage Layout Options Contiguous allocation All bytes together, in order
[R. Agarwal, L. Alvisi, A. Bracy, M. George, F.B. Schneider, E. Sirer, R. Van Renesse]
2
3
4
Dj,0
A0
Dj,1
A1
Dj,2
A2
Dj,3
A3 b[0]:A0 b[1]:A1 b[2]:A2 b[3]:A3 Inode j
Dk,0
A5 b[0]:A5 Inode k
updated every 30 secs. Located at fixed disk address. Also buffered in memory.
5
imap [k...k+N]: A2
CR D
A0
I[k]
b[0]:A0 A1
imap
m[k]:A1 A2
6
imap [k...k+N]: A2
CR D
A0
I[k]
b[0]:A0 A1
imap
m[k]:A1 A2
7
D0
A0
I[k]
b[0]:A0 (garbage)
D0
A4
I[k]
b[0]:A4
D0
A0
I[k]
b[0]:A0 (garbage)
D1
A4 b[0]:A0 b[1]:A4
I[k]
8
D0
A0
I[k]
b[0]:A0 (garbage)
D0
A4
I[k]
b[0]:A4
D0
A0
I[k]
b[0]:A0 (garbage)
D1
A4 b[0]:A0 b[1]:A4
I[k]
update block 0 in file k
9
D0
A0
I[k]
b[0]:A0 (garbage)
D0
A4
I[k]
b[0]:A4
D0
A0
I[k]
b[0]:A0 (garbage)
D1
A4 b[0]:A0 b[1]:A4
I[k]
append block to file k
10
11
12
13 Client Application Client-side File System Networking Layer File Server Networking Layer Disks
14
15
send LOOKUP( roodir FH, “foo”) to NFS server receive FH_for_foo from NFS server
{slot i presumed free} return i
FH := openFileTable[fd].fileHandle send READ( FH, offset=start, count=MAX) to NFS server receive data from NSF server buffer := data;
16
» Requires having a generation number in object.
17
by other clients C’.
at other clients stale. (Server does not know where the file is cached.)
cache could be invalid.
18
19
20
21
» Last writer wins if multiple clients have file open and are updating
» Compare with NFS: updates blocks from different clients.
22
23
24
File System API & Performance Device Access
25