To ensure cache coherence when multiple clients access a data block, you must support locking for access to the data blocks. Therefore, you should use the appropriate synchronization primitives to avoid race conditions while accessing the Logical Disk. The necessity for data access through locking will become clearer during the second phase. Acquires a read lock on blk and returns a pointer to the block in the local cache. Unlocks a previously locked block.
Forces blk to disk.
The local cache is a write-back cache, and dirty blocks are ordinarily flushed to disk when they are evicted from the cache by the cache replacement policy. Unmaps addr from its corresponding block. In all the cached states, a block can be either clean or dirty. Mapped blocks are never locked as they can be either uncached or cached unlocked. Replacement in the buffer cache can be performed only on unlocked blocks.