Patent ID: 6405295
Filing Date: 2002-06-11
Classification: G06F

Abstract:
A data storage apparatus comprising:a main memory portion divided into a plurality of blocks having a plurality of sectors and storing user data in units of sectors; an address information storage portion operative to store address information and to convert a logical block addresses to a physical block addresses of said main memory portion; a flag storage portion operative to store flags, said flags being used for differentiating among used blocks, unused blocks that do not contain said user data, and unused blocks that do contain said user data; a control circuit operative to convert an externally input logical address to said logical block address and sector address each time said user data is written to said sector, and executing processes (i) to (iii) when said physical block address corresponding to said logical block address is not registered in said address information, and executing processes (iv) to (vi) when said physical block address corresponding to said logical block address is registered in said address information: (i) selecting one of said unused blocks using said flag; (ii) when said user data are not stored in the selected unused block, writing said user data to the sector corresponding to said sector address located in said selected unused block; and when said user data are stored in said selected unused block, writing said user data to the sector corresponding to said sector address located in said selected unused block, after deleting all data in said selected unused block; (iii) registering the physical block address of said selected unused block in the field of said logical block address in said address information, and changing said flag for said selected unused block to a flag indicating a used block; (iv) selecting any of said unused blocks using said flag; (v) when said user data are not stored in said selected unused block, writing said user data to the sector corresponding to said sector address and located in said selected unused block, then transferring user data in other sectors from said block corresponding to said registered physical block address; when said user data are stored in said selected unused block, deleting all data in said selected unused block, writing said user data to the sector corresponding to said sector address and located in said selected unused block, and copying user data in other sectors from said block corresponding to said registered physical block address; and (vi) changing said flag for said block corresponding to said registered physical block address to a flag indicating an unused block wherein said user data are stored; registering the physical block address of said selected unused block in the field of said logical block address of said address table; and changing said flag for said selected unused block to a flag indicating a used block.