Reading A File From Disk
In this simple example, let us first assume that you want to simply open
a file (e.g., /foo/bar, read it, and then close it. For this simple example,
let’s assume the file is just 4KB in size (i.e., 1 block).
When you issue an open("/foo/bar", O RDONLY) call, the file sys-
tem first needs to find the inode for the file bar, to obtain some basic in-
formation about the file (permissions information, file size, etc.). To do so,
O
PERATING
S
YSTEMS
[V
ERSION
0.80]
WWW
.
OSTEP
.
ORG
F
ILE
S
YSTEM
I
MPLEMENTATION
471
data
inode
root
foo
bar
root foo
bar
bar
bar
bitmap bitmap inode inode inode data data data[0] data[1] data[1]
Do'stlaringiz bilan baham: |