Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Contigious

on

  • 1,532 views

PPT

PPT

Statistics

Views

Total Views
1,532
Views on SlideShare
1,512
Embed Views
20

Actions

Likes
0
Downloads
14
Comments
0

2 Embeds 20

http://www.ustudy.in 14
http://ustudy.in 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Contigious Presentation Transcript

  • 1. Contiguous Allocation
  • 2. Contiguous Allocation of Disk Space
  • 3. Linked Allocation
  • 4. File-Allocation Table (DOS, others)
    • Section of disk at start of partition
    • Table with one entry per disk block
    • Indexed by block#
    • Each entry contains link to next block
    • Special code for EOF
    • “ 0” means empty block
  • 5. Indexed Allocation
    • Brings all pointers (for one file) together into an index block .
    • Supports both sequential and random access
      • (Index into table, pointer to block)
    • Wasteful for small files (use entire block for index)
      • But no external fragmentation
    • Logical view.
    index table
  • 6. Example of Indexed Allocation
  • 7. Indexed Allocation – Multilevel Index (Supports very large file size)  outer-index index table file
  • 8. Combined Scheme: UNIX inode (Example with 4K bytes per block) 12 link Size:blocks, bytes One inode table per partition 64 bytes per inode Directory entries point to inode Link count Direct index supports 48k file Double indirect supports huge files (>4 GB)
  • 9. Maximum File Size with inodes
    • Assume 12 direct blocks, 4K blocks, 4 byte block pointer
    • Estimate maximum addressable up to the double indirect blocks:
      • Direct blocks (12) 48k
      • Single indirect (4096/4=1024 ptrs to blocks) 4096k
      • Double indirect (1024 of these) 4194304k
      • Total 4198448k
      • (> 4 GB)
        • Didn’t even use triple indirect!
  • 10. File Access With Unix inodes
    • “ Superblock” and other structures not shown
    • “ root” directory is inode #2
    • Directories contain pointers to inodes
    • Access path shown to /usr/bin/wc
    • Notice 8 disk accesses to get first block of wc!
    inodes (root) root directory usr directory bin directory wc (file) Data blocks usr bin wc #2 0 n
  • 11. In-Memory File System Structures Re-Visited: (Unix Case) Opening A file Reading A file inode Copy of inode Pointer to Memory copy Of inode
  • 12. Free-Space Management
    • Bit vector ( n blocks)
    … 0 1 2 n-1 bit[i] =  1  block[i] free 0  block[i] occupied To find a free block: find the first non-zero word, locate first 1-bit. Block number (of first free block) is: (number of bits per word) * (number of 0-value words) + offset of first 1 bit
  • 13. Bit Vector (Cont.)
    • Bit map requires extra space. Example:
    • block size = 2 12 bytes
    • disk size = 2 30 bytes (1 gigabyte)
    • n = 2 30 /2 12 = 2 18 bits (or 32K bytes)
    • Easy to get contiguous files
      • Just look for consecutive 1’s in bit map
  • 14. Linked List of Free Space on Disk
  • 15. Free List Approach
    • Linked list
      • Hard to find contiguous space easily
      • But no waste of space
    • Grouping
      • Store addresses of n free blocks in the first block
      • Last of these addresses is to a block that contains addresses of another n free blocks
      • So many free blocks can be found at one time
    • Counting
      • Clusters of contiguous free blocks recorded together
      • Keep list of first block address , count of contiguous free ones