MECH 2301 Lecture 27: MECH 2301 Lecture 27 Notes
MECH 2301 Lecture 27 Notes
Introduction
Multi-Block Readings
• The file manager can simply request a multi-block read and read the entire file in one
pass.
• Relative file access is also straightforward: the correct block can be determined easily
from the formula shown and then added to the pointer value that locates the beginning
of the file.
• There are some important difficulties with contiguous storage allocation, however.
• The file system must find a space large enough to hold the file plus its anticipated
growth.
• Unless sufficient space is allocated initially, the file may grow to exceed the capacity of
its storage allocation.
• In this case, the file may have to be moved to another area, or other files rearranged to
make expanded room for the enlarged file.
• The use of contiguous storage allocation eventually leads to fragmentation of the disk.
• As files come and go there will occur small block areas between files
• None large enough to hold a new file unless the new file is small
• Fragmentation also occurs when a file is deleted or moved.
• Unless the space can be filled with a new file of the same size, there will be a space left
over.
• Finding an exact replacement is unlikely
• Files are rarely exactly the same size, file space may be limited, a new, smaller file needs
to be stored, and there is no alternative space available, so the space is used.
• Allocation strategies can be used to try to minimize fragmentation.
• The first-fit strategy simply places the file into the first available space that the system
finds.
find more resources at oneclass.com
find more resources at oneclass.com