MAGNETIC DISK DEVICE AND COMMAND EXECUTION METHOD FOR MAGNETIC DISK DEVICE
According to one embodiment, a magnetic disk device includes a receiver, an encrypting-and-decrypting module, a read-and-write controller, a setting module, an order controller, an executing module. The receiver receives a command to write data to or read data from a recording medium segmented into a plurality of storage areas each corresponding to an encryption key. The command causes an access to at least one of the storage areas. The encrypting-and-decrypting module encrypts the data or decrypts the data using the encryption key. The read-and-write controller controls writing the data to the recording medium and reading data therefrom. The setting module sets the encryption key corresponding to the storage area accessed by the command to the encrypting-and-decrypting module. The order controller controls the execution order in which commands are executed and brings up the execution order of the command causing an access to the storage area. The executing module executes the commands in the execution order.
1 . A magnetic disk device comprising:
a receiver configured to receive a command from an information processor, the command instructing to write data to a recording medium, or to read data from the recording medium, the recording medium being segmented into a plurality of storage areas, each corresponding to an encryption key generated from identification information associated with a user and causing an access to at least one of the storage areas;
an encrypting-and-decrypting module configured to encrypt the data in response to the command instructing to write or to decrypt the encrypted data in response to the command instructing to read using the encryption key;
a read-and-write controller configured to control writing the encrypted data to the recording medium and reading data from the recording medium;
a setting module configured to set the encryption key corresponding to the storage area accessed by the command to the encrypting-and-decrypting module according to execution of the command;
an order controller configured to control an order of executions and to prioritize the command causing an access to the storage area corresponding to the encryption key among the commands yet to be executed; and
an executing module configured to execute the commands in the execution order.
2 . The magnetic disk device of claim 1 , wherein the order controller is configured to detect an encryption key that is expected to be set to the encrypting-and-decrypting module upon completion of execution of a currently executed command, and to prioritize a command that causes an access to a storage area corresponding to the encryption key detected among the commands yet to be executed.
3 . The magnetic disk device of claim 1 , wherein the order controller is configured to prioritize the command that does not cause a change in encryption key setting while executed among the commands yet to be executed.
4 . The magnetic disk device of claim 1 , wherein the order controller is configured to detect an encryption key that is expected to be set to the encrypting-and-decrypting module upon completion of execution of the currently executed command, and to prioritize a command that causes an access to a storage area corresponding to the encryption key detected and causes changes in encryption key setting while executed among the commands yet to be executed.
5 . The magnetic disk device of claim 1 , further comprising a dividing module configured to divide a command, which is yet to be executed and causes different encryption keys to be set while executed, for the different encryption keys.
6 . The magnetic disk device of claim 1 , wherein, the order controller is configured to wait until a command causing an access to the storage area is received from the information processor and, upon receiving the command, to assign a first order of execution to the command, when a command which causes an access to the storage area corresponding to the encryption key is not set to the encrypting-and-decrypting module.
7 . A command execution method for a magnetic disk device comprising:
receiving a command from an information processor, the command instructing to write data to a recording medium or to read data from the recording medium, the recording medium being segmented into a plurality of storage areas each corresponding to an encryption key generated from identification information associated with a user and causing an access to at least one of the storage areas;
encrypting the data in response to the command to write or decrypting the encrypted data in response to the command to read using the encryption key;
controlling writing the data encrypted by an encrypting-and-decrypting module to the recording medium and reading data from the recording medium;
setting the encryption key corresponding to the storage area accessed by the command to the encrypting-and-decrypting module according to execution of the command;
an order controller controlling an order of executions and to prioritize the command causing an access to the storage area corresponding to the encryption key among the commands yet to be executed; and
an executing module executing the commands in the execution order.
8 . The command execution method of claim 7 , further comprising detecting an encryption key that is expected to be set to the encrypting-and-decrypting module upon completion of execution of a currently executed command, and prioritizing a command that causes an access to a storage area corresponding to the encryption key detected among the commands yet to be executed.
9 . The command execution method of claim 7 , further comprising prioritizing the command that does not cause a change in encryption key setting while executed among the commands yet to be executed.
10 . The command execution method of claim 7 , further comprising detecting an encryption key that is expected to be set to the encrypting-and-decrypting module upon completion of execution of the currently executed command, and prioritizing a command that causes an access to a storage area corresponding to the encryption key detected and causes a substantially small number of changes in encryption key setting while executed among the commands yet to be executed.
11 . The command execution method of claim 7 , further comprising dividing a command, which is yet to be executed and causes different encryption keys to be set while executed, for the different encryption keys.
12 . The command execution method of claim 7 , further comprising, waiting until a command causing an access to the storage area is received from the information processor and, upon receiving the command, assigning a first order of execution to the command, when a command which causes an access to the storage area corresponding to the encryption key is not set to the encrypting-and-decrypting module.