US 12,254,221 B2
Magnetic disk apparatus and method
Keigo Sogabe, Chigasaki Kanagawa (JP)
Assigned to Kabushiki Kaisha Toshiba, Tokyo (JP); and Toshiba Electronic Devices & Storage Corporation, Tokyo (JP)
Filed by KABUSHIKI KAISHA TOSHIBA, Tokyo (JP); and TOSHIBA ELECTRONIC DEVICES & STORAGE CORPORATION, Tokyo (JP)
Filed on Sep. 6, 2022, as Appl. No. 17/903,905.
Claims priority of application No. 2022-045009 (JP), filed on Mar. 22, 2022.
Prior Publication US 2023/0305758 A1, Sep. 28, 2023
Int. Cl. G06F 3/00 (2006.01); G06F 3/06 (2006.01); G06F 12/02 (2006.01); G11C 11/401 (2006.01); G11C 11/56 (2006.01); G11C 16/06 (2006.01)
CPC G06F 3/0676 (2013.01) [G06F 12/0246 (2013.01); G11C 11/401 (2013.01); G11C 11/5642 (2013.01); G11C 16/06 (2013.01); G06F 2212/2022 (2013.01); G11C 2211/5647 (2013.01)] 3 Claims
OG exemplary drawing
 
1. A magnetic disk apparatus connectable to a host device, the magnetic disk apparatus comprising:
a magnetic disk;
a flash memory including memory cell transistors, each of the memory cell transistors storing one of first and second values;
a volatile memory configured to temporarily hold first data received from the host device until data corresponding to the first data is written onto the magnetic disk; and
a controller configured to
when a power loss occurs,
perform bit inversion of the first data held in the volatile memory and write bit-inverted data of the first data as second data onto the flash memory in a case where a number of the first values in the first data is larger than a number of the second values in the first data, but not all values of the first data are the first values,
write the first data as third data onto the flash memory without performing bit inversion in a case where the number of the first values in the first data is smaller than the number of the second values in the first data, but not all values of the first data are the second values,
write, onto the flash memory, first information indicating whether the number of the first values in the first data is larger or smaller than the number of the second values in the first data, and
in a case where the first data exclusively includes the first values or exclusively includes the second values, write onto the flash memory second information indicating that the first data exclusively includes the first values or exclusively includes the second values without writing the second data or the third data onto the flash memory, and
when power supply is resumed after the power loss,
perform the bit inversion of the second data written onto the flash memory and write bit-inverted data of the second data onto the magnetic disk in a case where the second information is not written onto the flash memory and the first information indicates that the number of the first values in the first data is larger than the number of the second values in the first data,
write the third data onto the magnetic disk without performing bit inversion in a case where the second information is not written onto the flash memory and the first information indicates that the number of the first values in the first data is smaller than the number of the second values in the first data,
generate data exclusively including the first values as fourth data and write the fourth data onto the magnetic disk, in a case where the second information is written onto the flash memory and the first information indicates that the number of the first values in the first data is larger than the number of the second values in the first data, and
generate data exclusively including the second values as fifth data and write the fifth data onto the magnetic disk, in a case where the second information is written onto the flash memory and the first information indicates that the number of the first values in the first data is smaller than the number of the second values in0 the first data.