Free space can
be maintained likewise in a linked list of blocks.
CHAP. 6] OPERATING SYSTEMS 123
There are some disadvantages of linked allocation. First, access to random records in the file is not possible
directly. If an application needs the 57th record in a file using linked allocation, the system will have to read
through the first 56 records to get to the 57th. It??™s also true that the pointers take up some space in the file
system; that??™s overhead, although bits on the disk are cheap these days. Finally, if the blocks of a file really are
scattered all over the disk, accessing the file contents will be slowed by all the mechanical delays of
positioning the read/write heads again and again.
Windows uses linked file allocation, and the ???defragmentation??? exercise brings the dispersed blocks of files
together so that access will be faster. When the linked blocks are in fact adjacent to one another, reads and writes
occur faster.
A third approach to file allocation is indexed allocation, championed by UNIX. With indexed allocation,
the file directory entry has pointers to the blocks containing the information in the file. The blocks need not be
contiguous, and files can be extended by adding blocks at any time.
Pages:
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343