PURPOSE: A method for operating a disk cache is provided to cache up to a disk data block the size of which is less than a size of a cache line. CONSTITUTION: If a signal requesting disk read/write operation is generated, a data block size of a related disk is compared with a size of a cache line(S210). If a data block size of a disk related thereto is bigger than a size of a cache line, a disk input/output is performed without a cache operation. If a data block size of the disk is not bigger than a size of a cache line, it is detected whether the requested operation is reading or writing(S202). If the requested operation is a disk reading operation, a data reading operation unit(210) decides whether data related to a reading is existed in the current cache memory(S211). If the data related to a reading is existed, a data block of a request size is returned(S213). If the data related to a reading is not existed, a data block as much as the cache line size is read from the disk to a cache memory(S212), and a data block of a request size is returned(S213). If the requested operation is a disk writing operation, a data writing operation unit decides whether data related to writing is existed in the current cache memory(S221). If the data related to writing is existed, a writing operation with respect to the request data block is performed(S224). If the data related to writing is not existed, a size of data block related to writing is compared with a size of cache line(S222). If a size of data block is identified with a size of cache line, a writing operation with respect to the request data block is performed(S224). If a size of data block is not identified with a size of cache line, a disk block as much as the cache line size is read to a cache memory, and a writing operation with respect to the request data block is performed(S224).
展开▼