Title: Background: File System Implementation, Disk Access Costs and Free Space Management
1Background File System Implementation, Disk
Access Costs and Free Space Management
2File Names
- Unix
- long file names (255 bytes)
- include special characters
- case sensitive (myshell.c ! Myshell.c)
- MS-DOS
- file name 8 chars, ., 3-char extension
- case insensitive (Grades.txt, grades.txt,
GRADES.txt, all the same file)
3File Attributes
4File Operations(system calls related to files)
- Create
- Delete
- Open
- Close
- Read
- Write
- Append
- Seek
- Get attributes
- Set Attributes
- Rename
- Lock
5Directories
- Each directory is a collection of entries, one
entry per file. Among attributes the address on
disk where the file starts. - Opening a file
- search directory for the corresponding file entry
- Read attributes and disk addresses into the main
memory
6Directory Structure
7A Unix Directory Tree
8Directory Operations
- Create
- Delete
- Opendir
- Closedir
- Readdir
- Rename
- Link
- Unlink
9Moving-head Disk Mechanism
- Disk access costs Transfer time access time
- Access time
- Seek time time to move the disk heads to the
desired cylinder - Rotational latency time for rotating to desired
sector
10Files Contiguous allocation
- (a) Contiguous allocation of disk space for 7
files - (b) State of the disk after files D and E have
been removed
11Files Linked List
The links are on the disk (using block numbers)
12Linked List File Allocation Table
- Keep the list links in a separate table in memory
13i-nodes
14A UNIX i-node
Max file size d direct pointers, n
indirect pointers p/block Blocksize (d n
n2 n3)
15A UNIX V7 directory entry
16Reminder Disk organization in UNIX
17The steps in looking up /usr/ast/mbox
18Disk Space Management
- (a) Storing the free list on a linked list
- (b) A bit map