The disk drive provides a method of adaptively managing a cache segment
divided into chunks by defining an unavailable data type to be stored in
an element of a chunk array which indicates that the chunk is not
available, and defining an available data type to be stored in an element
of the chunk array that indicates the chunk is available and that
indicates the number of consecutive chunks that are available. The disk
drive also computes a number of chunks needed to fit the request length
and scans the chunk array to find a first available element whose
available data type meets a predetermined criteria for the number of
chunks needed to fit the request length.