I was reading the design of unix OS by Maurice J bach and had a confusion.
Suppose a process requests for a buffer for disk block number 18. The kernel searches for a free buffer from the free list. Let the first buffer (say buffer for block number 5) in the free list be marked as delayed write. (hash function for hash queue=disk-block-number % 4)
What will the kernel do from here onwards?
From my understanding, the kernel will start writing the buffer with block number 5 to the disk, allocate the next buffer in the free list to the current process and reassign it to the correct hash queue. The free list header will be adjusted to point to the next buffer in the free list after the one which is recently allocated. (assuming the free list follows the least recently used algorithm)
Is this correct?