Patent ID: 6961814

Claim:
A disk drive comprising: (a) a disk; (b) a head actuated radially over the disk; (c) a semiconductor memory comprising a cache buffer for caching data written to the disk and data read from the disk, the cache buffer comprising a plurality of cache segments linked together to form a plurality of cache links; and (d) a disk controller for: maintaining at least one segment attribute associated with each cache segment, the segment attribute comprising an allocation state selected from the group consisting of at least: free—an unallocated cache segment; available—an allocated cache segment storing write data that has been written to the disk; valid—an allocated cache segment storing cached read data; and dirty—an allocated cache segment storing write data not yet written to the disk; maintaining at least one link attribute associated with the segment attributes within each cache link; receiving a host command from a host computer, the host command comprising a command size indicating a number of blocks of data associated with the host command; and evaluating the link attributes to allocate cache segments for a cache link associated with the host command.