U.S. patent application number 13/608086 was filed with the patent office on 2013-09-19 for controller, data storage device, and computer program product.
This patent application is currently assigned to Kabushiki Kaisha Toshiba. The applicant listed for this patent is Kazuhiro FUKUTOMI, Shinichi Kanno. Invention is credited to Kazuhiro FUKUTOMI, Shinichi Kanno.
Application Number | 20130246721 13/608086 |
Document ID | / |
Family ID | 49158790 |
Filed Date | 2013-09-19 |
United States Patent
Application |
20130246721 |
Kind Code |
A1 |
FUKUTOMI; Kazuhiro ; et
al. |
September 19, 2013 |
CONTROLLER, DATA STORAGE DEVICE, AND COMPUTER PROGRAM PRODUCT
Abstract
According to an embodiment, a controller includes a write
control unit configured to make a control that converts data
requested to be written by an external device into pieces of
cluster data with a size of a cluster of a storage medium,
compresses each piece of cluster data, determines a corresponding
physical address of a write destination in the storage medium
according to a predetermined rule, and writes the compressed pieces
of cluster data to the storage medium using the physical address of
the write destination. The write control unit also makes a control
that writes a correspondence between the physical address and a
corresponding logical address to a storage unit. The controller
also includes a read control unit configured to a control that
reads a piece of cluster data from the storage medium using an
acquired physical address, and decompresses the read piece of
cluster data.
Inventors: |
FUKUTOMI; Kazuhiro;
(Kanagawa, JP) ; Kanno; Shinichi; (Tokyo,
JP) |
|
Applicant: |
Name |
City |
State |
Country |
Type |
FUKUTOMI; Kazuhiro
Kanno; Shinichi |
Kanagawa
Tokyo |
|
JP
JP |
|
|
Assignee: |
Kabushiki Kaisha Toshiba
Tokyo
JP
|
Family ID: |
49158790 |
Appl. No.: |
13/608086 |
Filed: |
September 10, 2012 |
Current U.S.
Class: |
711/155 |
Current CPC
Class: |
G06F 3/0659 20130101;
G06F 3/0608 20130101; G06F 3/0616 20130101; G06F 3/0661 20130101;
G06F 3/0604 20130101; G06F 3/0638 20130101; G06F 3/0679
20130101 |
Class at
Publication: |
711/155 |
International
Class: |
G06F 3/06 20060101
G06F003/06 |
Foreign Application Data
Date |
Code |
Application Number |
Feb 8, 2012 |
JP |
2012-025497 |
Claims
1. A controller that controls the reading and writing of data from
and to a storage medium and a storage unit, the storage medium
including a plurality of pages each serving as a storage area which
is a unit of input and output from and to an external device, the
storage medium storing a plurality of pieces of data of clusters in
each page, each of the pieces of data being a predetermined data
unit, the storage unit storing correspondences between logical
addresses for identifying the respective clusters and physical
addresses of the storage medium, the controller comprising: a write
control unit configured to make a control that converts data
requested to be written by the external device into a plurality of
pieces of cluster data with a size equal to a size of the cluster,
compresses each of the converted pieces of cluster data by an
external compression unit, determines a corresponding physical
address of a write destination in the storage medium according to a
predetermined rule, and writes the compressed pieces of cluster
data to the storage medium using the physical address of the write
destination, and a control that writes a correspondence between the
physical address of the write destination and a corresponding
logical address to the storage unit; a read control unit configured
to a control that acquires a corresponding physical address of data
requested to be read by the external device from the storage unit,
reads a corresponding piece of cluster data from the storage medium
using the acquired physical address, decompresses the read piece of
cluster data by an external decompression unit, and outputs the
decompressed piece of cluster data; and a transfer control unit
configured to make a control that determines a piece of cluster
data to be transferred among the pieces of cluster data written to
the storage medium according to a predetermined rule, reads the
determined piece of cluster data from the storage medium,
decompresses the read piece of cluster data by the external
decompression unit, compresses the decompressed piece of cluster
data by the external compression unit, determines a corresponding
physical address of a transfer destination in the storage medium
according to a predetermined rule, and writes the compressed piece
of cluster data to the storage medium using the corresponding
physical address of the transfer destination, and a control that
writes a correspondence between the physical address of the
transfer destination and a corresponding logical address to the
storage unit.
2. The controller according to claim 1, wherein the write control
unit controls whether the external compression unit compresses the
pieces of cluster data according to a predetermined rule, the read
control unit controls whether the external decompression unit
decompresses the piece of cluster data according to a predetermined
rule, and the transfer control unit controls whether the external
decompression unit decompresses the piece of cluster data according
to a predetermined rule and controls whether the external
compression unit compresses the piece of cluster data according to
a predetermined rule.
3. The controller according to claim 1, wherein the page includes
at least one set area with a size that is an integer multiple of
the size of the cluster, the set area is divided into a plurality
of predetermined division sizes, the write control unit adds dummy
data to the compressed piece of cluster data so that a size of the
compressed piece of cluster data is an integer multiple of the
division size, and the transfer control unit adds dummy data to the
compressed piece of cluster data so that a size of the compressed
piece of cluster data is an integer multiple of the division
size.
4. The controller according to claim 2, wherein the page includes
at least one set area with a size that is an integer multiple of
the size of the cluster, the set area is divided into a plurality
of predetermined division sizes, the write control unit adds dummy
data to the compressed piece of cluster data so that a size of the
compressed piece of cluster data is an integer multiple of the
division size, the transfer control unit adds dummy data to the
compressed piece of cluster data so that a size of the compressed
piece of cluster data is an integer multiple of the division size,
when the size of the piece of cluster data that is an integer
multiple of the division size is equal to the size of the set area,
the write control unit makes a control that cancels the compression
of the piece of cluster data, and writes the piece of cluster data
whose compression is cancelled to the storage medium using the
physical address of the write destination, and a control that
writes a correspondence between the physical address of the write
destination and the logical address to the storage unit, when the
read piece of cluster data is not compressed, the read control unit
makes a control that outputs the read piece of cluster data without
decompressing by the external decompression unit, when the read
cluster data is not compressed, the transfer control unit makes a
control that does not decompress the read piece of cluster data by
the external decompression unit, and when the size of the cluster
data that is an integer multiple of the division size is equal to
the size of the set area, the transfer control unit makes a control
that cancels the compression of the piece of cluster data, writes
the piece of cluster data whose compression is cancelled to the
storage medium using the physical address of the write destination,
and a control that writes a correspondence between the physical
address of the transfer destination and the logical address to the
storage unit.
5. The controller according to claim 1, wherein the storage medium
includes a block including the plurality of pages, the write
control unit makes a control that writes the pieces of cluster data
across the plurality of pages with consecutive physical addresses,
respectively, in a management unit in which the block is managed
into the storage medium, when the pieces of cluster data are
written across the plurality of pages with the consecutive physical
addresses in the management unit in which the block is managed, the
read control unit makes a control that reads the plurality of pages
and extracts the pieces of cluster data, when the pieces of cluster
data are written across the plurality of pages with the consecutive
physical addresses in the management unit in which the block is
managed, the transfer control unit makes a control that reads the
plurality of pages and extracts the pieces of cluster data, and the
transfer control unit makes a control that writes the pieces of
cluster data across the plurality of pages with consecutive
physical addresses, respectively, in the management unit in which
the block is managed into the storage medium.
6. The controller according to claim 3, wherein the storage medium
includes a block including the plurality of set areas, the write
control unit makes a control that writes the pieces of cluster data
across the plurality of set areas with consecutive physical
addresses, respectively, in a management unit in which the block is
managed into the storage medium, when the pieces of cluster data
are written across the plurality of set areas with the consecutive
physical addresses in the management unit in which the block is
managed, the read control unit makes a control that reads the
plurality of set areas and extracts the pieces of cluster data,
when the pieces of cluster data are written across the plurality of
set areas with the consecutive physical addresses in the management
unit in which the block is managed, the transfer control unit makes
a control that reads the plurality of set areas and extracts the
pieces of cluster data, and the transfer control unit makes a
control that writes the pieces of cluster data across the plurality
of set areas with consecutive physical addresses, respectively, in
the management unit in which the block is managed into the storage
medium.
7. The controller according to claim 3, wherein the storage medium
includes a block including the plurality of pages, the write
control unit makes a control that writes the piece of cluster data
together with metadata including the logical address, and writes
information for specifying at least the block as the physical
address of the write destination into the storage unit, the read
control unit makes a control that reads the pieces of cluster data
stored at the physical address acquired from the storage unit,
extracts metadata which is written together with the read pieces of
cluster data, compares the logical address included in the
extracted metadata with the logical address of data which is
requested to be read, and reads the pieces of cluster data with the
identical logical address, the transfer control unit makes control
that determines pieces of cluster data to be transferred among the
pieces of cluster data written into the storage medium according to
a predetermined rule, acquires the physical address corresponding
to the determined pieces of cluster data from the storage unit,
reads the pieces of cluster data stored at the acquired physical
address, extracts metadata which is written together with the read
pieces of cluster data, compares the logical address included in
the extracted metadata with the logical address of the determined
pieces of cluster data, and reads the pieces of cluster data with
the identical logical address, and the transfer control unit makes
a control that writes the pieces of cluster data together with the
metadata including the logical address into the storage medium, and
writes information for specifying at least the block as the
physical address of the transfer destination into the storage
unit.
8. The controller according to claim 7, wherein the read control
unit sequentially compares the logical address from the last piece
of cluster data in a storing order of the pieces of cluster data,
and the transfer control unit sequentially compares the logical
address from the last piece of cluster data in the storing order of
the pieces of cluster data.
9. The controller according to claim 2, wherein when a time
required for the compression performed by the external compression
unit is equal to or more than a predetermined time, the write
control unit makes a control that cancels the compression of the
pieces of cluster data by the external compression unit, writes the
pieces of cluster data whose compression is cancelled into the
storage medium using the physical address of the write destination,
and a control that writes a correspondence between the physical
address of the write destination and the logical address into the
storage unit, when the read piece of cluster data is not
compressed, the read control unit makes a control that outputs the
read piece of cluster data without decompressing by the external
decompression unit, when the read piece of cluster data is not
compressed, the transfer control unit makes a control that does not
decompress the read piece of cluster data by the external
decompression unit, and when a time required for the compression
performed by the external compression unit is equal to or more than
a predetermined time, the transfer control unit makes a control
that cancels the compression of the pieces of cluster data by the
external compression unit, and writes the pieces of cluster data
whose compression is cancelled into the storage medium using the
physical address of the transfer destination, and a control that
writes a correspondence between the physical address of the
transfer destination and the logical address into the storage
unit.
10. The controller according to claim 2, wherein the write control
unit makes a control that does not compress the pieces of cluster
data by the external compression unit, when the read piece of
cluster data is not compressed, the read control unit makes a
control that outputs the read piece of cluster data without
decompressing by the external decompression unit, when the read
piece of cluster data is not compressed, the transfer control unit
makes a control that does not decompress the read piece of cluster
data by the external decompression unit, and a control that
compresses the pieces of cluster data by the external compression
unit.
11. The controller according to claim 10, wherein the transfer
control unit makes control that does not decompress a piece of
cluster data read for piece of cluster data to be transferred again
and being written into the storage medium by the control of the
transfer control unit among the pieces of cluster data to be
transferred which are determined according to a predetermined rule,
and a control that does not compress the pieces of cluster data by
the external compression unit.
12. The controller according to claim 2, wherein the write control
unit makes a control that compresses the pieces of cluster data by
the external compression unit, the read control unit makes a
control that decompresses the piece of cluster data by the external
decompression unit, and the transfer control unit makes a control
that does not decompress the piece of cluster data by the external
decompression unit and does not compress the piece of cluster data
by the external compression unit.
13. The controller according to claim 1, wherein the write control
unit makes a control that converts data requested to be written by
the external device into a plurality of pieces of cluster data with
a size equal to the size of the cluster, compresses each of the
converted pieces of cluster data by the external compression unit
at a first compression ratio, and writes the compressed pieces of
cluster data into the storage medium using the physical address of
the write destination, and a control that writes a correspondence
between the physical address of the write destination into the
storage unit and the logical address, the read control unit makes a
control that acquires a corresponding physical address of data
requested to be read by the external device from the storage unit,
reads a piece of cluster data from the storage medium using the
acquired physical address, decompresses the read piece of cluster
data by the external decompression unit at the first compression
ratio or a second compression ratio higher than the first
compression ratio, and outputs the decompressed piece of cluster
data, and the transfer control unit makes a control that determines
a piece of cluster data to be transferred among the pieces of
cluster data written into the storage medium according to a
predetermined rule, reads the determined piece of cluster data from
the storage medium, decompresses the read piece of cluster data by
the external decompression unit at the first compression ratio or
the second compression ratio, compresses the decompressed piece of
cluster data by the external compression unit at the second
compression ratio, writes the compressed piece of cluster data into
the storage medium using the physical address of the transfer
destination, and a control that writes a correspondence between the
physical address of the transfer destination and the logical
address into the storage unit.
14. The controller according to claim 1, wherein a sum of a storage
capacity obtained by subtracting a predetermined capacity from a
capacity of the storage medium capable of storing data and a
capacity corresponding to at least a portion of an amount of data
reduction obtained by the compression of the piece of cluster data
is provided to an external host apparatus.
15. A data storage device comprising: a storage medium including a
plurality of pages each serving as a storage area which is a unit
of input and output from and to an external device, the storage
medium storing a plurality of pieces of data of clusters in each
page, each of the pieces of data being a predetermined data unit; a
storage unit configured to store correspondences between logical
addresses for identifying the respective clusters and physical
addresses of the storage medium; a compression unit configured to
compress data; a write control unit configured to make a control
that converts data requested to be written by the external device
into a plurality of pieces of cluster data with a size equal to a
size of the cluster, compresses each of the converted pieces of
cluster data by the compression unit, determines a corresponding
physical address of a write destination in the storage medium
according to a predetermined rule, and writes the compressed pieces
of cluster data to the storage medium using the physical address of
the write destination, and a control that writes a correspondence
between the physical address of the write destination and a
corresponding logical address to the storage unit; a decompression
unit configured to decompress the data compressed by the
compression unit; a read control unit configured to a control that
acquires a corresponding physical address of data requested to be
read by the external device from the storage unit, reads a
corresponding piece of cluster data from the storage medium using
the acquired physical address, decompresses the read piece of
cluster data by the decompression unit, and outputs the
decompressed piece of cluster data; and a transfer control unit
configured to make a control that determines a piece of cluster
data to be transferred among the pieces of cluster data written to
the storage medium according to a predetermined rule, reads the
determined piece of cluster data from the storage medium,
decompresses the read piece of cluster data by the decompression
unit, compresses the decompressed piece of cluster data by the
compression unit, determines a corresponding physical address of a
transfer destination in the storage medium according to a
predetermined rule, and writes the compressed piece of cluster data
to the storage medium using the corresponding physical address of
the transfer destination, and a control that writes a
correspondence between the physical address of the transfer
destination and a corresponding logical address to the storage
unit.
16. A computer program product comprising a computer-readable
medium containing a program executed by a computer that controls
the reading and writing of data from and to a storage medium and a
storage unit, the storage medium including a plurality of pages
each serving as a storage area which is a unit of input and output
from and to an external device, the storage medium storing a
plurality of pieces of data of clusters in each page, each of the
pieces of data being a predetermined data unit, the storage unit
storing correspondences between logical addresses for identifying
the respective clusters and physical addresses of the storage
medium, the program causing the computer to execute: converting
data requested to be written by the external device into a
plurality of pieces of cluster data with a size equal to a size of
the cluster; compressing each of the converted pieces of cluster
data by an external compression unit; determining a corresponding
physical address of a write destination in the storage medium
according to a predetermined rule; writing the compressed pieces of
cluster data to the storage medium using the physical address of
the write destination; writing a correspondence between the
physical address of the write destination and a corresponding
logical address to the storage unit; acquiring a corresponding
physical address of data requested to be read by the external
device from the storage unit; reading a corresponding piece of
cluster data from the storage medium using the acquired physical
address; decompressing the read piece of cluster data by an
external decompression unit; outputting the decompressed piece of
cluster data; determining a piece of cluster data to be transferred
among the pieces of cluster data written to the storage medium
according to a predetermined rule; reading the determined piece of
cluster data from the storage medium; decompressing the read piece
of cluster data by the external decompression unit; compressing the
decompressed piece of cluster data by the external compression
unit; determining a corresponding physical address of a transfer
destination in the storage medium according to a predetermined
rule; writing the compressed piece of cluster data to the storage
medium using the corresponding physical address of the transfer
destination; and writing a correspondence between the physical
address of the transfer destination and a corresponding logical
address to the storage unit.
Description
CROSS-REFERENCE TO RELATED APPLICATION
[0001] This application is based upon and claims the benefit of
priority from Japanese Patent Application No. 2012-025497, filed on
Feb. 8, 2012; the entire contents of which are incorporated herein
by reference.
FIELD
[0002] Embodiments described herein relate generally to a
controller, a data storage device, and a computer program
product.
BACKGROUND
[0003] A data storage device typified by a solid state drive (SSD)
has been known which uses a semiconductor storage medium, such as
NAND flash memory.
[0004] However, the lifespan of the semiconductor storage medium,
such as NAND flash memory, depends on the number of times data is
rewritten. In the data storage device using the semiconductor
storage medium, it is necessary to minimize the capacity of data
written to the semiconductor storage medium.
BRIEF DESCRIPTION OF THE DRAWINGS
[0005] FIG. 1 is a block diagram illustrating an example of the
structure of a data storage device according to a first
embodiment;
[0006] FIG. 2 is a schematic diagram illustrating the relationship
between a block and a page in a storage medium;
[0007] FIGS. 3A and 3B are schematic diagrams illustrating the
storage position (arrangement) of a cluster set in the page;
[0008] FIG. 4 is a schematic diagram illustrating an address
mapping table according to the first embodiment;
[0009] FIG. 5 is a flowchart illustrating an example of the
procedure of a writing process according to the first
embodiment;
[0010] FIG. 6 is a flowchart illustrating an example of the
procedure of a reading process according to the first
embodiment;
[0011] FIG. 7 is a flowchart illustrating an example of the
procedure of a transfer process according to the first
embodiment;
[0012] FIG. 8 is a block diagram illustrating an example of the
structure of a data storage device according to a second
embodiment;
[0013] FIG. 9 is a schematic diagram illustrating an example of the
structure of a slot;
[0014] FIGS. 10A to 10D are schematic diagrams illustrating the
size of compressed data with respect to the division size of the
slot;
[0015] FIGS. 11A and 11B are schematic diagrams illustrating a
state in which the compressed clusters are stored across the slots
(or pages);
[0016] FIG. 12 is a schematic diagram illustrating the storage
patterns of the compressed clusters in the slot;
[0017] FIG. 13 is a schematic diagram illustrating an address
mapping table according to the second embodiment;
[0018] FIG. 14 is a flowchart illustrating an example of the
procedure of a writing process according to the second
embodiment;
[0019] FIG. 15 is a flowchart illustrating an example of the
procedure of a reading process according to the second
embodiment;
[0020] FIG. 16 is a flowchart illustrating an example of the
procedure of a transfer process according to the second
embodiment;
[0021] FIG. 17 is a block diagram illustrating an example of the
structure of a data storage device according to a third
embodiment;
[0022] FIGS. 18A and 18B are schematic diagrams illustrating an
address mapping table according to the third embodiment;
[0023] FIG. 19 is a schematic diagram illustrating the state of a
cluster stored at the end of a slot;
[0024] FIG. 20 is a flowchart illustrating an example of the
procedure of a writing process according to the third
embodiment;
[0025] FIG. 21 is a flowchart illustrating an example of the
procedure of a reading process according to the third
embodiment;
[0026] FIG. 22 is a flowchart illustrating an example of the
procedure of a transfer process according to the third embodiment;
and
[0027] FIG. 23 is a schematic diagram illustrating an example of
data including error correction data for correcting irreversibly
compressed data.
DETAILED DESCRIPTION
[0028] According to an embodiment, a controller controls the
reading and writing of data from and to a storage medium and a
storage unit. The storage medium includes a plurality of pages each
serving as a storage area which is a unit of input and output from
and to an external device. The storage medium stores a plurality of
pieces of data of clusters in each page, each of the pieces of data
being a predetermined data unit. The storage unit stores
correspondences between logical addresses for identifying the
respective clusters and physical addresses of the storage medium.
The controller includes a write control unit configured to make a
control that converts data requested to be written by the external
device into a plurality of pieces of cluster data with a size equal
to a size of the cluster of the storage medium, compresses each of
the converted pieces of cluster data by an external compression
unit, determines a corresponding physical address of a write
destination in the storage medium according to a predetermined
rule, and writes the compressed pieces of cluster data to the
storage medium using the physical address of the write destination,
and a control that writes a correspondence between the physical
address of the write destination and a corresponding logical
address to the storage unit. The controller also includes a read
control unit configured to a control that acquires a corresponding
physical address of data requested to be read by the external
device from the storage unit, reads a corresponding piece of
cluster data from the storage medium using the acquired physical
address, decompresses the read piece of cluster data by an external
decompression unit, and outputs the decompressed piece of cluster
data. The controller also includes a transfer control unit
configured to make a control that determines a piece of cluster
data to be transferred among the pieces of cluster data written to
the storage medium according to a predetermined rule, reads the
determined piece of cluster data from the storage medium,
decompresses the read piece of cluster data by the external
decompression unit, compresses the decompressed piece of cluster
data by the external compression unit, determines a corresponding
physical address of a transfer destination in the storage medium
according to a predetermined rule, and writes the compressed piece
of cluster data to the storage medium using the corresponding
physical address of the transfer destination, and a control that
writes a correspondence between the physical address of the
transfer destination and a corresponding logical address to the
storage unit.
[0029] Hereinafter, a controller, a data storage device, and a
computer program product according to exemplary embodiments of the
invention will be described in detail. In each of the following
embodiments, for example, an SSD is used as the data storage
device, but the data storage device is not limited thereto.
First Embodiment
[0030] A data storage device according to a first embodiment
includes a controller having a function of compressing data to be
written to a storage medium to reduce the amount of data.
[0031] According to the first embodiment, a controller controls the
reading and writing of data from and to a storage medium and a
storage unit. The storage medium includes a plurality of pages each
serving as a storage area which is a unit of input and output from
and to an external device. The storage medium stores a plurality of
pieces of data of clusters in each page, each of the pieces of data
being a predetermined data unit. The storage unit stores
correspondences between logical addresses for identifying the
respective clusters and physical addresses of the storage medium.
The controller includes a write control unit configured to make a
control that converts data requested to be written by the external
device into a plurality of pieces of cluster data with a size equal
to a size of the cluster of the storage medium, compresses each of
the converted pieces of cluster data by an external compression
unit, determines a corresponding physical address of a write
destination in the storage medium according to a predetermined
rule, and writes the compressed pieces of cluster data to the
storage medium using the physical address of the write destination,
and a control that writes a correspondence between the physical
address of the write destination and a corresponding logical
address to the storage unit. The controller also includes a read
control unit configured to a control that acquires a corresponding
physical address of data requested to be read by the external
device from the storage unit, reads a corresponding piece of
cluster data from the storage medium using the acquired physical
address, decompresses the read piece of cluster data by an external
decompression unit, and outputs the decompressed piece of cluster
data. The controller also includes a transfer control unit
configured to make a control that determines a piece of cluster
data to be transferred among the pieces of cluster data written to
the storage medium according to a predetermined rule, reads the
determined piece of cluster data from the storage medium,
decompresses the read piece of cluster data by the external
decompression unit, compresses the decompressed piece of cluster
data by the external compression unit, determines a corresponding
physical address of a transfer destination in the storage medium
according to a predetermined rule, and writes the compressed piece
of cluster data to the storage medium using the corresponding
physical address of the transfer destination, and a control that
writes a correspondence between the physical address of the
transfer destination and a corresponding logical address to the
storage unit.
[0032] In the controller of the data storage device according to
the first embodiment, the write control unit controls whether the
external compression unit compresses the pieces of cluster data
according to a predetermined rule. The read control unit controls
whether the external decompression unit decompresses the piece of
cluster data according to a predetermined rule. The transfer
control unit controls whether the external decompression unit
decompresses the piece of cluster data according to a predetermined
rule and controls whether the external compression unit compresses
the piece of cluster data according to a predetermined rule.
[0033] In the controller of the data storage device according to
the first embodiment, the storage medium includes a block including
the plurality of pages. The write control unit makes a control that
writes the pieces of cluster data across the plurality of pages
with consecutive physical addresses, respectively, in a management
unit in which the block is managed into the storage medium. When
the pieces of cluster data are written across the plurality of
pages with the consecutive physical addresses in the management
unit in which the block is managed, the read control unit makes a
control that reads the plurality of pages and extracts the pieces
of cluster data. When the pieces of cluster data are written across
the plurality of pages with the consecutive physical addresses in
the management unit in which the block is managed, the transfer
control unit makes a control that reads the plurality of pages and
extracts the pieces of cluster data. The transfer control unit
makes a control that writes the pieces of cluster data across the
plurality of pages with consecutive physical addresses,
respectively, in the management unit in which the block is managed
into the storage medium.
[0034] Hereinafter, an example will be described in detail. FIG. 1
is a block diagram illustrating the example of the structure of a
data storage device 100 according to the first embodiment. As
illustrated in FIG. 1, the data storage device 100 includes a
controller 110, a storage medium access unit 101, a first access
unit 102, a second access unit 103, a compression unit 104, a
decompression unit 105, an interface unit 106, a storage medium
151, a first memory 152, and a second memory 153.
[0035] (Storage Medium 151)
[0036] The storage medium 151 is a semiconductor storage medium,
such as NAND flash memory. The storage medium 151 includes a
plurality of blocks 400, as illustrated in FIG. 2. The block 400
is, for example, a unit of data reading and writing for the
semiconductor storage medium. For example, a deletion process is
performed for each block 400 in the storage medium 151.
[0037] As illustrated in FIG. 2, the block 400 includes a plurality
of pages 402. The page 402 is a unit of data input and output
between the storage medium 151 and the outside (for example, the
storage medium access unit 101) of the storage medium 151.
Consecutive page numbers (serial numbers) are given to each page
402 of the block 400. In addition, data is written to the storage
medium 151, for example, in ascending order of the page numbers.
That is, data is written to the storage medium 151 in the following
order: for example, after a process of deleting data which is
recorded in the unit of the blocks 400 in advance, data is written
in ascending order of the page numbers.
[0038] As illustrated in FIG. 3A, a plurality of cluster sets are
stored in the page 402. The cluster set includes cluster data and
error correction data. The basic data for generating the error
correction data includes the cluster data. The cluster is a unit of
data in the data storage device 100. In addition, address
information for identifying the cluster is, for example, a logical
address.
[0039] The size of the cluster is set to, for example, 1024 bytes,
but is not limited thereto. The cluster data which is stored as a
portion of the cluster set in the page 402 may or may not be
compressed. The cluster set may further include metadata, which is
information indicating the cluster. The metadata is, for example,
the logical address of the cluster. When the metadata is included
in the cluster set, the basic data for generating the error
correction data also includes the metadata. In addition, when the
cluster set includes the metadata, the metadata which is stored as
a portion of the cluster set in the page 402 may or may not be
compressed. In the first embodiment, an example in which the
cluster set includes the metadata will be described, but the
invention is not limited thereto. The cluster set may not include
the metadata.
[0040] The cluster set may further include cluster set size data,
which is information indicating the size of the cluster set. When
the cluster set includes the cluster set size data, the cluster set
size data which is stored as a portion of the cluster set in the
page 402 is not compressed. In the first embodiment, an example in
which the cluster set does not include the cluster set size data
will be described, but the invention is not limited thereto. The
cluster set may include the cluster set size data.
[0041] The storage format of the cluster set stored in the page 402
is not limited to the example illustrated in FIG. 3A. The cluster
set may be stored in the page 402 in any storage format as long as
each data piece included in the cluster set can be appropriately
extracted. For example, as illustrated in FIG. 3A, the metadata,
the cluster data, and the error correction data are not necessarily
stored in the page 402 in this order.
[0042] Two pages 402 including consecutive physical address
information items, which will be described below, may include one
cluster set in a management unit managing the block 400, as
illustrated in FIG. 3B. That is, the cluster set may be stored
across two pages 402. When only the page 402 stores the cluster
set, the page 402 may be configured such that dummy data is stored
in the area in which the cluster set is not stored. The dummy data
may have a predetermined value (for example, all zero) or a random
value. The page 402 may be configured such that the dummy data is
stored instead of the error correction data. When the page 402
stores the error correction data, it is possible to improve the
reliability of data stored in the storage medium 151. In addition,
the page 402 may be configured such that the order of the cluster
sets is appropriately changed to reduce the amount of dummy data
stored. When the amount of dummy data stored in the page 402 is
reduced, it is possible to improve the usage efficiency of the
storage medium 151.
[0043] (Storage Medium Access Unit 101)
[0044] When receiving an instruction to write data to the storage
medium 151, the storage medium access unit 101 (FIG. 1) inputs data
which is instructed to be written to the storage medium 151 and
performs a writing process. When receiving an instruction to read
data stored in the storage medium 151, the storage medium access
unit 101 reads data which is instructed to be read from the storage
medium 151 and returns the read data to a request source which has
requested the reading process.
[0045] (First Memory 152)
[0046] The first memory 152 stores management information. The
management information includes an address mapping table 160. The
address mapping table 160 is a table in which the logical address
of the cluster is associated with the physical address information
(hereinafter, in some cases, simply referred to as a physical
address) of the storage medium 151 in which data indicated by the
logical address is stored. In addition, the first memory 152 may be
configured so as to store information derived from the information
of the address mapping table 160 in advance in order to simplify
various processes performed by the data storage device 100.
[0047] As described with reference to FIG. 3A, when the page 402
stores a plurality of cluster sets, the address mapping table 160
includes, as indexes, the logical addresses which are arranged in
ascending order as illustrated in FIG. 4. The address mapping table
160 stores, as elements of the table, a set of block number
information, page number information, and information about a page
offset (an offset on a page), which are the physical address of the
storage medium 151.
[0048] The address mapping table 160 stores information about the
size of the cluster set stored in the storage medium 151. The
information about the size of the cluster set is not necessarily
stored in the address mapping table 160. For example, the metadata
may include the information about the size of the cluster set.
[0049] In the first embodiment, an example in which the address
mapping table 160 includes the information about the size of the
cluster set will be described. However, the invention is not
limited thereto. The address mapping table 160 may not include the
information about the size of the cluster set. In this embodiment,
the pages 402 with consecutive page numbers in the same block 400
correspond to two pages 402 which have consecutive physical
addresses in a management unit managing the block 400 which is
described with reference to FIG. 3B.
[0050] For example, a page with page number 34 in a block with
block number 66 is the left page of FIG. 3B and a page with page
number 35 in the same block (block number 66) is the right page of
FIG. 3B. In this case, in the physical address of the cluster set
in the page, the block number information is 66, the page number
information is 34, and the information about the page offset is the
storage start position of the cluster set. In addition, when data
for the cluster set stored across the pages is needed, data may be
read with the page offset being zero in the page with page number
35 in the block with block number 66. As such, two pages 402 with
consecutive physical addresses may store one cluster set in the
management unit managing the block 400.
[0051] The structure of the address mapping table 160 is not
limited to that illustrated in FIG. 4. For example, when the data
storage device 100 includes a plurality of storage media 151 and
parallel access to the storage media 151 is performed to improve
the processing speed, the address mapping table 160 may be
configured such that various kinds of information are associated
with each other using a logical block, which is a set of block
groups selected from each storage medium 151, as a unit. In
addition, the address mapping table 160 may be configured such that
various kinds of information are associated with each other using a
logical page, which is a set of the pages with the same page number
in a plurality of blocks 400 forming the logical block, as a
unit.
[0052] The management information may be configured so as to
further include a logical-physical conversion table (not
illustrated) for deriving information about the blocks 400 forming
the logical block from logical block information. In addition, the
management information may be configured so as to include, as the
physical address of the storage medium 151, logical block number
information, logical page number information, and information about
an offset on the logical page. In this case, consecutive pages
forming the same logical page, or pages with consecutive logical
page numbers in the same logical block correspond to the two pages
402 with consecutive physical addresses in the management unit
managing the block 400 which is described with reference to FIG.
3B.
[0053] For the former, for example, it is assumed that a block with
block number 5, a block with block number 97, a block with block
number 36, and a block with block number 104 form a logical block
with logical block number 49 and the clusters are written to the
logical pages in this order. At that time, for example, in the
logical page with logical page number 40, a page with page number
40 in the block with block number 5 is the left page of FIG. 3B and
a page with page number 40 in the block with block number 97 is the
right page of FIG. 3B. In the physical address of the cluster set
stored in consecutive pages with the same logical page, the logical
block number information is 49, the logical page number information
is 40, and the information about the offset on the logical page is
the storage start position of the cluster set. In addition, when
data for the cluster set stored across consecutive pages with the
same logical page is needed, data may be read from an offset 0 on
the page with page number 40 in the block with block number 97.
[0054] For the latter, for example, a logical page with logical
page number 34 in a logical block with logical block number 66 is
the left page of FIG. 3B and a logical page with logical page
number 35 in the same logical block (logical block number 66) is
the right page of FIG. 3B. In this case, in the physical address of
the cluster set stored across the logical pages, the logical block
number information is 66, the logical page number information is
34, and the information about the offset on the logical page is the
storage start position of the cluster set. In addition, when data
for the cluster set stored across consecutive pages in the same
logical page is needed, data may be read from an offset 0 on the
logical page with logical page number 35 in the logical block with
logical block number 66. Therefore, the two pages 402 with
consecutive physical addresses may store one cluster set in the
unit of management of the block 400.
[0055] As such, the structure of the address mapping table 160 may
be changed in various ways. In the first embodiment, for example,
the address mapping table 160 includes the block number
information, the page number information, and the information about
the page offset as the physical address of the storage medium 151.
However, the structure of the address mapping table 160 is not
limited thereto and the address mapping table 160 may have other
structures.
[0056] (First Access Unit 102)
[0057] When receiving an instruction to write data to the first
memory 152, the first access unit 102 (FIG. 1) writes data which is
instructed to be written to the first memory 152. In addition, when
receiving an instruction to read data stored in the first memory
152, the first access unit 102 reads data which is instructed to be
read from the first memory 152 and returns the read data to a
request source which has requested the reading.
[0058] (Second Memory 153)
[0059] The second memory 153 temporarily stores a plurality of
cluster sets to be written.
[0060] (Second Access Unit 103)
[0061] When receiving an instruction to write data to the second
memory 153, the second access unit 103 writes data which is
instructed to be written to the second memory 153. In addition,
when receiving an instruction to read data stored in the second
memory 153, the second access unit 103 reads data which is
instructed to be read from the second memory 153 and returns the
read data to a request source which has requested the reading
process.
[0062] (Compression Unit 104)
[0063] When receiving an instruction to compress data, the
compression unit 104 reversibly compresses the instructed data
using a predetermined method and returns the compressed data to a
request source which has requested compression.
[0064] (Decompression Unit 105)
[0065] When receiving an instruction to decompress the data
compressed by the compression unit 104, the decompression unit 105
decompressed the instructed data using a predetermined method and
returns the decompressed data to a request source which has
requested decompression.
[0066] (Controller 110)
[0067] The controller 110 includes a writing unit 111, a reading
unit 112, a write control unit 113, a read control unit 114, and a
transfer control unit 115.
[0068] (Writing Unit 111)
[0069] The writing unit 111 receives a cluster write request from
the write control unit 113 (or transfer control unit 115). The
cluster write request includes write destination information,
cluster data to be written, and data indicating the logical address
of the cluster to be written. The write destination information
includes the block number of the write destination of the cluster,
a page number, and information about an offset on a page.
[0070] The writing unit 111 extracts the cluster data to be written
from the received cluster write request. The writing unit 111
transmits the extracted cluster data to be written to the
compression unit 104 and instructs the compression unit 104 to
compress the cluster data. Then, the writing unit 111 acquires the
cluster data to be written which is compressed by the compression
unit 104. When there is no necessity to compress the cluster data,
the writing unit 111 processes the extracted cluster data to be
written in the same way as that in which the compressed cluster
data to be written is processed, without transmitting the cluster
data to the compression unit 104 (the cluster data is regarded as
the compressed cluster data to be written). For example, when there
is little difference between the size of data obtained by
compressing the extracted cluster data to be written and the size
of the cluster data before compression, the effect of compressing
the cluster data is small. Therefore, it is not necessary to
compress the cluster data. In this case, the writing unit 111 may
not transmit the cluster data to the compression unit 104.
[0071] The writing unit 111 extracts data indicating the logical
address of the cluster to be written from the received cluster
write request and generates metadata including the extracted data
indicating the logical address of the cluster to be written. When
the metadata included in the cluster set is compressed, the writing
unit 111 may instruct the compression unit 104 to compress the
generated metadata, acquire the compressed metadata from the
compression unit 104, and replace the generated metadata with the
acquired compressed metadata. The writing unit 111 generates the
error correction data on the basis of the compressed cluster data
to be written and data including the generated metadata. Then, the
writing unit 111 generates the cluster set including the compressed
cluster data to be written, the generated metadata, and the
generated error correction data.
[0072] Then, the writing unit 111 calculates the size of the
generated cluster set. Then, the writing unit 111 determines
whether the generated cluster set is fitted into a page, which is a
write destination. Specifically, the writing unit 111 determines
whether the sum of the information about the page offset included
in the write destination information and the calculated size of the
cluster set is within the size of the page.
[0073] When the determination result is YES (the cluster set is
fitted into the page, which is a write destination), the writing
unit 111 instructs the second access unit 103 to perform a writing
process such that the second memory 153 temporarily stores the
generated cluster set. In addition, the writing unit 111 returns
the information about the size of the cluster set to a request
source (write request source) which has requested the writing
process.
[0074] When the determination result is No (the cluster set is not
fitted into the page, which is a write destination), the writing
unit 111 returns a response indicating the overflow of the page,
which is a write destination, to the request source which has
requested the writing process. When receiving the next write
destination information from the write request source, the writing
unit 111 instructs the second access unit 103 to perform a writing
process such that the second memory 153 temporarily stores the
generated cluster set. In addition, the writing unit 111 returns
the information about the size of the cluster set to the write
request source.
[0075] When receiving an instruction to store the dummy data from
the write request source, the writing unit 111 generates dummy data
corresponding to the size of the area in which the cluster set is
not stored in the page, which is a write destination. The dummy
data may have a predetermined value (for example, all zero) or a
random value. Then, the writing unit 111 instructs the second
access unit 103 to perform a writing process such that the second
memory 153 temporarily stores the generated dummy data.
[0076] The writing unit 111 may be configured so as to generate the
error correction data of the cluster set which is temporarily
stored in the second memory 153, instead of the dummy data. When
the error correction data of the cluster set temporarily stored in
the second memory 153 is generated, it is possible to improve the
reliability of the data stored in the storage medium 151. In
addition, the cluster sets may be stored in the second memory 153
such that the order thereof is appropriately changed, thereby
reducing the amount of dummy data stored in the second memory 153.
When the amount of dummy data stored in the second memory 153 is
reduced, it is possible to improve the usage efficiency of the
storage medium 151.
[0077] When the total size of the data temporarily stored in the
second memory 153 is equal to or more than the size of the page
402, the writing unit 111 instructs the second access unit 103 to
read data corresponding to the size of the page from the second
memory 153. In this way, the writing unit 111 acquires data
corresponding to the size of the page. Specifically, the writing
unit 111 instructs the second access unit 103 to read the data
stored in the left page of FIG. 3B among the data pieces
temporarily stored in the second memory 153.
[0078] In a case in which the data storage device 100 includes a
plurality of storage media 151 and parallel access to the storage
media 151 is performed to improve the processing speed, when the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of the pages 402 to which data is
written in parallel, the writing unit 111 instructs the second
access unit 103 to read data corresponding to the size of the pages
to which data is written in parallel from the second memory
153.
[0079] Then, the writing unit 111 instructs the storage medium
access unit 101 to write the data corresponding to the page size
(or the size of the pages to which data is written in parallel)
which is acquired through the second access unit 103 to the write
destination pages (or each page to which data is written in
parallel).
[0080] Here, the write destination page is the left page of FIG.
3B. The writing unit 111 instructs the storage medium access unit
101 to write the block number of the write destination of the
cluster and the page number which are included in the write
destination information received from the write request source. The
writing unit 111 transmits a notice indicating that the writing of
data to the page, which is a write destination, has been completed
to the write request source. In addition, the writing unit 111
notifies the write request source of the block number of the write
destination of the cluster and the page number which are included
in the write destination information received from the write
request source.
[0081] In the first embodiment, the block 400 to which data which
is requested to be written by the host apparatus is written is
different from a transfer destination block 400. Therefore, when
the write request source is the transfer control unit 115, the
writing unit 111 performs the same process as that performed when
the write request source is the write control unit 113 on another
write destination page.
[0082] The writing unit 111 may be configured such that the block
400 to which data which is requested to be written by the host
apparatus is written is the same as the transfer destination block
400. For example, even when there is a write request from the write
control unit 113 or there is a write request from the transfer
control unit 115, the writing unit 111 performs the above-mentioned
process on the same write destination page.
[0083] (Reading Unit 112)
[0084] The reading unit 112 receives a cluster read request from
the read request source. The cluster read request includes read
destination information and data indicating the logical address of
the cluster to be read. The read destination information includes
the block number, the page number, the information about the page
offset, and the information about the size of the cluster set. When
the cluster set to be read is stored across the pages, the reading
unit 112 also receives information about consecutive read
destination pages. The information about consecutive read
destination pages includes the block number and the page
number.
[0085] The reading unit 112 extracts the block number and the page
number from the acquired read destination information and instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number. Then, the reading unit 112 acquires the data of the
page from the storage medium access unit 101. When the cluster set
to be read is stored across the pages, the reading unit 112
extracts the block number and the page number from the acquired
information about consecutive read destination pages and instructs
the storage medium access unit 101 to read the data of the pages
402 with the extracted page numbers in the block 400 with the
extracted block number. Then, the reading unit 112 further acquires
the data of the pages from the storage medium access unit 101.
[0086] The reading unit 112 extracts the information about the page
offset and the information about the size of the cluster set from
the acquired read destination information. The reading unit 112
extracts data with the size indicated by the extracted information
about the size of the cluster set, using the position indicated by
the extracted information about the page offset as a read start
position in the acquired page. When the cluster set to be read is
stored across the pages, the reading unit extracts data
corresponding to the remaining size of the cluster set from the
position of the head of the consecutive read destination pages and
adds the extracted data and the previously extracted data to
generate data for the cluster set.
[0087] The reading unit 112 corrects the error of the data for the
cluster set and acquires the error corrected data for the cluster
set. Specifically, the reading unit 112 uses data including
metadata and cluster data as the basic data for generating error
correction data in the data for the cluster set. In addition, the
reading unit 112 corrects the error of the data for the cluster set
and acquires the error corrected data for the cluster set. When
error correction fails (error correction is unavailable), the
reading unit 112 notifies the read request source of the occurrence
of a read error.
[0088] When error correction succeeds (error correction is
available), the reading unit 112 extracts the cluster data from the
error corrected data for the cluster set. The reading unit 112
transmits the extracted cluster data to the decompression unit 105
and instructs the decompression unit 105 to decompress the
extracted cluster data. Then, the reading unit 112 acquires the
cluster data decompressed by the decompression unit 105.
[0089] When it is not necessary to decompress the cluster data, the
reading unit 112 may process the extracted cluster data in the same
way as that in which the decompressed cluster data is processed,
without transmitting the extracted cluster data to the
decompression unit 105. For example, when the cluster data is
stored in the storage medium 151 without being compressed, the
reading unit 112 processes the extracted cluster data in the same
way as that in which the decompressed cluster data is processed,
without transmitting the extracted cluster data to the
decompression unit 105. Then, the reading unit 112 transmits the
decompressed cluster data (or the extracted cluster data which does
not need to be decompressed) to the read request source.
[0090] (Interface Unit 106)
[0091] The interface unit 106 receives instructions, such as a
write instruction and a read instruction, from a host apparatus
(not illustrated), such as a personal computer (PC). The write
instruction includes data storage device address information and
write data. The read instruction includes the data storage device
address information. The data storage device address information is
address information which is provided from the data storage device
100 to the host apparatus (not illustrated). For example, a logical
block address (LBA) is an example of the data storage device
address information of a hard disk drive (HDD) or an SSD. The size
of the data specified by LBA is set to, for example, 512 bytes. As
described above, the size of the data specified by the data storage
device address is generally different from the size of the data
(cluster) specified by the logical address. However, the data
storage device address and the logical address can be converted
into each other. For example, when the data storage device address
information is allocated for every 512 bytes and the logical
address is allocated for every 1024 bytes, the quotient of the data
storage device address information divided by 2 can be calculated
to convert the data storage device address information into the
logical address. In the first embodiment, for simplicity of
explanation, an example in which the size of the data specified by
the data storage device address is equal to the size of the cluster
will be described. However, the invention is not limited thereto.
The data storage device 100 may be configured such that the size of
the data specified by the data storage device address is different
from the size of the cluster.
[0092] When the received instruction is a write instruction, the
interface unit 106 transmits the received write instruction to the
write control unit 113. When the received instruction is a read
instruction, the interface unit 106 transmits the received read
instruction to the read control unit 114. When receiving data from
the read control unit 114, the interface unit 106 transmits the
received data to the host apparatus (not illustrated).
[0093] (Write Control Unit 113)
[0094] When receiving the write instruction from the interface unit
106, the write control unit 113 extracts the data storage device
address information and the write data from the received write
instruction. Then, the write control unit 113 converts the
extracted data storage device address information into a
corresponding logical address. In addition, the write control unit
113 shifts the write destination information transmitted in the
previous cluster write request for the writing unit 111 by the size
of the cluster set returned from the writing unit 111 in the
previous cluster write request for the writing unit 111 to generate
the write destination information.
[0095] As illustrated in FIG. 4, the write destination information
transmitted in the previous cluster write request for the writing
unit 111 includes the block number of the write destination of the
cluster, the page number, and the information about the page
offset. The write control unit 113 adds, to the information about
the page offset, the size of the cluster set indicated by the
information about the size of the cluster set which is returned
from the writing unit 111 in the previous cluster write request for
the writing unit 111, thereby generating the write destination
information.
[0096] When the next write destination information is given to the
writing unit 111 (when the cluster is stored across the pages) in
the previous cluster write request for the writing unit 111, the
write control unit 113 shifts the next write destination
information by the remaining size of the cluster set to generate
write destination information. The next write destination
information includes the block number of the write destination of
the cluster, the page number, and the information about the page
offset which indicates the position of the head of the page. The
write control unit 113 adds the remaining size of the cluster set
to the information about the page offset to generate the write
destination information.
[0097] When the block 400 to which the data which is requested to
be written by the host apparatus (not illustrated) is written is
the same as the transfer destination block 400, the write control
unit 113 and the transfer control unit 115 perform a process in
cooperation with each other such that the generated write
destination information items do not overlap each other. The write
control unit 113 transmits the generated write destination
information, the extracted write data, which is the cluster data to
be written, and the converted logical address in which the cluster
to be written to the writing unit 111 and instructs the writing
unit 111 to perform a writing process.
[0098] When a response indicating the overflow of the write
destination page is received from the writing unit 111 and the
physical addresses are consecutive in the same management unit
managing the block 400, the write control unit 113 gives the next
write destination information to the writing unit 111. In some
cases, the write control unit 113 instructs the writing unit 111 to
write the dummy data. For example, the write control unit 113 may
appropriately instruct the writing unit 111 to write the dummy data
even when the physical addresses are not consecutive in the same
management unit managing the block 400. When instructing the
writing unit 111 to write the dummy data, the write control unit
113 ensures a new write destination page in order to write the
cluster data, which is a write target, and performs the writing
process again. Then, the write control unit 113 receives the size
of the cluster set from the writing unit 111.
[0099] When receiving a write completion notice from the writing
unit 111, the write control unit 113 updates the address mapping
table 160 for the cluster written to the page. Specifically, the
write control unit 113 instructs the first access unit 102 to
perform a writing process such that the physical address of the
storage medium 151 indicated by the converted logical address in
the address mapping table 160 is updated to the physical address of
the storage medium 151, which is a write destination, for the
cluster written to the page.
[0100] In addition, the write control unit 113 instructs the first
access unit 102 to perform a writing process such that the
information about the size of the cluster set acquired from the
writing unit 111 is written to the address mapping table 160 for
the cluster written to the page (see FIG. 4).
[0101] (Read Control Unit 114)
[0102] When receiving a read instruction from the interface unit
106, the read control unit 114 extracts the data storage device
address information from the received read instruction. The read
control unit 114 converts the extracted data storage device address
information to a corresponding logical address. The read control
unit 114 acquires information associated with the converted logical
address. Specifically, the read control unit 114 instructs the
first access unit 102 to read the physical address of the storage
medium 151 and the information about the size of the cluster set
indicated by the converted logical address in the address mapping
table 160. Then, the read control unit 114 acquires the physical
address and the information about the size of the cluster set.
[0103] The read control unit 114 determines whether the cluster set
is stored across the pages on the basis of the information about
the page offset which is included in the acquired physical address
and the acquired information about the size of the cluster set.
When the determination result is YES (the cluster set is stored
across the pages), the read control unit 114 generates information
about consecutive read destination pages. The information about
consecutive read destination pages includes the block number and
the page number. Here, the block number and numbers subsequent to
the page number included in the acquired physical address are newly
set as the block number and the page number included in the
information about consecutive read destination pages.
[0104] For example, when the pages with consecutive page numbers in
the same block 400 correspond to a case in which the physical
addresses are consecutive in the same management unit managing the
block 400 which is described in FIG. 3B, the block number and
numbers subsequent to the page number are newly set. For example,
when the left page of FIG. 3B is a page with page number 34 in the
block with block number 66 on the basis of the acquired physical
address, the right page of FIG. 3B is a page with page number 35 in
the same block (block number 66) on the basis of the information
about the consecutive read destination pages.
[0105] When the physical addresses are consecutive in the same
management unit managing the block 400 which is described in FIG.
3B, consecutive pages in the same logical page, or pages with
consecutive logical page numbers in the same logical block are as
follows. For example, a block with block number 5, a block with
block number 97, a block with block number 36, and a block with
block number 104 form a logical block with logical block number 49
and the clusters are written to the logical page in this order.
[0106] For the former, for example, when the left page of FIG. 3B
is a page with page number 40 in the block with block number 5 on
the basis of the acquired physical address, the right page of FIG.
3B is a page with page number 40 in the block with block number 97
on the basis of the information about consecutive read destination
pages. For the latter, for example, when the left page of FIG. 3B
is a page with logical page number 34 in a logical block with
logical block number 66, the right page of FIG. 3B is a page with
logical page number 35 in the same logical block (logical block
number 66) on the basis of the information about consecutive read
destination pages.
[0107] The read control unit 114 instructs the reading unit 112 to
perform a reading process, using the acquired physical address and
the acquired information about the size of the cluster set as the
read destination information and the converted logical address as
the logical address of the cluster to be read. When the cluster set
to be read is stored across the pages, the read control unit 114
adds the generated information items about consecutive read
destination pages and transmits the added information to the
reading unit 112.
[0108] When receiving a notice indicating the occurrence of the
read error from the reading unit 112, the read control unit 114
transmits data indicating the read error to the interface unit 106.
The first memory 152 may further store information indicating that
the read error occurs when the logical address is read as one of
the management information items. In this way, when a read request
for the same logical address is issued again, it is possible to
rapidly return the read error. When receiving the data read from
the reading unit 112, the read control unit 114 transmits the
received data to the interface unit 106.
[0109] (Transfer Control Unit 115)
[0110] The data storage device 100 appropriately performs a
transfer process in order to internally manage the data stored in
the data storage device 100. The transfer control unit 115 controls
the following transfer process according to a predetermined rule.
First, the transfer control unit 115 determines the cluster to be
transferred. Specifically, the transfer control unit 115 instructs
the first access unit 102 to read the management information stored
in the first memory 152 and acquires the management information.
The transfer control unit 115 determines the cluster to be
transferred from the acquired management information using a
predetermined method. In the first embodiment, any known method may
be used to determine the cluster to be transferred. The transfer
control unit 115 extracts the logical address of the determined
cluster from the acquired management information.
[0111] Then, the transfer control unit 115 reads the cluster to be
transferred. Specifically, the transfer control unit 115 acquires
information associated with the extracted logical address. For
example, the transfer control unit 115 instructs the first access
unit 102 to read the physical address of the storage medium 151 and
the information about the size of the cluster set indicated by the
extracted logical address in the address mapping table 160. The
transfer control unit 115 acquires the physical address and the
information about the size of the cluster set.
[0112] The transfer control unit 115 determines whether the cluster
set is stored across the pages on the basis of the information
about the page offset in the acquired physical address and the
acquired information about the size of the cluster set. When the
determination result is YES (the cluster set is stored across the
pages), the transfer control unit 115 generates information about
consecutive read destination pages. The information about
consecutive read destination pages includes the block number and
the page number. Here, the block number and numbers subsequent to
the page number included in the acquired physical address are newly
set as the block number and the page number included in the
information about consecutive read destination pages.
[0113] For example, when the pages with consecutive page numbers in
the same block 400 correspond to a case in which the physical
addresses are consecutive in the same management unit managing the
block 400 described in FIG. 3B, the block number and numbers
subsequent to the page number are newly set. For example, when the
left page of FIG. 3B is the page with page number 34 in the block
with block number 66 on the basis of the acquired physical address,
the right page of FIG. 3B is the page with page number 35 in the
same block (block number 66) on the basis of the information about
the consecutive read destination pages.
[0114] When the physical addresses are consecutive in the same
management unit managing the block 400 which is described in FIG.
3B, consecutive pages in the same logical page, or pages with
consecutive logical page numbers in the same logical block are as
follows. For example, a block with block number 5, a block with
block number 97, a block with block number 36, and a block with
block number 104 form a logical block with logical block number 49
and the clusters are written to the logical page in this order.
[0115] For the former, for example, when the left page of FIG. 3B
is a page with page number 40 in the block with block number 5 on
the basis of the acquired physical address, the right page of FIG.
3B is a page with page number 40 in the block with block number 97
on the basis of the information about consecutive read destination
pages. For the latter, for example, when the left page of FIG. 3B
is a page with logical page number 34 in a logical block with
logical block number 66, the right page of FIG. 3B is a page with
logical page number 35 in the same logical block (logical block
number 66) on the basis of the information about consecutive read
destination pages.
[0116] The transfer control unit 115 instructs the reading unit 112
to perform a reading process, using the acquired physical address
and the acquired information about the size of the cluster set as
the read destination information and the converted logical address
as the logical address of the cluster to be read. When the cluster
set to be read is stored across the pages, the transfer control
unit 115 adds the generated information items about consecutive
read destination pages and transmits the added information to the
reading unit 112.
[0117] When receiving a notice indicating the occurrence of the
read error from the reading unit 112, the transfer control unit 115
performs a process of maintaining consistency such that an error
occurs when the cluster is read after the transfer process. For
example, the transfer control unit 115 may transfer the cluster
data with the read error, without correcting the read error. In
addition, the transfer control unit 115 may insert information
indicating that the read error occurs when the logical address is
read into the management information stored in the first memory 152
such that the cluster data with the read error is not
transferred.
[0118] Then, the transfer control unit 115 receives the data read
by the reading unit 112. Then, the transfer control unit 115 writes
the cluster to be transferred. Specifically, the transfer control
unit 115 shifts the write destination information transmitted in
the previous cluster write request for the writing unit 111 by the
size of the cluster set indicated by the information about the size
of the cluster set which is returned from the writing unit 111 in
the previous cluster write request for the writing unit 111,
thereby generating write destination information. The write
destination information transmitted in the previous cluster write
request for the writing unit 111 includes the block number of the
write destination of the cluster, the page number, and the
information about the page offset. The transfer control unit 115
adds, to the information about the page offset, the size of the
cluster set indicated by the information about the size of the
cluster set which is returned from the writing unit 111 in the
previous cluster write request for the writing unit 111, thereby
generating the write destination information.
[0119] In the previous cluster write request for the writing unit
111, when the next write destination information is given to the
writing unit 111 (the cluster is stored across the pages), the
transfer control unit 115 shifts the next write destination
information by the remaining size of the cluster set to generate
the write destination information. The next write destination
information includes the block number of the write destination of
the cluster, the page number, and the information about the page
offset indicating the position of the head of the page. The
transfer control unit 115 adds the remaining size of the cluster
set to the information about the page offset to generate the write
destination information.
[0120] When the block 400 to which the data which is requested to
be written by the host apparatus is written is the same as the
transfer destination block 400, the write control unit 113 and the
transfer control unit 115 perform a process in cooperation with
each other such that the generated write destination information
items do not overlap each other. The transfer control unit 115
transmits the generated write destination information, the data
which is received as the cluster data to be transferred from the
reading unit 112, and the extracted logical address to the writing
unit 111. Then, the write control unit 113 instructs the writing
unit 111 to perform a writing process.
[0121] When a response indicating the overflow of the write
destination page is received from the writing unit 111 and the
physical addresses are consecutive in the same management unit
managing the block 400, the transfer control unit 115 outputs the
next write destination information to the writing unit 111. In some
cases, the transfer control unit 115 instructs the writing unit 111
to write the dummy data.
[0122] For example, the transfer control unit 115 may appropriately
instruct the writing unit 111 to write the dummy data even when the
physical addresses are not consecutive in the same management unit
managing the block 400. When instructing the writing unit 111 to
write the dummy data, the transfer control unit 115 ensures a new
write destination page in order to write the cluster data, which is
a write target, and performs the writing process again.
[0123] Then, the transfer control unit 115 receives the size of the
cluster set from the writing unit 111. The transfer control unit
115 repeatedly performs the above-mentioned process until a write
request for the writing unit 111 corresponds to at least one page.
Since the unit of input and output for the storage medium 151 is
the page 402, the transfer control unit 115 needs to write data
corresponding to at least one page in order to perform a process of
updating the management information, which will be described.
Therefore, the transfer process is not completed.
[0124] The transfer control unit 115 updates the management
information about the transferred cluster. Specifically, when
receiving the write completion notice from the writing unit 111,
the transfer control unit 115 updates the address mapping table 160
for the cluster written to the page. The transfer control unit 115
instructs the first access unit 102 to perform a writing process
such that the physical address of the storage medium 151 indicated
by the extracted logical address in the address mapping table 160
is updated to the physical address of the storage medium 151, which
is a write destination, for the cluster written to the page.
[0125] In addition, the transfer control unit 115 instructs the
first access unit 102 to perform a writing process such that the
information about the size of the cluster set which is acquired
from the writing unit 111 is stored in the address mapping table
160 for the cluster written to the page.
[0126] The transfer control unit 115 repeatedly performs the
above-mentioned process according to a predetermined method.
[0127] The data storage device 100 may be configured such that the
compression unit 104 determines whether to perform compression on
the basis of, for example, the reception speed of data by the
interface unit 106. For example, when the reception speed of data
by the interface unit 106 is reduced due to the compression of the
compression unit 104, the data storage device 100 performs control
such that the compression unit 104 does not perform compression.
The data storage device 100 may be configured such that, when the
read control unit 114 reads data which has not been compressed by
the compression unit 104 from, for example, the storage medium 151,
the decompression unit 105 does not decompress the data.
[0128] Next, the operation of the data storage device 100 according
to the first embodiment will be described. First, the procedure of
the writing process performed by the data storage device 100 in
response to a write instruction from the host apparatus (not
illustrated) will be described with reference to FIG. 5. FIG. 5 is
a flowchart illustrating an example of the procedure of the writing
process performed by the data storage device 100.
[0129] (Writing Process)
[0130] In Step S100, the data storage device 100 receives
instructions including a write instruction and a read instruction
from, for example, an external host apparatus (not illustrated).
Specifically, the interface unit 106 receives a write instruction
from the host apparatus (not illustrated). The write instruction
includes the data storage device address information and the write
data. The read instruction includes the data storage device address
information. The data storage device address information is address
information which is provided from the data storage device 100 to
the host apparatus (not illustrated).
[0131] For example, an LBA is an example of the data storage device
address information of an HDD (Hard Disk Drive) or an SSD. The size
of the data specified by LBA is set to, for example, 512 bytes. As
described above, the size of the data specified by the data storage
device address is generally different from the size of the data
(cluster) specified by the logical address. However, the data
storage device address and the logical address can be converted
into each other. For example, when the data storage device address
information is allocated for every 512 bytes and the logical
address is allocated for every 1024 bytes, the quotient of the data
storage device address information divided by 2 can be calculated
to convert the data storage device address information into the
logical address.
[0132] In the first embodiment, for simplicity of explanation, an
example in which the size of the data specified by the data storage
device address is equal to the size of the cluster will be
described. However, the invention is not limited thereto. The data
storage device 100 may be configured such that the size of the data
specified by the data storage device address is different from the
size of the cluster. When the received instruction is a write
instruction, the interface unit 106 transmits the received write
instruction to the write control unit 113.
[0133] In Step S102, the write control unit 113 generates write
destination information. Specifically, when receiving the write
instruction from the interface unit 106, the write control unit 113
extracts the data storage device address information and the write
data from the received write instruction. Then, the write control
unit 113 converts the extracted data storage device address
information into a corresponding logical address. In addition, the
write control unit 113 shifts the write destination information
transmitted in the previous cluster write request for the writing
unit 111 by the size of the cluster set returned from the writing
unit 111 in the previous cluster write request for the writing unit
111 to generate the write destination information.
[0134] Specifically, as illustrated in FIG. 4, the write
destination information transmitted in the previous cluster write
request for the writing unit 111 includes the block number of the
write destination of the cluster, the page number, and the
information about the page offset. The write control unit 113 adds,
to the information about the page offset, the size of the cluster
set indicated by the information about the size of the cluster set
which is returned from the writing unit 111 in the previous cluster
write request for the writing unit 111, thereby generating the
write destination information. When the next write destination
information is given to the writing unit 111 (when the cluster is
stored across the pages) in the previous cluster write request for
the writing unit 111, the write control unit 113 shifts the next
write destination information by the remaining size of the cluster
set to generate the write destination information.
[0135] Specifically, the next write destination information
includes the block number of the write destination of the cluster,
the page number, and the information about the page offset which
indicates the position of the head of the page. The write control
unit 113 adds the remaining size of the cluster set to the
information about the page offset to generate the write destination
information. When the block 400 to which the data which is
requested to be written by the host apparatus (not illustrated) is
written is the same as a transfer destination block 400, the write
control unit 113 and the transfer control unit 115 perform a
process in cooperation with each other such that the generated
write destination information items do not overlap each other. The
write control unit 113 transmits the generated write destination
information, the extracted write data, which is the cluster data to
be written, and the converted logical address in which the cluster
to be written to the writing unit 111 and instructs the writing
unit 111 to perform a writing process. The writing unit 111
receives a cluster write request from the write control unit 113.
The cluster write request includes write destination information,
cluster data to be written, and data indicating the logical address
of the cluster to be written. The write destination information
includes the block number of the write destination of the cluster,
the page number, and the information about the page offset.
[0136] In Step S104, the writing unit 111 transmits a compression
instruction to the compression unit 104 (if necessary).
Specifically, the writing unit 111 extracts the cluster data to be
written from the received cluster write request. The writing unit
111 transmits the extracted cluster data to be written to the
compression unit 104 and instructs the compression unit 104 to
compress the cluster data. When receiving an instruction to
compress data, the compression unit 104 reversibly compresses the
instructed data using a predetermined method and returns the
compressed data to a request source which has requested the
compression. Then, the writing unit 111 acquires the compressed
cluster data to be written from the compression unit 104. When
there is no necessity to compress the cluster data, the writing
unit 111 processes the extracted cluster data to be written in the
same way as that in which the compressed cluster data to be written
is processed, without transmitting the cluster data to the
compression unit 104 (the cluster data is regarded as the
compressed cluster data to be written). For example, when there is
little difference between the size of data obtained by compressing
the extracted cluster data to be written and the size of the
cluster data before compression, the effect of compressing the
cluster data is small. Therefore, it is not necessary to compress
the cluster data. In this case, the writing unit 111 may not
transmit the cluster data to the compression unit 104.
[0137] In Step S106, the writing unit 111 generates a cluster set.
Specifically, the writing unit 111 extracts data indicating the
logical address of the cluster to be written from the received
cluster write request and generates metadata including the
extracted data indicating the logical address of the cluster to be
written. When the metadata included in the cluster set is
compressed, the writing unit 111 may instruct the compression unit
104 to compress the generated metadata, acquire the compressed
metadata from the compression unit 104, and replace the generated
metadata with the acquired compressed metadata. The writing unit
111 generates error correction data on the basis of the compressed
cluster data to be written and data including the generated
metadata. Then, the writing unit 111 generates the cluster set
including the compressed cluster data to be written, the generated
metadata, and the generated error correction data.
[0138] In Step S108, the writing unit 111 calculates the size of
the generated cluster set. Then, the writing unit 111 determines
whether the generated cluster set is fitted into a write
destination page. Specifically, the writing unit 111 calculates the
size of the generated cluster set. Then, the writing unit 111
determines whether the generated cluster set is fitted into the
write destination page. Specifically, the writing unit 111
determines whether the sum of the information about the page offset
included in the write destination information and the calculated
size of the cluster set is within the size of the page.
[0139] In Step S110, the second memory 153 temporarily stores a
plurality of cluster sets to be written. Specifically, when the
determination result in Step S108 is YES (the cluster set is fitted
into the write destination page), the writing unit 111 instructs
the second access unit 103 to perform a writing process such that
the second memory 153 temporarily stores the generated cluster set.
In addition, the writing unit 111 returns the information about the
size of the cluster set to a write request source. The write
control unit 113 receives the size of the cluster set from the
writing unit 111.
[0140] In Step S112, the writing unit 111 and the write control
unit 113 perform terminal processing. Specifically, when the
determination result in Step S108 is No (the cluster set is not
fitted into the write destination page), the writing unit 111
returns a response indicating the overflow of the write destination
page to the write request source. When the response indicating the
overflow of the write destination page is received from the writing
unit 111 and the physical addresses are consecutive in the same
management unit managing the block 400, the write control unit 113
gives the next write destination information to the writing unit
111. When receiving the next write destination information from the
write request source, the writing unit 111 instructs the second
access unit 103 to perform a writing process such that the second
memory 153 temporarily stores the generated cluster set. In
addition, the writing unit 111 returns the information about the
size of the cluster set to the write request source. The write
control unit 113 receives the size of the cluster set from the
writing unit 111. Then, the process proceeds to Step S114. The
write control unit 113 may appropriately instruct the writing unit
111 to write the dummy data even when the physical addresses are
not consecutive in the same management unit managing the block 400.
When receiving an instruction to store the dummy data from the
write request source, the writing unit 111 generates dummy data
corresponding to the size of the area in which the cluster set is
not stored in the write destination page. The dummy data may have a
predetermined value (for example, all zero) or a random value.
Then, the writing unit 111 instructs the second access unit 103 to
perform a writing process such that the second memory 153
temporarily stores the generated dummy data.
[0141] The writing unit 111 may be configured so as to generate the
error correction data of the cluster set which is temporarily
stored in the second memory 153, instead of the dummy data. When
the error correction data of the cluster set temporarily stored in
the second memory 153 is generated, it is possible to improve the
reliability of the data stored in the storage medium 151. In
addition, the cluster sets may be stored in the second memory 153
such that the order thereof is appropriately changed, thereby
reducing the amount of dummy data stored in the second memory 153.
When the amount of dummy data stored in the second memory 153 is
reduced, it is possible to improve the usage efficiency of the
storage medium 151. When instructing the writing unit 111 to write
the dummy data, the write control unit 113 ensures a new write
destination page in order to write the cluster data, which is a
write target, and performs the writing process again from Step
S102.
[0142] In Step S114, the writing unit 111 determines whether the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of one page. When the total size
of the data temporarily stored in the second memory 153 is not
equal to or more than the size of the page 402 (No in Step S114),
the writing unit 111 proceeds to Step S100. When the total size of
the data temporarily stored in the second memory 153 is equal to or
more than the size of the page 402 (Yes in Step S114), the writing
unit 111 proceeds to Step S116.
[0143] In Step S116, the writing unit 111 writes data corresponding
to one page to the storage medium 151 through the storage medium
access unit 101. Specifically, when the total size of the data
temporarily stored in the second memory 153 is equal to or more
than the size of the page 402, the writing unit 111 instructs the
second access unit 103 to read data corresponding to the page size
from the second memory 153. Then, the writing unit 111 acquires the
data corresponding to the page size. Specifically, the writing unit
111 instructs the second access unit 103 to read data stored in the
left page of FIG. 3B among the data pieces temporarily stored in
the second memory 153.
[0144] In a case in which the data storage device 100 includes a
plurality of storage media 151 and parallel access to the storage
media 151 is performed to improve the processing speed, when the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of the pages 402 to which data is
written in parallel, the writing unit 111 instructs the second
access unit 103 to read data corresponding to the size of the pages
to which data is written in parallel from the second memory
153.
[0145] Then, the writing unit 111 instructs the storage medium
access unit 101 to write the data corresponding to the page size
(or the size of the pages to which data is written in parallel)
which is acquired through the second access unit 103 to the write
destination pages (or each page to which data is written in
parallel).
[0146] Here, the write destination page is the left page of FIG.
3B. The writing unit 111 instructs the storage medium access unit
101 to write the block number of the write destination of the
cluster and the page number which are included in the write
destination information received from the write request source.
When receiving an instruction to write data to the storage medium
151, the storage medium access unit 101 inputs the data which is
instructed to be written to the storage medium 151 and performs a
writing process.
[0147] In Step S118, the write control unit 113 updates the
management information. Specifically, the writing unit 111
transmits a notice indicating that the writing of data to the write
destination page has been completed to the write request source.
The write destination page is the left page of FIG. 3B and the
writing unit 111 notifies the write request source of the block
number of the write destination of the cluster and the page number
included in the write destination information received from the
write request source. When receiving the write completion notice
from the writing unit 111, the write control unit 113 updates the
address mapping table 160 for the cluster written to the page.
Specifically, the write control unit 113 instructs the first access
unit 102 to perform a writing process such that the physical
address of the storage medium 151 indicated by the converted
logical address in the address mapping table 160 is updated to the
physical address of the storage medium 151, which is a write
destination, for the cluster written to the page. In addition, the
write control unit 113 instructs the first access unit 102 to
perform a writing process such that the information about the size
of the cluster set acquired from the writing unit 111 is written to
the address mapping table 160 for the cluster written to the page
(see FIG. 4).
[0148] Next, the procedure of the reading process performed by the
data storage device 100 in response to a read instruction from the
host apparatus (not illustrated) will be described with reference
to FIG. 6. FIG. 6 is a flowchart illustrating an example of the
procedure of the reading process performed by the data storage
device 100.
[0149] (Reading Process)
[0150] In Step S200, the data storage device 100 receives a read
instruction from, for example, an external host apparatus (not
illustrated). Specifically, the interface unit 106 receives
instructions including a write instruction and a read instruction
from, for example, the host apparatus (not illustrated). The write
instruction includes the data storage device address information
and the write data. The read instruction includes the data storage
device address information. The data storage device address
information is address information which is provided from the data
storage device 100 to the host apparatus (not illustrated).
[0151] For example, an LBA is an example of the data storage device
address information of an HDD (Hard Disk Drive) or an SSD. The size
of the data specified by LBA is set to, for example, 512 bytes. As
described above, the size of the data specified by the data storage
device address is generally different from the size of the data
(cluster) specified by the logical address. However, the data
storage device address and the logical address can be converted
into each other. For example, when the data storage device address
information is allocated for every 512 bytes and the logical
address is allocated for every 1024 bytes, the quotient of the data
storage device address information divided by 2 can be calculated
to convert the data storage device address information into the
logical address.
[0152] In the first embodiment, for simplicity of explanation, an
example in which the size of the data specified by the data storage
device address is equal to the size of the cluster will be
described. However, the invention is not limited thereto. The data
storage device 100 may be configured such that the size of the data
specified by the data storage device address is different from the
size of the cluster. When the received instruction is a read
instruction, the interface unit 106 transmits the received read
instruction to the read control unit 114.
[0153] In Step S202, the read control unit 114 generates read
destination information. Specifically, when receiving the read
instruction from the interface unit 106, the read control unit 114
extracts the data storage device address information from the
received read instruction. Then, the read control unit 114 converts
the extracted data storage device address information into a
corresponding logical address. In addition, the read control unit
114 acquires information associated with the converted logical
address. Specifically, the read control unit 114 instructs the
first access unit 102 to read the physical address of the storage
medium 151 and the information about the size of the cluster set
indicated by the converted logical address in the address mapping
table 160. Then, the read control unit 114 acquires the physical
address and the information about the size of the cluster set. The
read control unit 114 determines whether the cluster set is stored
across the pages on the basis of the information about the page
offset which is included in the acquired physical address and the
acquired information about the size of the cluster set. When the
determination result is YES (the cluster set is stored across the
pages), the read control unit 114 generates information about
consecutive read destination pages. Specifically, the information
about consecutive read destination pages includes the block number
and the page number. Here, the block number and numbers subsequent
to the page number included in the acquired physical address are
newly set as the block number and the page number included in the
information about consecutive read destination pages.
[0154] For example, when the pages with consecutive page numbers in
the same block 400 correspond to a case in which the physical
addresses are consecutive in the same management unit managing the
block 400 described in FIG. 3B, the block number and numbers
subsequent to the page number are newly set. For example, when the
left page of FIG. 3B is a page with page number 34 in a block with
block number 66 on the basis of the acquired physical address, the
right page of FIG. 3B is a page with page number 35 in the same
block (block number 66) on the basis of the information about
consecutive read destination pages. When the physical addresses are
consecutive in the same management unit managing the block 400
described in FIG. 3B, consecutive pages in the same logical page,
or pages with consecutive logical page numbers in the same logical
block are as follows. For example, a block with block number 5, a
block with block number 97, a block with block number 36, and a
block with block number 104 form a logical block with logical block
number 49 and the clusters are written to the logical page in this
order.
[0155] For the former, for example, when the left page of FIG. 3B
is a page with page number 40 in the block with block number 5 on
the basis of the acquired physical address, the right page of FIG.
3B is a page with page number 40 in the block with block number 97
on the basis of the information about consecutive read destination
pages. For the latter, for example, when the left page of FIG. 3B
is a page with logical page number 34 in a logical block with
logical block number 66, the right page of FIG. 3B is a page with
logical page number 35 in the same logical block (logical block
number 66) on the basis of the information about consecutive read
destination pages.
[0156] In Step S204, the read control unit 114 reads data, which is
a read target, through the reading unit 112. Specifically, the read
control unit 114 instructs the reading unit 112 to perform a
reading process, using the acquired physical address and the
acquired information about the size of the cluster set as read
destination information and the converted logical address as the
logical address of the cluster to be read. When the cluster set to
be read is stored across the pages, the read control unit 114 adds
the generated information items about consecutive read destination
pages and transmits the added information to the reading unit
112.
[0157] The reading unit 112 receives a request to read the cluster
from a read request source. The read destination information
includes data indicating the logical address of the cluster to be
read. The read destination information includes the block number,
the page number, the information about the page offset, and the
information about the size of the cluster set. When the cluster set
to be read is stored across the pages, the reading unit 112 also
receives information about consecutive read destination pages. The
information about consecutive read destination pages includes the
block number and the page number.
[0158] The reading unit 112 extracts the block number and the page
number from the acquired read destination information and instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number. Then, the reading unit 112 acquires the data of the
page from the storage medium access unit 101.
[0159] When the cluster set to be read is stored across the pages,
the reading unit 112 extracts the block number and the page number
from the acquired information about consecutive read destination
pages and instructs the storage medium access unit 101 to read the
data of the pages 402 with the extracted page numbers in the block
400 with the extracted block number. Then, the reading unit 112
further acquires the data of the pages from the storage medium
access unit 101. The reading unit 112 extracts the information
about the page offset and the information about the size of the
cluster set from the acquired read destination information. The
reading unit 112 extracts data with the size indicated by the
extracted information about the size of the cluster set, using the
position indicated by the extracted information about the page
offset as a read start position in the acquired page. When the
cluster set to be read is stored across the pages, the reading unit
extracts data corresponding to the remaining size of the cluster
set from the position of the head of the consecutive read
destination pages and adds the extracted data and the previously
extracted data to generate data for the cluster set.
[0160] In Step S206, the read control unit 114 decompresses the
data to be read using the decompression unit 105 and returns the
decompressed data to the host apparatus. Specifically, the reading
unit 112 corrects the error of the data for the cluster set and
acquires the error corrected data for the cluster set.
Specifically, the reading unit 112 uses data including the metadata
and the cluster data as the basic data for generating error
correction data in the data for the cluster set. In addition, the
reading unit 112 corrects the error of the data for the cluster set
and acquires the error corrected data for the cluster set.
[0161] When error correction fails (error correction is
unavailable), the reading unit 112 notifies the read request source
of the occurrence of a read error. When receiving a notice
indicating the occurrence of the read error from the reading unit
112, the read control unit 114 transmits data indicating the read
error to the interface unit 106. The first memory 152 may further
store information indicating that the read error occurs when the
logical address is read as one of the management information items.
When receiving data (data indicating the read error) from the read
control unit 114, the interface unit 106 transmits the received
data (data indicating the read error) to the host apparatus (not
illustrated). When error correction succeeds (error correction is
available), the reading unit 112 extracts the cluster data from the
error corrected data for the cluster set. The reading unit 112
transmits the extracted cluster data to the decompression unit 105
and instructs the decompression unit 105 to decompress the
extracted cluster data. When receiving an instruction to decompress
the data compressed by the compression unit 104, the decompression
unit 105 decompresses the instructed data using a predetermined
method and returns the decompressed data to the request source
which has requested decompression. Then, the reading unit 112
acquires the cluster data decompressed by the decompression unit
105.
[0162] When it is not necessary to decompress the cluster data, the
reading unit 112 may process the extracted cluster data in the same
way as that in which the decompressed cluster data is processed,
without transmitting the extracted cluster data to the
decompression unit 105. For example, when the cluster data is
stored in the storage medium 151 without being compressed, the
reading unit 112 processes the extracted cluster data in the same
way as that in which the decompressed cluster data is processed,
without transmitting the extracted cluster data to the
decompression unit 105. Then, the reading unit 112 transmits the
decompressed cluster data (or the extracted cluster data which does
not need to be decompressed) to the read request source.
[0163] When receiving the data read from the reading unit 112, the
read control unit 114 transmits the received data to the interface
unit 106. When receiving the data from the read control unit 114,
the interface unit 106 transmits the received data to the host
apparatus (not illustrated).
[0164] Next, the procedure of the transfer process performed by the
data storage device 100 will be described with reference to FIG. 7.
FIG. 7 is a flowchart illustrating an example of the procedure of
the transfer process performed by the data storage device 100. The
transfer control unit 115 controls the transfer process illustrated
in FIG. 7 according to a predetermined rule.
[0165] (Transfer Process)
[0166] In Step S300, the transfer control unit 115 determines the
cluster to be transferred. Specifically, the transfer control unit
115 instructs the first access unit 102 to read the management
information stored in the first memory 152 and acquires the
management information. The transfer control unit 115 determines
the cluster to be transferred from the acquired management
information using a predetermined method. In the first embodiment,
any known method may be used to determine the cluster to be
transferred. The transfer control unit 115 extracts the logical
address of the determined cluster from the acquired management
information.
[0167] In Step S302, the transfer control unit 115 generates read
destination information. Specifically, the transfer control unit
115 acquires information associated with the extracted logical
address. For example, the transfer control unit 115 instructs the
first access unit 102 to read the physical address of the storage
medium 151 and the information about the size of the cluster set
indicated by the extracted logical address in the address mapping
table 160. The transfer control unit 115 acquires the physical
address and the information about the size of the cluster set. The
transfer control unit 115 determines whether the cluster set is
stored across the pages on the basis of the information about the
page offset included in the acquired physical address and the
acquired information about the size of the cluster set. When the
determination result is YES (the cluster set is stored across the
pages), the transfer control unit 115 generates information about
consecutive read destination pages. The information about
consecutive read destination pages includes a block number and a
page number.
[0168] Here, the block number and numbers subsequent to the page
number included in the acquired physical address are newly set as
the block number and the page number included in the information
about consecutive read destination pages. For example, when the
pages with consecutive page numbers in the same block 400
correspond to a case in which the physical addresses are
consecutive in the same management unit managing the block 400
described in FIG. 3B, the block number and numbers subsequent to
the page number are newly set. For example, when the left page of
FIG. 3B is the page with page number 34 in the block with block
number 66 on the basis of the acquired physical address, the right
page of FIG. 3B is the page with page number 35 in the same block
(block number 66) on the basis of the information about the
consecutive read destination pages.
[0169] When the physical addresses are consecutive in the same
management unit managing the block 400 described in FIG. 3B,
consecutive pages in the same logical page, or pages with
consecutive logical page numbers in the same logical block are as
follows. For example, a block with block number 5, a block with
block number 97, a block with block number 36, and a block with
block number 104 form a logical block with logical block number 49
and the clusters are written to the logical page in this order.
[0170] For the former, for example, when the left page of FIG. 3B
is a page with page number 40 in the block with block number 5 on
the basis of the acquired physical address, the right page of FIG.
3B is a page with page number 40 in the block with block number 97
on the basis of the information about consecutive read destination
pages. For the latter, for example, when the left page of FIG. 3B
is a page with logical page number 34 in a logical block with
logical block number 66, the right page of FIG. 3B is a page with
logical page number 35 in the same logical block (logical block
number 66) on the basis of the information about consecutive read
destination pages.
[0171] In Step S304, the transfer control unit 115 reads data,
which is a read target, through the reading unit 112. The transfer
control unit 115 instructs the reading unit 112 to perform a
reading process, using the acquired physical address and the
acquired information about the size of the cluster set as read
destination information and the converted logical address as the
logical address of the cluster to be read. When the cluster set to
be read is stored across the pages, the transfer control unit 115
adds the generated information items about consecutive read
destination pages and transmits the added information to the
reading unit 112.
[0172] The reading unit 112 receives a cluster read request from a
read request source. The cluster read request includes read
destination information and data indicating the logical address of
the cluster to be read. The read destination information includes
the block number, the page number, the information about the page
offset, and the information about the size of the cluster set. When
the cluster set to be read is stored across the pages, the reading
unit 112 also receives information about consecutive read
destination pages. The information about consecutive read
destination pages includes the block number and the page
number.
[0173] The reading unit 112 extracts the block number and the page
number from the acquired read destination information and instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number. Then, the reading unit 112 acquires the data of the
page from the storage medium access unit 101. When the cluster set
to be read is stored across the pages, the reading unit 112
extracts the block number and the page number from the acquired
information about consecutive read destination pages and instructs
the storage medium access unit 101 to read the data of the pages
402 with the extracted page numbers in the block 400 with the
extracted block number. Then, the reading unit 112 further acquires
the data of the pages from the storage medium access unit 101.
[0174] The reading unit 112 extracts the information about the page
offset and the information about the size of the cluster set from
the acquired read destination information. The reading unit 112
extracts data with the size indicated by the extracted information
about the size of the cluster set, using the position indicated by
the extracted information about the page offset as a read start
position in the acquired page. When the cluster set to be read is
stored across the pages, the reading unit extracts data
corresponding to the remaining size of the cluster set from the
position of the head of the consecutive read destination pages and
adds the extracted data and the previously extracted data to
generate data for the cluster set.
[0175] In Step S306, the transfer control unit 115 decompresses the
data to be read using the decompression unit 105 and acquires the
decompressed data. Specifically, the reading unit 112 corrects the
error of the data for the cluster set and acquires the error
corrected data for the cluster set. Specifically, the reading unit
112 uses data including metadata and cluster data as the basic data
for generating error correction data in the data for the cluster
set. In addition, the reading unit 112 corrects the error of the
data for the cluster set and acquires the error corrected data for
the cluster set. When error correction fails (error correction is
unavailable), the reading unit 112 notifies the read request source
of the occurrence of a read error.
[0176] Specifically, when receiving a notice indicating the
occurrence of the read error from the reading unit 112, the
transfer control unit 115 performs a process of maintaining
consistency such that an error occurs when the cluster is read
after the transfer process. For example, the transfer control unit
115 may transfer the cluster data with the read error, without
correcting the read error. In addition, the transfer control unit
115 may insert information indicating that the read error occurs
when the logical address is read into the management information
stored in the first memory 152 such that the cluster data with the
read error is not transferred.
[0177] When error correction succeeds (error correction is
available), the reading unit 112 extracts cluster data from the
error corrected data for the cluster set. The reading unit 112
transmits the extracted cluster data to the decompression unit 105
and instructs the decompression unit 105 to decompress the
extracted cluster data. Then, the reading unit 112 acquires the
cluster data decompressed by the decompression unit 105.
[0178] When it is not necessary to decompress the cluster data, the
reading unit 112 may process the extracted cluster data in the same
way as that in which the decompressed cluster data is processed,
without transmitting the extracted cluster data to the
decompression unit 105. For example, when the cluster data is
stored in the storage medium 151 without being compressed, the
reading unit 112 processes the extracted cluster data in the same
way as that in which the decompressed cluster data is processed,
without transmitting the extracted cluster data to the
decompression unit 105. Then, the reading unit 112 transmits the
decompressed cluster data (or the extracted cluster data which does
not need to be decompressed) to the read request source. The
transfer control unit 115 receives the data to be read from the
reading unit 112.
[0179] In Step S308, the transfer control unit 115 generates write
destination information. Specifically, the transfer control unit
115 shifts the write destination information transmitted in the
previous cluster write request for the writing unit 111 by the size
of the cluster set indicated by the information about the size of
the cluster set which is returned from the writing unit 111 in the
previous cluster write request for the writing unit 111, thereby
generating write destination information. The write destination
information transmitted in the previous cluster write request for
the writing unit 111 includes the block number of the write
destination of the cluster, the page number, and the information
about the page offset. The write control unit 113 adds, to the
information about the page offset, the size of the cluster set
indicated by the information about the size of the cluster set
which is returned from the writing unit 111 in the previous cluster
write request for the writing unit 111, thereby generating the
write destination information.
[0180] In the previous cluster write request for the writing unit
111, when the next write destination information is given to the
writing unit 111 (the cluster is stored across the pages), the
transfer control unit 115 shifts the next write destination
information by the remaining size of the cluster set to generate
write destination information. The next write destination
information includes the block number of the write destination of
the cluster, the page number, and the information about the page
offset indicating the position of the head of the page. The
transfer control unit 115 adds the remaining size of the cluster
set to the information about the page offset to generate the write
destination information. When the block 400 to which the data which
is requested to be written by the host apparatus (not illustrated)
is written is the same as a transfer destination block 400, the
write control unit 113 and the transfer control unit 115 perform a
process in cooperation with each other such that the generated
write destination information items do not overlap each other.
[0181] The transfer control unit 115 transmits the generated write
destination information, the data which is received as the cluster
data to be transferred from the reading unit 112, and the extracted
logical address to the writing unit 111. Then, the write control
unit 113 instructs the writing unit 111 to perform a writing
process. The writing unit 111 receives a cluster write request from
the transfer control unit 115. The cluster write request includes
write destination information, cluster data to be written, and data
indicating the logical address of the cluster to be written. The
write destination information includes the block number of the
write destination of the cluster, the page number, and the
information about the page offset.
[0182] In Step S310, the writing unit 111 compresses the cluster
data using the compression unit 104 (if necessary). Specifically,
the writing unit 111 extracts the cluster data to be written from
the received cluster write request. The writing unit 111 transmits
the extracted cluster data to be written to the compression unit
104 and instructs the compression unit 104 to compress the cluster
data. Then, the writing unit 111 acquires the cluster data to be
written which is compressed by the compression unit 104.
[0183] When there is no necessity to compress the cluster data, the
writing unit 111 processes the extracted cluster data to be written
in the same way as that in which the compressed cluster data to be
written is processed, without transmitting the cluster data to the
compression unit 104 (the cluster data is regarded as the
compressed cluster data to be written).
[0184] In Step S312, the writing unit 111 generates a cluster set.
Specifically, the writing unit 111 extracts data indicating the
logical address of the cluster to be written from the received
cluster write request and generates metadata including the
extracted data indicating the logical address of the cluster to be
written. When the metadata included in the cluster set is
compressed, the writing unit 111 may instruct the compression unit
104 to compress the generated metadata, acquire the compressed
metadata from the compression unit 104, and replace the generated
metadata with the acquired compressed metadata.
[0185] The writing unit 111 generates the error correction data on
the basis of the compressed cluster data to be written and data
including the generated metadata. Then, the writing unit 111
generates a cluster set including the compressed cluster data to be
written, the generated metadata, and the generated error correction
data.
[0186] In Step S314, the writing unit 111 determines whether the
generated cluster set is fitted into the page. Specifically, the
writing unit 111 calculates the size of the generated cluster set.
Then, the writing unit 111 determines whether the generated cluster
set is fitted into the write destination page. Specifically, the
writing unit 111 determines whether the sum of the information
about the page offset included in the write destination information
and the calculated size of the cluster set is within the size of
the page.
[0187] In Step S316, the second memory 153 temporarily stores a
plurality of cluster sets to be written. Specifically, when the
determination result in Step S314 is YES (the cluster set is fitted
into the write destination page), the writing unit 111 instructs
the second access unit 103 to perform a writing process such that
the second memory 153 temporarily stores the generated cluster set.
In addition, the writing unit 111 returns the information about the
size of the cluster set to the write request source. The transfer
control unit 115 receives the size of the cluster set from the
writing unit 111.
[0188] In Step S318, the writing unit 111 and the transfer control
unit 115 perform terminal processing. Specifically, when the
determination result in Step S318 is No (the cluster set is not
fitted into the write destination page), the writing unit 111
returns a response indicating the overflow of the write destination
page to the write request source. When the response indicating the
overflow of the write destination page is received from the writing
unit 111 and the physical addresses are consecutive in the same
management unit managing the block 400, the transfer control unit
115 gives the next write destination information to the writing
unit 111. When receiving the next write destination information
from the write request source, the writing unit 111 instructs the
second access unit 103 to perform a writing process such that the
second memory 153 temporarily stores the generated cluster set. In
addition, the writing unit 111 returns the information about the
size of the cluster set to the write request source. The transfer
control unit 115 receives the size of the cluster set from the
writing unit 111. Then, the process proceeds to Step S320.
[0189] In some cases, the transfer control unit 115 instructs the
writing unit 111 to write the dummy data. For example, the transfer
control unit 115 may appropriately instruct the writing unit 111 to
write the dummy data even when the physical addresses are not
consecutive in the same management unit managing the block 400.
When receiving an instruction to store the dummy data from the
write request source, the writing unit 111 generates dummy data
corresponding to the size of the area in which the cluster set is
not stored in the write destination page. Then, the writing unit
111 instructs the second access unit 103 to perform a writing
process such that the second memory 153 temporarily stores the
generated dummy data.
[0190] The writing unit 111 may be configured so as to generate the
error correction data of the cluster set which is temporarily
stored in the second memory 153, instead of the dummy data. When
the error correction data of the cluster set temporarily stored in
the second memory 153 is generated, it is possible to improve the
reliability of the data stored in the storage medium 151. In
addition, the cluster sets may be stored in the second memory 153
such that the order thereof is appropriately changed, thereby
reducing the amount of dummy data stored in the second memory 153.
When the amount of dummy data stored in the second memory 153 is
reduced, it is possible to improve the usage efficiency of the
storage medium 151. When instructing the writing unit 111 to write
the dummy data, the transfer control unit 115 ensures a new write
destination page in order to write the cluster data, which is a
write target, and performs the writing process again from Step
S308.
[0191] In Step S320, the writing unit 111 determines whether the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of one page. When the total size
of the data temporarily stored in the second memory 153 is not
equal to or more than the size of the page 402 (No in Step S320),
the writing unit 111 proceeds to Step S300. When the total size of
the data temporarily stored in the second memory 153 is equal to or
more than the size of the page 402 (Yes in Step S320), the writing
unit 111 proceeds to Step S322. The reason is as follows. Since the
unit of input and output for the storage medium 151 is the page
402, the transfer control unit 115 needs to write data
corresponding to at least one page in order to perform a process of
updating the management information, which will be described.
Therefore, the transfer process is not completed.
[0192] In Step S322, the writing unit 111 writes data corresponding
to one page to the storage medium 151 through the storage medium
access unit 101. Specifically, when the total size of the data
temporarily stored in the second memory 153 is equal to or more
than the size of the page 402, the writing unit 111 instructs the
second access unit 103 to read data corresponding to the page size
from the second memory 153. Then, the writing unit 111 acquires the
data corresponding to the page size. Specifically, the writing unit
111 instructs the second access unit 103 to read data stored in the
left page of FIG. 3B among the data pieces temporarily stored in
the second memory 153 and acquires data corresponding to the page
size.
[0193] In a case in which the data storage device 100 includes a
plurality of storage media 151 and parallel access to the storage
media 151 is performed to improve the processing speed, when the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of the pages 402 to which data is
written in parallel, the writing unit 111 instructs the second
access unit 103 to read data corresponding to the size of the pages
to which data is written in parallel from the second memory
153.
[0194] Then, the writing unit 111 instructs the storage medium
access unit 101 to write the data corresponding to the page size
(or the size of the pages to which data is written in parallel)
which is acquired through the second access unit 103 to the write
destination pages (or each page to which data is written in
parallel).
[0195] Here, the write destination page is the left page of FIG.
3B. The writing unit 111 instructs the storage medium access unit
101 to write the block number of the write destination of the
cluster and the page number which are included in the write
destination information received from the write request source.
[0196] In Step S324, the transfer control unit 115 updates the
management information. Specifically, the writing unit 111
transmits a notice indicating that the writing of data to the write
destination page has been completed to the write request source.
The write destination page is the left page of FIG. 3B and the
writing unit 111 notifies the write request source of the block
number of the write destination of the cluster and the page number
included in the write destination information received from the
write request source. When receiving the write completion notice
from the writing unit 111, the transfer control unit 115 updates
the address mapping table 160 for the cluster written to the page.
Specifically, the transfer control unit 115 instructs the first
access unit 102 to perform a writing process such that the physical
address of the storage medium 151 indicated by the converted
logical address in the address mapping table 160 is updated to the
physical address of the storage medium 151, which is a write
destination, for the cluster written to the page. In addition, the
transfer control unit 115 instructs the first access unit 102 to
perform a writing process such that the information about the size
of the cluster set acquired from the writing unit 111 is written to
the address mapping table 160 for the cluster written to the page
(see FIG. 4).
[0197] As such, according to the data storage device 100 of the
first embodiment, the compression unit 104 performs the compression
process. Therefore, it is possible to reduce the amount of data
which is actually written to the storage medium 151 with respect to
the total size of data which is requested to be written from the
outside. As a result, it is possible to increase the lifespan of
the data storage device 100, as compared to a data storage device
data without the compression function.
Second Embodiment
[0198] However, when the (compressed) cluster set is stored in the
page 402 as in the first embodiment, the storage efficiency of the
storage medium 151 is improved, but the amount of data managed
increases. In the second embodiment, the size of the cluster set
stored in the page 402 is arranged in a predetermined unit.
[0199] In a controller of a data storage device according to the
second embodiment, the page includes at least one set area with a
size that is an integer multiple of the size of the cluster. The
set area is divided into a plurality of predetermined division
sizes. The write control unit adds dummy data to the compressed
piece of cluster data so that a size of the compressed piece of
cluster data is an integer multiple of the division size. The
transfer control unit adds dummy data to the compressed piece of
cluster data so that a size of the compressed piece of cluster data
is an integer multiple of the division size.
[0200] In the controller of the data storage device according to
the second embodiment, the page includes at least one set area with
a size that is an integer multiple of the size of the cluster. The
set area is divided into a plurality of predetermined division
sizes. The write control unit adds dummy data to the compressed
piece of cluster data so that a size of the compressed piece of
cluster data is an integer multiple of the division size. The
transfer control unit adds dummy data to the compressed piece of
cluster data so that a size of the compressed piece of cluster data
is an integer multiple of the division size. When the size of the
piece of cluster data that is an integer multiple of the division
size is equal to the size of the set area, the write control unit
makes a control that cancels the compression of the piece of
cluster data, and writes the piece of cluster data whose
compression is cancelled to the storage medium using the physical
address of the write destination, and a control that writes a
correspondence between the physical address of the write
destination and the logical address to the storage unit. When the
read piece of cluster data is not compressed, the read control unit
makes a control that outputs the read piece of cluster data without
decompressing by the external decompression unit. When the read
cluster data is not compressed, the transfer control unit makes a
control that does not decompress the read piece of cluster data by
the external decompression unit. When the size of the cluster data
that is an integer multiple of the division size is equal to the
size of the set area, the transfer control unit makes a control
that cancels the compression of the piece of cluster data, writes
the piece of cluster data whose compression is cancelled to the
storage medium using the physical address of the write destination,
and a control that writes a correspondence between the physical
address of the transfer destination and the logical address to the
storage unit.
[0201] In the controller of the data storage device according to
the second embodiment, the storage medium includes a block
including the plurality of set areas. The write control unit makes
a control that writes the pieces of cluster data across the
plurality of set areas with consecutive physical addresses,
respectively, in a management unit in which the block is managed
into the storage medium. When the pieces of cluster data are
written across the plurality of set areas with the consecutive
physical addresses in the management unit in which the block is
managed, the read control unit makes a control that reads the
plurality of set areas and extracts the pieces of cluster data.
When the pieces of cluster data are written across the plurality of
set areas with the consecutive physical addresses in the management
unit in which the block is managed, the transfer control unit makes
a control that reads the plurality of set areas and extracts the
pieces of cluster data. The transfer control unit makes a control
that writes the pieces of cluster data across the plurality of set
areas with consecutive physical addresses, respectively, in the
management unit in which the block is managed into the storage
medium.
[0202] Hereinafter, an example will be described in detail. First,
the structure of the data storage device according to the second
embodiment will be described. In the second embodiment, components
having the same functions as those in the first embodiment are
denoted by the same reference numerals as those in the first
embodiment. For example, the second embodiment differs from the
first embodiment in that a read/write target is not the first
memory 152, but is a first memory 252. The other components have
the same functions as those in the components according to the
first embodiment and are denoted by the same reference numerals as
those in the first embodiment.
[0203] FIG. 8 is a block diagram illustrating the example of the
outline of the functional structure of a data storage device 200
according to the second embodiment. As illustrated in FIG. 8, the
data storage device 200 includes the storage medium access unit
101, the first access unit 102, the second access unit 103, the
compression unit 104, the decompression unit 105, the interface
unit 106, a controller 210, a storage medium 251, the first memory
252, and the second memory 153.
[0204] (Storage Medium 251)
[0205] The storage medium 251 has restrictions in a data storage
format, as compared to the storage medium 151 (FIG. 1).
Specifically, as illustrated in FIG. 9, a page 402 includes a
plurality of slots. The size of the slot is equal to, for example,
the size of a cluster set (or cluster data) which is not compressed
in the storage medium 151. However, the slot is a set area which
may have other sizes. For example, the size of the slot may be an
integer multiple of the size of the cluster set (or cluster data)
which is not compressed.
[0206] The area of the slot in which data can be stored is divided
into a predetermined number of areas. The slot is divided into an
arbitrary number of areas. For example, the size of data (cluster)
which can be identified by a logical address is set to 1024 bytes
and the size of data (sector) which can be identified by a data
storage device address is set to 512 bytes. In this case, the
cluster is divided into two areas when the area of the slot in
which data can be stored is divided by 512 bytes, which are the
size of sector data.
[0207] For example, when the area of the slot in which data can be
stored is divided into four areas, the storage format of the slot
includes, metadata, a first data piece, a first error correction
data piece, a second data piece, a second error correction data
piece, a third data piece, a third error correction data piece, a
fourth data piece, and a fourth error correction data piece, as
illustrated in FIG. 9. The basic data for generating the first
error correction data piece includes the metadata and the first
data piece. The basis data for generating the second error
correction data piece includes the metadata and the second data
piece. The basis data for generating the third error correction
data piece includes the metadata and the third data piece. The
basis data for generating the fourth error correction data piece
includes the metadata and the fourth data piece. Hereinafter, an
example in which the slot is divided into four areas will be
described, but the slot may be divided into any number of
areas.
[0208] When the cluster is compressed and stored, the size of the
compressed data is an integer multiple of the division size. Here,
the division size corresponds to the storage areas of the first to
fourth data pieces illustrated in FIG. 9. That is, the storage
areas of the metadata or the first to fourth error correction data
pieces are not included. Specifically, the size of data obtained by
adding the metadata of the cluster to be compressed and the
compressed cluster data is an integer multiple of the division
size. In addition, the metadata of the cluster to be compressed may
or may not be compressed.
[0209] When the size of the data obtained by adding the metadata of
the cluster to be compressed and the compressed cluster data is
equal to or less than (one time) the division size, dummy data is
stored in the remainder of the area of the data obtained by adding
the metadata of the cluster to be compressed and the compressed
cluster data in the area with the division size (one time), as
illustrated in FIG. 10A. In this way, the size of data is an
integer multiple of the division size. The dummy data may have a
predetermined value (for example, all zero) or a random value. The
dummy data may be error correction data which is generated on the
basis of the data obtained by adding the metadata of the cluster to
be compressed and the compressed cluster data. When the dummy data
is the error correction data, the effect of improving the
reliability of the stored data is obtained.
[0210] In the second embodiment, as described above, an example in
which the cluster data (slot) is divided into four areas will be
described. When the size of the data obtained by adding the
metadata of the cluster to be compressed and the compressed cluster
data is equal to or less than twice the division size, the size of
data is an integer multiple of the division size, as illustrated in
FIG. 10B. When the size of the data obtained by adding the metadata
of the cluster to be compressed and the compressed cluster data is
equal to or less than three times the division size, the size of
data is an integer multiple of the division size, as illustrated in
FIG. 10C. In addition, the size of data is not limited to an
integer multiple of the division size, but may be other values. For
example, the size of data may be a multiple of 2.
[0211] When the size of the data obtained by adding the metadata of
the cluster to be compressed and the compressed cluster data is
equal to or less than four times the division size, that is, when
the size of the data is equal to or less than the size of the
cluster data which is not compressed, the size of the data may be
set as follows. For example, as illustrated in FIG. 10D, the size
of the data may be an integer multiple of the same division size as
that illustrated in FIGS. 10A to 100. In addition, the cluster data
may be stored in a plurality of slots of the page 402 illustrated
in FIG. 9, without being compressed.
[0212] The advantage of the structure in which the cluster data is
compressed and stored and the size is an integer multiple of the
division size is that error correction data, which is generated on
the basis of the data obtained by adding the metadata of the
cluster to be compressed and the compressed cluster data, is dummy
data and the reliability of the stored data is improved. In
addition, only when the cluster is stored across adjacent slots in
the same page or the physical addresses are consecutive in the
range in which the units of management of the block 400 do not
overlap each other (for example, in the same block 400), it is
possible to store data across the pages. Therefore, according to
the second embodiment, it is possible to improve the storage
efficiency of the storage medium 251 and increase the lifespan of
the data storage device 200.
[0213] The advantage of the structure in which the cluster data is
stored without being compressed is that it is possible to reduce
the time required for the compression process during, for example,
the writing process or the time required for the decompression
process during the reading process. The compressed cluster may be
stored across adjacent slots in the same page illustrated in FIG.
11A, similarly to the structure in which the cluster is stored
across the pages illustrated in FIG. 3B. In addition, as
illustrated in FIG. 11B, only when the physical addresses are
consecutive in the range in which the units of management of the
block 400 do not overlap each other, the compressed cluster may be
stored across the pages 402. In FIGS. 11A and 11B, for simplicity
of explanation, the storage area of the metadata or the error
correction data in the slot is not illustrated.
[0214] When the cluster data is compressed and stored, data
indicating a special value (magic number) indicating the
arrangement pattern of the compressed and stored cluster is stored
in the area of the metadata in the storage format of the slot in
the page 402.
[0215] In the second embodiment, as described above, an example in
which the cluster data is divided into four parts. In this case,
for example, the page 402 stores the magic number indicating eight
patterns illustrated in FIG. 12 in the slot. In this way, it is
possible to distinguish a case in which the cluster data is stored
in the slot without being compressed from a case in which the
cluster data is compressed and stored in the slot.
[0216] In the patterns illustrated in FIG. 12, in some cases, the
cluster stored at the head or tail of the slot is stored across
adjacent slots in the same page or across the pages 402, as
illustrated in FIGS. 11A and 11B. Therefore, for the slot, the
pattern indicating the situations may be added to the magic number,
thereby simplifying the process.
[0217] (First Memory 252)
[0218] The first memory 252 (FIG. 8) stores management information
and the management information includes an address mapping table
162. The address mapping table 162 is a table in which the logical
address of the cluster is associated with the physical address of
the storage medium 151 at which data indicated by the logical
address is stored. In addition, the first memory 252 may be
configured so as to store information derived from the information
of the address mapping table 160 in advance in order to simplify
various processes performed by the data storage device 200.
[0219] The address mapping table 162 manages the association
between the logical address of the cluster and the physical address
of the storage medium 251 at which data indicated by the logical
address is stored. The address mapping table 162 is similar to the
address mapping table 160 of the first memory 152 in that the
logical addresses arranged in ascending order are indexes. As
illustrated in FIG. 13, the address mapping table 162 includes, as
elements of the table, a set of block number information, page
number information, information about the offset on a page and
information about the offset on a slot, which are the physical
address of the storage medium 251. In addition, the address mapping
table 162 includes information indicating how many times greater
the size of the data is than the division size instead of
information about the size of the cluster set stored in the address
mapping table 160.
[0220] In the case of adjacent slots in the same page illustrated
in FIG. 11A, or when the physical addresses are consecutive in the
range in which the units of management of the block 400 do not
overlap each other as illustrated in FIG. 11B, the first memory 252
is processed by the same method as that processing the first memory
152 according to the first embodiment. In addition, when a
plurality of storage media 251 are provided and parallel access is
performed, the structure of the address mapping table 162 is the
same as that of the first memory 152 according to the first
embodiment.
[0221] The controller 210 (FIG. 8) includes a writing unit 211, a
reading unit 212, a write control unit 213, a read control unit
214, and a transfer control unit 215.
[0222] (Writing Unit 211)
[0223] The writing unit 211 receives a cluster write request from
the write control unit 213 (or the transfer control unit 215). The
cluster write request includes write destination information,
cluster data to be written, and data indicating the logical address
of the cluster to be written. The write destination information
includes the block number of the write destination of the cluster,
a page number, information about a page offset (a slot offset on a
page), and information about a slot offset (an offset on the
slot).
[0224] A cluster data compression process of the writing unit 211
is the same as that of the writing unit 111. Specifically, the
writing unit 211 extracts the cluster data to be written from the
received cluster write request. The writing unit 211 transmits the
extracted cluster data to be written to the compression unit 104
and instructs the compression unit 104 to compress the cluster
data. Then, the writing unit 211 acquires the cluster data to be
written which is compressed by the compression unit 104.
[0225] The writing unit 211 extracts data indicating the logical
address of the cluster to be written from the received cluster
write request and generates metadata including the extracted data
indicating the logical address of the cluster to be written. When
the metadata included in the cluster set is compressed, the writing
unit 211 treats the compressed metadata the same as the
metadata.
[0226] The writing unit 211 adjusts the size of the data obtained
by adding the generated metadata and the compressed cluster data to
an integer multiple of the division size. Specifically, when the
size of the data obtained by adding the metadata of the cluster to
be compressed and the compressed cluster data is equal to or less
than an integer multiple of the division size, the writing unit 211
generates dummy data corresponding to the remainder of the area of
the data obtained by adding the metadata of the cluster to be
compressed and the compressed cluster data in the area with a size
that is an integer multiple of the division size. The dummy data
may have a predetermined value (for example, all zero) or a random
value. In addition, the dummy data may be error correction data
which is generated on the basis of the data obtained by adding the
metadata of the cluster to be compressed and the compressed cluster
data. When the dummy data is the error correction data, it is
possible to improve the reliability of the stored data. The
detailed example of setting the data size is the same as that in
the storage medium 251.
[0227] The writing unit 211 determines whether data with a size
that is an integer multiple of the division size is fitted into the
slot, which is a write destination. Specifically, the writing unit
211 may determine whether the sum of the information about the
offset on a slot included in the write destination information and
the size that is an integer multiple of the division size is within
the slot.
[0228] When the determination result is YES (the sum is fitted into
the slot, which is a write destination), the writing unit 211
instructs the second access unit 103 to perform a writing process
such that the second memory 153 temporarily stores the data with a
size that is an integer multiple of the division size. In addition,
the writing unit 211 returns information indicating the size of the
data that is an integer multiple of the division size to a write
request source.
[0229] When the determination result is NO (the sum is not fitted
into the slot, which is a write destination), the writing unit 211
returns a response indicating the overflow of the slot, which is a
write destination, to the write request source. When receiving the
next write destination information from the write request source,
the writing unit 211 instructs the second access unit 103 to
perform a writing process such that the second memory 153
temporarily stores the data with a size that is an integer multiple
of the division size. In addition, the writing unit 211 returns the
information indicating the size of the data that is an integer
multiple of the division size to the write request source.
[0230] When receiving an instruction to store the dummy data from
the write request source, the writing unit 211 generates dummy data
corresponding to the size of the remaining area of the slot, which
is a write destination. Then, the writing unit 211 instructs the
second access unit 103 to perform a writing process such that the
second memory 153 temporarily stores the generated dummy data. The
writing unit 211 may be configured so as to generate the error
correction data of the data with a size that is an integer multiple
of the division size which is temporarily stored in the second
memory 153, instead of the dummy data. The writing unit 211 may use
the error correction data of the data with a size that is an
integer multiple of the division size which is temporarily stored
in the second memory 153 to improve the reliability of data. In
addition, the writing unit 211 may appropriately change the order
of the data with a size that is an integer multiple of the division
size to reduce the amount of dummy data stored, thereby improving
the usage efficiency of the storage medium 251. The writing unit
211 repeats the above-mentioned process until data corresponding to
the slot is obtained.
[0231] When data corresponding to one slot is obtained, the writing
unit 211 generates data for a special value (magic number)
indicating the arrangement pattern of the compressed and stored
cluster as the metadata in the storage format of the slot. In
addition, the writing unit 211 generates error correction data in
the storage format of the slot. Specifically, for example, when the
cluster data is divided into four parts, data which is a base for
generating the first error correction data piece includes the
metadata indicating the generated magic number and the first data
piece, as illustrated in FIG. 9. Data which is a base for
generating the second error correction data piece includes the
metadata indicating the generated magic number and the second data
piece. Data which is a base for generating the third error
correction data piece includes the metadata indicating the
generated magic number and the third data piece. Data which is a
base for generating the fourth error correction data piece includes
the metadata indicating the generated magic number and the fourth
data piece.
[0232] The writing unit 211 instructs the second access unit 103 to
perform a writing process such that the metadata indicating the
generated magic number, the data with a size that is an integer
multiple of the division size which is temporarily stored in the
second memory 153, and the generated error correction data are
temporarily stored as data of the slot. In addition, for example,
when there is no necessity to compress data since the data size is
not reduced by compression, the writing unit 211 may store the
extracted cluster data to be written in a plurality of slots of the
page 402 without transmitting the cluster data to the compression
unit 104. The writing unit 211 repeatedly performs the
above-mentioned process until write data corresponding to one page
is obtained.
[0233] When the total size of the data temporarily stored in the
second memory 153 is equal to or more than the size of the page
402, the writing unit 211 instructs the second access unit 103 to
read data corresponding to the page size from the second memory 153
and acquires the data corresponding to the page size. Here, the
writing unit 211 instructs the storage medium access unit 101 to
write, as the write destination page, the block number of the write
destination of the cluster and the page number which are included
in the write destination information received from the write
request source. The writing unit 211 transmits a notice indicating
that the writing of data to the write destination page has been
completed to the write request source.
[0234] In the second embodiment, the block 400 to which data which
is requested to be written by the host apparatus is written is
different from a transfer destination block 400. Therefore, when
the write request source is the transfer control unit 115, the
writing unit 211 performs the same process as that performed when
the write request source is the write control unit 213 on another
write destination page. The data storage device 200 may be
configured such that the block 400 to which data which is requested
to be written by the host apparatus is written is the same as the
transfer destination block 400. In this case, even when there is a
write request from the write control unit 213 or there is a write
request from the transfer control unit 215, the writing unit 211
performs the above-mentioned process on the same write destination
page.
[0235] (Reading Unit 212)
[0236] The reading unit 212 receives a cluster read request from
the read request source. The cluster read request includes read
destination information and data indicating the logical address of
the cluster to be read. The read destination information includes
the block number, the page number, information about the offset on
a page, information about the offset on a slot, and information
indicating how many times greater the size of the data is than the
division size. When the cluster to be read is stored across the
slots or the pages, the reading unit 212 also receives information
about consecutive read destination slots. The information about
consecutive read destination slots includes the block number, the
page number, the information about the offset on a page, and the
information about the offset on a slot.
[0237] The reading unit 212 extracts the block number and the page
number from the acquired read destination information, instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number, and acquires the data of the page. When the cluster
to be read is stored across the slots or the pages, the reading
unit 212 extracts the block number and the page number from the
acquired information about consecutive read destination pages,
instructs the storage medium access unit 101 to read the data of
the pages 402 with the extracted page numbers in the block 400 with
the extracted block number, and further acquires the data of the
pages. When the cluster to be read is stored across adjacent slots
in the same page, the reading unit 212 can read data from the
storage medium 251 using one reading process since data is read
from the storage medium 251 in the unit of the pages 402.
Therefore, when the cluster is stored across adjacent slots in the
same page, the reading unit 212 may perform one reading process to
read data.
[0238] The reading unit 212 extracts the information about the
offset on a page, the information about the offset on a slot, and
the information indicating how many times greater the size of the
data is than the division size from the acquired read destination
information. The reading unit 212 extracts the metadata of the
slot, data with a size that is an integer multiple of the division
size, and the error correction data of the data from the position
by the extracted information about the offset on a page, the
information about the offset on a slot, and the information
indicating how many times greater the size of the data is than the
division size among the data pieces of the acquired page. When the
cluster to be read is stored across the slots or the pages, the
reading unit extracts data corresponding to the remaining size of
the cluster from the position of the head of the consecutive slots
and adds the data pieces to generate data for the cluster.
[0239] The reading unit 212 corrects the error of the extracted
error correction target data using the extracted error correction
data and acquires the error corrected data for the cluster set.
Specifically, the reading unit 212 uses data including the metadata
of the slot and the data with a size that is an integer multiple of
the division size as the basic data for generating the error
correction data, among the extracted data pieces. In addition, the
reading unit 212 performs error correction using the error
correction data among the extracted data pieces and acquires the
error corrected data.
[0240] When error correction fails (error correction is
unavailable), the reading unit 212 notifies the read request source
of the occurrence of a read error. When error correction succeeds
(error correction is available), the reading unit 212 extracts
cluster data from the error corrected data. The reading unit 212
transmits the extracted cluster data to the decompression unit 105
and instructs the decompression unit 105 to decompress the
extracted cluster data. Then, the reading unit 212 acquires the
decompressed cluster data.
[0241] For example, when the cluster data extracted from the error
corrected data is not compressed, the reading unit 212 does not
transmit the cluster data to the decompression unit 105. The
reading unit 212 transmits the acquired decompressed cluster data
to the read request source.
[0242] (Write Control Unit 213)
[0243] When receiving a write instruction from the interface unit
106, the write control unit 213 extracts data storage device
address information and write data from the received write
instruction. Then, the write control unit 213 converts the
extracted data storage device address information into a
corresponding logical address. In addition, the write control unit
213 shifts the write destination information transmitted in the
previous cluster write request for the writing unit 211 by the slot
offset on the basis of the information how many times greater the
size of the data is than the division size which is returned from
the writing unit 211 in the previous cluster write request for the
writing unit 211, thereby generating write destination
information.
[0244] The write destination information transmitted in the
previous cluster write request for the writing unit 211 includes
the block number of the write destination of the cluster, the page
number, and the information about the offset on a page, and the
information about the offset on a slot. Among them, the information
about the offset on a slot is added to an offset indicated by the
information indicating how many times greater the size of the data
is than the division size which is returned from the writing unit
211 in the previous cluster write request for the writing unit 211,
thereby generating the write destination information.
[0245] When the next write destination information is given to the
writing unit 211 (when the cluster is stored across the slots or
the pages) in the previous cluster write request for the writing
unit 211, the next write destination information is shifted by the
remaining size of the multiple of the division size to generate
write destination information. Specifically, the next write
destination information includes the block number of the write
destination of the cluster, the page number, the information about
the offset on a page, and the information about the offset on a
slot which indicates the position of the head of the slot. The
write control unit 213 adds an offset corresponding to the
remainder of the multiple of the division size to the information
about the offset on a slot, thereby generating the write
destination information.
[0246] In the data storage device 200, when the block 400 to which
the data which is requested to be written by the host apparatus is
written is the same as the transfer destination block 400, the
write control unit 213 and the transfer control unit 215 perform a
process in cooperation with each other such that the generated
write destination information items do not overlap each other.
[0247] The write control unit 213 transmits the generated write
destination information, the extracted write data which is the
cluster data to be written, and the logical address which is
converted as the logical address of the cluster to be written to
the writing unit 211 and instructs the writing unit 211 to perform
a writing process.
[0248] When a response indicating the overflow of the slot, which
is a write destination, is received from the writing unit 211 and
the cluster is stored across adjacent slots in the same page or the
physical addresses are consecutive in the range in which the units
of management of the block 400 do not overlap each other, the write
control unit 213 gives the next write destination information to
the writing unit 111.
[0249] In some cases, the write control unit 213 instructs the
writing unit 211 to write the dummy data. In cases other than when
the cluster is stored across adjacent slots in the same page or the
physical addresses are consecutive in the range in which the units
of management of the block 400 do not overlap each other, the write
control unit 213 gives a dummy data storage instruction to the
writing unit 211. When giving the dummy data write instruction to
the writing unit 211, the write control unit 213 ensures a new
write destination slot in order to write the cluster data, which is
a write target, and performs the writing process again.
[0250] Then, the write control unit 213 receives the information
indicating how many times greater the size of the data is than the
division size from the writing unit 211. When receiving a write
completion notice from the writing unit 211, the write control unit
213 updates the address mapping table 162 for the cluster written
to the page. Specifically, the write control unit 213 instructs the
first access unit 102 to perform a writing process such that the
physical address of the storage medium 251 indicated by the
converted logical address in the address mapping table 162 is
updated to the physical address of the storage medium 251, which is
a write destination, for the cluster written to the page.
[0251] In addition, the write control unit 213 instructs the first
access unit 102 to write the information indicating how many times
greater the size of the data is than the division size which is
acquired from the writing unit 211 to the address mapping table 162
for the cluster written to the page.
[0252] (Read Control Unit 214)
[0253] When receiving a read instruction from the interface unit
106, the read control unit 214 extracts the data storage device
address information from the received read instruction. The read
control unit 214 converts the extracted data storage device address
information to a corresponding logical address. The read control
unit 214 acquires information associated with the converted logical
address. Specifically, the read control unit 214 instructs the
first access unit 102 to read the physical address of the storage
medium 251 and the information indicating how many times greater
the size of the data is than the division size which are indicated
by the converted logical address in the address mapping table 162.
Then, the read control unit 214 acquires the physical address and
the information indicating how many times greater the size of the
data is than the division size.
[0254] The read control unit 214 determines whether the cluster is
stored across adjacent slots in the same page or the pages on the
basis of the information about the offset on a page and the
information about the offset on a slot which are included in the
acquired physical address, and the acquired information indicating
how many times greater the size of the data is than the division
size. When the determination result is YES (the cluster is stored
across adjacent slots in the same page or the pages), the read
control unit 214 generates information about consecutive read
destination slots. Specifically, the information about consecutive
read destination slots includes the block number, the page number,
and the information about the offset on a page. When the cluster is
stored across adjacent slots in the same page, the block number and
the page number included in the acquired physical address are set
as the block number and the page number and consecutive information
is set to the information about the offset on a page. In addition,
when the cluster is stored across the pages, the block number
included in the acquired physical address is set to the block
number, consecutive numbers are set to the page numbers, and
information indicating the position of the head is set to the
information about the offset on a page.
[0255] The read control unit 214 instructs the reading unit 212 to
perform a reading process, using the acquired physical address and
the acquired information indicating how many times greater the size
of the data is than the division size as read destination
information and the converted logical address as the logical
address of the cluster to be read. When the cluster to be read is
stored across adjacent slots in the same page or across the pages,
the read control unit 214 adds the generated information items
about consecutive read destination slots and transmits the added
information to the reading unit 212. When the cluster to be read is
stored across adjacent slots in the same page, the cluster is read
from the storage medium 251 by one reading process since data is
read from the storage medium 251 in the unit of the pages 402.
Therefore, the read control unit 214 may read the information about
consecutive read destination slots using one reading process.
[0256] When receiving a notice indicating the occurrence of a read
error from the reading unit 212, the read control unit 214
transmits data indicating the read error to the interface unit 106.
The first memory 252 may further store information indicating that
the read error occurs when the logical address is read as one of
the management information items. In this way, when a read request
for the same logical address is issued again, it is possible to
rapidly return the read error. When receiving the data read by the
reading unit 212, the read control unit 214 transmits the received
data to the interface unit 106.
[0257] (Transfer Control Unit 215)
[0258] The transfer control unit 215 controls the following
transfer process according to a predetermined rule. First, the
transfer control unit 215 determines the cluster to be transferred.
Specifically, the transfer control unit 215 instructs the first
access unit 102 to read the management information from the first
memory 252 and acquires the management information. The transfer
control unit 215 determines the cluster to be transferred from the
acquired management information using a predetermined method. Any
known method may be used to determine the cluster to be
transferred.
[0259] The transfer control unit 215 extracts the logical address
of the determined cluster from the acquired management information.
The transfer control unit 215 reads data for the cluster to be
transferred. Specifically, the transfer control unit 215 acquires
information associated with the extracted logical address. The
transfer control unit 215 instructs the first access unit 102 to
read the physical address of the storage medium 151 and the
information indicating how many times greater the size of the data
is than the division size which are indicated by the extracted
logical address in the address mapping table 162. Then, the
transfer control unit 215 acquires the physical address and the
information indicating how many times greater the size of the data
is than the division size.
[0260] The transfer control unit 215 determines whether the cluster
is stored across adjacent slots in the same page or across the
pages, on the basis of the information about the offset on a page
and the information about the offset on a slot included in the
acquired physical address, and the acquired information indicating
how many times greater the size of the data is than the division
size. When the determination result is YES (the cluster is stored
across adjacent slots in the same page or across the pages), the
transfer control unit 215 generates information about consecutive
read destination slots. Specifically, the information about
consecutive read destination slots includes the block number, the
page number, and information about the offset on a page. When the
cluster is stored across adjacent slots in the page, the block
number included in the acquired physical address is set to the
block number. The page number included in the acquired physical
address is set to the page number.
[0261] Consecutive information is set to the information about the
offset on a page. In addition, when the cluster is stored across
the pages, the block number included in the acquired physical
address is set to the block number. Consecutive numbers are set to
the page numbers, and information indicating the position of the
head is set to the information about the offset on a page.
[0262] The transfer control unit 215 instructs the reading unit 212
to perform a reading process, using the acquired physical address
and the acquired information indicating how many times greater the
size of the data is than the division size as read destination
information and the converted logical address as the logical
address of the cluster to be read. When the cluster to be read is
stored across adjacent slots in the same page or across the pages,
the transfer control unit 215 adds the generated information items
about consecutive read destination slots and transmits the added
information to the reading unit 212. When the cluster to be read is
stored across adjacent slots in the same page, the cluster is read
from the storage medium 251 by one reading process since data is
read from the storage medium 251 in the unit of the page 402.
Therefore, when the cluster to be read is stored across adjacent
slots in the same page, the cluster may be read by one reading
process.
[0263] When receiving a notice indicating the occurrence of the
read error from the reading unit 212, the transfer control unit 215
performs a process of maintaining consistency such that an error
occurs when the cluster is read after the transfer process. For
example, the transfer control unit 215 may transfer the cluster
data with the read error, without correcting the read error. In
addition, the transfer control unit 215 may insert information
indicating that the read error occurs when the logical address is
read into the management information stored in the first memory 252
such that the cluster data with the read error is not
transferred.
[0264] The transfer control unit 215 receives the data read from
the reading unit 212. The transfer control unit 215 writes the
cluster to be transferred. Specifically, the transfer control unit
215 shifts the write destination information transmitted in the
previous cluster write request for the writing unit 211 by the slot
offset indicated by the information indicating how many times
greater the size of the data is than the division size which is
returned from the writing unit 211 in the previous cluster write
request for the writing unit 111, thereby generating write
destination information. The write destination information
transmitted in the previous cluster write request for the writing
unit 211 includes the block number of the write destination of the
cluster, the page number, the information about the offset on a
page, and the information about the offset on a slot. The transfer
control unit 215 adds, to the information about the offset on a
slot, the offset indicated by the information indicating how many
times greater the size of the data is than the division size which
is returned from the writing unit 211 in the previous cluster write
request for the writing unit 211, thereby generating the write
destination information.
[0265] In the previous cluster write request for the writing unit
211, when the next write destination information is given to the
writing unit 211 (the cluster is stored across the slots or the
pages), the transfer control unit 215 shifts the next write
destination information by the remainder of the multiple of the
division size to generate write destination information.
Specifically, the next write destination information includes the
block number of the write destination of the cluster, the page
number, the information about the offset on a page, and the
information about the offset on a slot which indicates the position
of the head of the slot. The writing unit 211 adds an offset
corresponding to the remainder of the multiple of the division size
to the information about the offset on a slot to generate the write
destination information.
[0266] When the block 400 to which data which is requested to be
written by the host apparatus (not illustrated) is written is the
same as the transfer destination block 400, the write control unit
213 and the transfer control unit 215 perform a process in
cooperation with each other such that the generated write
destination information items do not overlap each other.
[0267] The transfer control unit 215 transmits the generated write
destination information, the write data which is extracted as the
cluster data to be written, and the converted logical address as
the logical address of the cluster to be written to the writing
unit 211 and instructs the writing unit 211 to perform a writing
process.
[0268] When a response indicating the overflow of the slot, which
is a write destination, is received from the writing unit 211 and
the cluster is stored across adjacent slots in the same page or the
physical addresses are consecutive in the same management unit
managing the block 400, the transfer control unit 215 gives the
next write destination information to the writing unit 211. In
addition, the transfer control unit 215 may give a dummy data
storage instruction to the writing unit 211 in order to make data
sizes equal to each other. For example, when the cluster is written
to adjacent slots in the same page or the physical addresses are
consecutive in the same management unit managing the block 400, the
transfer control unit 215 gives the dummy data storage instruction
to the writing unit 211. When the dummy data storage instruction is
given to the writing unit 211, the transfer control unit 215
ensures a new write destination slot in order to write the cluster,
which is a write target, and starts the writing process again.
Then, the transfer control unit 215 receives the information
indicating how many times greater the size of the data is than the
division size from the writing unit 211.
[0269] The transfer control unit 215 repeatedly performs the
above-mentioned process until the write request for the writing
unit 211 corresponds to at least one page as a result of the
comparison of the write data. The reason is as follows. The unit of
input and output for the storage medium 251 is the page 402.
Therefore, when data corresponding to at least one page is not
written, a management information update process, which will be
described below, is not performed and the transfer process is not
completed.
[0270] The transfer control unit 215 updates the management
information about the transferred cluster. Specifically, when
receiving a write completion notice from the writing unit 211, the
transfer control unit 215 updates the address mapping table 162 for
the cluster written to the page. The transfer control unit 215
instructs the first access unit 102 to perform a writing process
such that the physical address of the storage medium 251 indicated
by the converted logical address in the address mapping table 162
is updated to the physical address of the storage medium 251, which
is a write destination, for the cluster written to the page.
[0271] In addition, the transfer control unit 215 instructs the
first access unit 102 to write the information indicating how many
times greater the size of the data is than the division size which
is acquired from the writing unit 211 to the address mapping table
162 for the cluster written to the page. The transfer control unit
215 repeatedly performs the above-mentioned process according to a
predetermined method.
[0272] Next, the operation of the data storage device 200 according
to the second embodiment will be described. First, the procedure of
the writing process performed by the data storage device 200 in
response to a write instruction from the host apparatus (not
illustrated) will be described with reference to FIG. 14. FIG. 14
is a flowchart illustrating an example of the procedure of the
writing process performed by the data storage device 200.
[0273] (Writing Process)
[0274] In Step S400, the data storage device 200 receives a write
instruction from, for example, an external host apparatus (not
illustrated). Specifically, the interface unit 106 receives
instructions including a write instruction and a read instruction
from the host apparatus (not illustrated). The write instruction
includes the data storage device address information and the write
data. The read instruction includes the data storage device address
information. The data storage device address information is address
information which is provided from the data storage device 200 to
the host apparatus (not illustrated).
[0275] For example, an LBA is an example of the data storage device
address information of an HDD (Hard Disk Drive) or an SSD. The size
of the data specified by LBA is set to, for example, 512 bytes. As
described above, the size of the data specified by the data storage
device address is generally different from the size of the data
(cluster) specified by the logical address. However, the data
storage device address and the logical address can be converted
into each other. For example, when the data storage device address
information is allocated for every 512 bytes and the logical
address is allocated for every 1024 bytes, the quotient of the data
storage device address information divided by 2 can be calculated
to convert the data storage device address information into the
logical address. In the second embodiment, for simplicity of
explanation, an example in which the size of the data specified by
the data storage device address is equal to the size of the cluster
will be described. However, the invention is not limited thereto.
The data storage device 200 may be configured such that the size of
the data specified by the data storage device address is different
from the size of the cluster.
[0276] When the received instruction is a write instruction, the
interface unit 106 transmits the received write instruction to the
write control unit 213.
[0277] In Step S402, the write control unit 113 generates write
destination information. Specifically, when receiving the write
instruction from the interface unit 106, the write control unit 213
extracts the data storage device address information and the write
data from the received write instruction. Then, the write control
unit 213 converts the extracted data storage device address
information into a corresponding logical address. In addition, the
write control unit 213 shifts the write destination information
transmitted in the previous cluster write request for the writing
unit 211 by the slot offset indicated by the information indicating
how many times greater the size of the data is than the division
size which is returned from the writing unit 211 in the previous
cluster write request for the writing unit 211 to generate write
destination information.
[0278] Specifically, the write destination information transmitted
in the previous cluster write request for the writing unit 211
includes the block number of the write destination of the cluster,
the page number, the information about the offset on a page, and
the information about the offset on a slot. The write control unit
213 adds, to the information about the offset on a slot, the offset
indicated by the information indicating how many times greater the
size of the data is than the division size which is returned from
the writing unit 211 in the previous cluster write request for the
writing unit 211, thereby generating the write destination
information.
[0279] In the previous cluster write request for the writing unit
211, when the next write destination information is given to the
writing unit 211 (the cluster is stored across the slots or the
pages), the write control unit 213 shifts the next write
destination information by the remainder of the multiple of the
division size to generate the write destination information.
Specifically, the next write destination information includes the
block number of the write destination of the cluster, the page
number, the information about the offset on a page, and the
information about the offset on a slot which indicates the position
of the head of the slot. The writing unit 211 adds an offset
corresponding to the remainder of the multiple of the division size
to the information about the offset on a slot to generate the write
destination information. In the data storage device 200, when the
block 400 to which data which is requested to be written by the
host apparatus is written is the same as the transfer destination
block 400, the write control unit 213 and the transfer control unit
215 perform a process in cooperation with each other such that the
generated write destination information items do not overlap each
other. The write control unit 213 transmits the generated write
destination information, the write data extracted as the cluster
data to be written, and the logical address which is converted as
the logical address of the cluster to be written to the writing
unit 211 and instructs the writing unit 211 to perform a writing
process.
[0280] The writing unit 211 receives a cluster write request from
the write control unit 213. The cluster write request includes the
write destination information, the cluster data to be written, and
data indicating the logical address of the cluster to be written.
The write destination information includes the block number of the
write destination of the cluster, the page number, the information
about the offset on a page, and the information about the offset on
a slot.
[0281] In Step S404, the writing unit 211 transmits a compression
instruction to the compression unit 104 (if necessary).
Specifically, the writing unit 211 performs the same cluster data
compression process as the writing unit 111. Specifically, the
writing unit 211 extracts the cluster data to be written from the
received cluster write request. The writing unit 211 transmits the
extracted cluster data to be written to the compression unit 104
and instructs the compression unit 104 to compress the cluster
data. Then, the writing unit 211 acquires the cluster data to be
written which is compressed by the compression unit 104.
[0282] The writing unit 211 extracts data indicating the logical
address of the cluster to be written from the received cluster
write request and generates metadata including the extracted data
indicating the logical address of the cluster to be written. When
the metadata included in the cluster set is compressed, the writing
unit 211 treats the compressed metadata the same as the
metadata.
[0283] In Step S406, the writing unit 211 adjusts the size of the
cluster data to an integer multiple of the division size.
Specifically, the writing unit 211 adjusts the size of data
obtained by adding the generated metadata and the compressed
cluster data to an integer multiple of the division size.
[0284] Specifically, when the size of the data obtained by adding
the metadata of the cluster to be compressed and the compressed
cluster data is equal to or less than an integer multiple of the
division size, the writing unit 211 generates dummy data
corresponding to the remainder of the area of the data obtained by
adding the metadata of the cluster to be compressed and the
compressed cluster data in the area with a size that is an integer
multiple of the division size. The dummy data may have a
predetermined value (for example, all zero) or a random value. In
addition, the dummy data may be error correction data which is
generated on the basis of the data obtained by adding the metadata
of the cluster to be compressed and the compressed cluster data.
When the dummy data is the error correction data, it is possible to
improve the reliability of the stored data.
[0285] Specifically, in the second embodiment, as described above,
the cluster data is divided into four parts. When the size of the
data obtained by adding the metadata of the cluster to be
compressed and the compressed cluster data is equal to or less than
(one time) the division size, the writing unit 211 stores the dummy
data in the remainder of the area of the data obtained by adding
the metadata of the cluster to be compressed and the compressed
cluster data in the area with the division size (one time), as
illustrated in FIG. 10A. In this way, the size of the data is an
integer multiple of the division size.
[0286] Similarly, when the size of the data obtained by adding the
metadata of the cluster to be compressed and the compressed cluster
data is equal to or less than two times the division size, the size
of the data is an integer multiple of the division size, as
illustrated in FIG. 10B. When the size of the data obtained by
adding the metadata of the cluster to be compressed and the
compressed cluster data is equal to or less than three times the
division size, the size of the data is an integer multiple of the
division size, as illustrated in FIG. 10C. The size of the data is
not limited to an integer multiple of the division size, but it may
be other values. For example, the size of the data may be a
multiple of 2.
[0287] When the size of the data obtained by adding the metadata of
the cluster to be compressed and the compressed cluster data is
equal to or less than four times the division size, that is, when
the size of the data is equal to or less than the size of the
cluster data which is not compressed, the size of the data may be
set as follows. For example, as illustrated in FIG. 10D, the size
of the data may be an integer multiple of the same division size as
that illustrated in FIGS. 10A to 10C. In addition, the cluster data
may be stored in a plurality of slots of the page 402 illustrated
in FIG. 9, without being compressed.
[0288] The advantage of the structure in which the cluster data is
compressed and stored and the size is an integer multiple of the
division size is that error correction data, which is generated on
the basis of the data obtained by adding the metadata of the
cluster to be compressed and the compressed cluster data, is dummy
data and the reliability of the stored data is improved. In
addition, only when the cluster is stored across adjacent slots in
the same page or the physical addresses are consecutive, in the
range in which the units of management of the block 400 do not
overlap each other (for example, in the same block 400), it is
possible to store data across the pages. Therefore, according to
the second embodiment, it is possible to improve the storage
efficiency of the storage medium 251 and increase the lifespan of
the data storage device 200.
[0289] The advantage of the structure in which the cluster data is
stored without being compressed is that it is possible to reduce
the time required for the compression process during, for example,
the writing process or the time required for the decompression
process during the reading process. The compressed cluster may be
stored across adjacent slots in the same page illustrated in FIG.
11A, similarly to the structure in which the cluster is stored
across the pages illustrated in FIG. 3B. In addition, as
illustrated in FIG. 11B, only when the physical addresses are
consecutive in the range in which the units of management of the
block 400 do not overlap each other, the compressed cluster may be
stored across the pages 402. In FIGS. 11A and 11B, for simplicity
of explanation, the storage area of the metadata or the error
correction data in the slot is not illustrated.
[0290] In Step S408, the writing unit 211 determines whether the
generated cluster set is fitted into the slot. Specifically, the
writing unit 211 determines whether data with a size that is an
integer multiple of the division size is fitted into the slot,
which is a write destination. Specifically, the writing unit 211
determines whether the sum of the information about the offset on a
slot included in the write destination information and the size
that is an integer multiple of the division size is fitted into the
slot.
[0291] In Step S410, the second memory 153 temporarily stores the
data with a size that is an integer multiple of the division size.
Specifically, when the determination result in Step S408 is YES
(the data is fitted into the slot, which is a write destination),
the writing unit 211 instructs the second access unit 103 to
perform a writing process such that the second memory 153
temporarily stores the data with a size that is an integer multiple
of the division size. In addition, the writing unit 211 returns the
information indicating how many times greater the data with a size
that is an integer multiple of the division size is than the
division size to the write request source. The write control unit
213 receives the information indicating how many times greater the
data is than the division size from the writing unit 211.
[0292] In Step S412, the writing unit 211 and the write control
unit 213 perform terminal processing. Specifically, when the
determination result in Step S408 is NO (the data is not fitted
into the slot, which is a write destination), the writing unit 211
returns a response indicating the overflow of the slot, which is a
write destination, to the write request source. When the response
indicating the overflow of the slot, which is a write destination,
is received from the writing unit 211 and the cluster is stored
across adjacent slots in the same page or the physical addresses
are consecutive in the same management unit managing the block 400,
the write control unit 213 gives the next write destination
information to the writing unit 211. When receiving the next write
destination information from the write request source, the writing
unit 211 instructs the second access unit 103 to perform a writing
process such that the second memory 153 temporarily stores the data
with a size that is an integer multiple of the division size. In
addition, the writing unit 211 returns the information indicating
how many times greater the data with a size that is an integer
multiple of the division size is than the division size to the
write request source. The write control unit 213 receives the
information indicating how many times greater the data is than the
division size from the writing unit 211. Then, the write control
unit 213 proceeds to Step S414.
[0293] When receiving a response indicating the overflow of the
slot, which is a write destination, from the writing unit 211, the
write control unit 213 may give a dummy data storage instruction to
the writing unit 211. The write control unit 213 gives the dummy
data storage instruction to the writing unit 211 when the cluster
is stored across adjacent slots in the same page or the physical
addresses are not consecutive in the range in which the units of
management of the block 400 do not overlap each other. When
receiving the dummy data storage instruction from the write request
source, the writing unit 211 generates dummy data corresponding to
the size of the remaining area of the slot, which is a write
destination. The writing unit 211 instructs the second access unit
103 to perform a writing process such that the second memory 153
temporarily stores the generated dummy data.
[0294] The writing unit 211 may generate the error correction data
of the data with a size that is an integer multiple of the division
size which is temporarily stored in the second memory 153, instead
of the dummy data. The writing unit 211 may use the error
correction data of the data with a size that is an integer multiple
of the division size which is temporarily stored in the second
memory 153 to improve the reliability of data. In addition, the
writing unit 211 may appropriately change the order of the data
with a size that is an integer multiple of the division size to
reduce the amount of dummy data stored, thereby improving the usage
efficiency of the storage medium 251.
[0295] When instructing the writing unit 211 to write the dummy
data, the write control unit 213 ensures a new write destination
slot in order to write the cluster data, which is a write target,
and performs the writing process again from Step S402.
[0296] In Step S414, the writing unit 211 determines whether the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of one slot. When the total size
of the data temporarily stored in the second memory 153 is not
equal to or more than the size of one slot (No in Step S414), the
writing unit 211 proceeds to Step S400. When the total size of the
data temporarily stored in the second memory 153 is equal to or
more than the size of one slot (Yes in Step S414), the writing unit
211 proceeds to Step S416.
[0297] In Step S416, the writing unit 211 generates slot data.
Specifically, when data corresponding to one slot is obtained, the
writing unit 211 generates data for a special value (magic number)
indicating the arrangement pattern of the compressed and stored
cluster as the metadata in the storage format of the slot. In
addition, the writing unit 211 generates the error correction data
in the storage format of the slot.
[0298] Specifically, for example, when the cluster data is divided
into four parts, data which is a base for generating the first
error correction data piece includes the metadata indicating the
generated magic number and the first data piece, as illustrated in
FIG. 9. Data which is a base for generating the second error
correction data piece includes the metadata indicating the
generated magic number and the second data piece. Data which is a
base for generating the third error correction data piece includes
the metadata indicating the generated magic number and the third
data piece. Data which is a base for generating the fourth error
correction data piece includes the metadata indicating the
generated magic number and the fourth data piece.
[0299] The writing unit 211 instructs the second access unit 103 to
perform a writing process such that the metadata indicating the
generated magic number, the data with a size that is an integer
multiple of the division size which is temporarily stored in the
second memory 153, and the generated error correction data are
temporarily stored as data of the slot.
[0300] In addition, for example, when there is no necessity to
compress data since the data size is not reduced by compression,
the writing unit 211 may store the extracted cluster data to be
written in a plurality of slots of the page 402 without
transmitting the cluster data to the compression unit 104.
[0301] In Step S418, the writing unit 211 determines whether the
size of the data to be written is equal to or more than one page.
When the size of the data to be written is not equal to or more
than one page (No in Step S418), the writing unit 211 proceeds to
Step S400. When the size of the data to be written is equal to or
more than one page (Yes in Step S418), the writing unit 211
proceeds to Step S420.
[0302] In Step S420, the writing unit 211 writes data corresponding
to one page. Specifically, when the total size of the data
temporarily stored in the second memory 153 is equal to or more
than the size of the page 402, the writing unit 211 instructs the
second access unit 103 to read data corresponding to the page size
among the data pieces temporarily stored in the second memory 153
and acquires the data corresponding to the page size. Here, the
writing unit 211 instructs the storage medium access unit 101 to
write the block number of the write destination of the cluster and
the page number which are included in the write destination
information received from the write request source as the write
destination page.
[0303] In Step S422, the write control unit 213 updates the
management information. Specifically, the writing unit 211
transmits a notice indicating that the writing of data to the write
destination page has been completed to the write request source.
When receiving the write completion notice from the writing unit
211, the write control unit 213 updates the address mapping table
162 for the cluster written to the page. The write control unit 213
instructs the first access unit 102 to perform a writing process
such that the physical address of the storage medium 251 indicated
by the converted logical address in the address mapping table 162
is updated to the physical address of the storage medium 251, which
is a write destination, for the cluster written to the page. In
addition, the write control unit 213 instructs the first access
unit 102 to write the information indicating how many times greater
the size of the data is than the division size which is acquired
from the writing unit 211 to the address mapping table 162 for the
cluster written to the page.
[0304] Next, the procedure of the reading process performed by the
data storage device 200 in response to a read instruction from the
host apparatus (not illustrated) will be described with reference
to FIG. 15. FIG. 15 is a flowchart illustrating an example of the
procedure of the reading process performed by the data storage
device 200.
[0305] (Reading Process)
[0306] In Step S500, the data storage device 200 receives a read
instruction from, for example, an external host apparatus (not
illustrated). Specifically, the interface unit 106 receives
instructions including a write instruction and a read instruction
from, for example, the host apparatus (not illustrated). The write
instruction includes the data storage device address information
and the write data. The read instruction includes the data storage
device address information. The data storage device address
information is address information which is provided from the data
storage device 200 to the host apparatus (not illustrated).
[0307] For example, an LBA is an example of the data storage device
address information of an HDD (Hard Disk Drive) or an SSD. The size
of the data specified by LBA is set to, for example, 512 bytes. As
described above, the size of the data specified by the data storage
device address is generally different from the size of the data
(cluster) specified by the logical address. However, the data
storage device address and the logical address can be converted
into each other. For example, when the data storage device address
information is allocated for every 512 bytes and the logical
address is allocated for every 1024 bytes, the quotient of the data
storage device address information divided by 2 can be calculated
to convert the data storage device address information into the
logical address. In the second embodiment, for simplicity of
explanation, an example in which the size of the data specified by
the data storage device address is equal to the size of the cluster
will be described. However, the invention is not limited thereto.
The data storage device 200 may be configured such that the size of
the data specified by the data storage device address is different
from the size of the cluster.
[0308] When the received instruction is a read instruction, the
interface unit 106 transmits the received read instruction to the
read control unit 214.
[0309] In Step S502, the read control unit 214 generates read
destination information. Specifically, when receiving the read
instruction from the interface unit 106, the read control unit 214
extracts the data storage device address information from the
received read instruction. Then, the read control unit 214 converts
the extracted data storage device address information into a
corresponding logical address. In addition, the read control unit
214 acquires information associated with the converted logical
address. Specifically, the read control unit 214 instructs the
first access unit 102 to read the physical address of the storage
medium 251 and the information indicating how many times greater
the size of the data is than the division size which are indicated
by the converted logical address in the address mapping table 162.
Then, the read control unit 214 acquires the physical address and
the information indicating how many times greater the size of the
data is than the division size. The read control unit 214
determines whether the cluster is stored across adjacent slots in
the same pages or the pages on the basis of the information about
the offset on a page and the information about the offset on a slot
which are included in the acquired physical address and the
acquired information indicating how many times greater the size of
the data is than the division size. When the determination result
is YES (the cluster is stored across adjacent slots in the same
pages or the pages), the read control unit 214 generates
information about consecutive read destination slots. The
information about consecutive read destination slots includes the
block number, the page number, and the information about the offset
on a page. Here, the block number and numbers subsequent to the
page number included in the acquired physical address are newly set
as the block number and the page number included in the information
about consecutive read destination pages.
[0310] When the cluster is stored across adjacent slots in the
page, the block number and the page number included in the acquired
physical address are set as the block number and the page number
included in the information about consecutive read destination
pages and consecutive information is set to the information about
the offset on a page. In addition, when the cluster is stored
across the pages, the block number included in the acquired
physical address is set to the block number, consecutive numbers
are set to the page numbers, and information indicating the
position of the head is set to the information about the offset on
a page.
[0311] In Step S504, the read control unit 214 reads data, which is
a read target. Specifically, the read control unit 214 instructs
the reading unit 212 to perform a reading process, using the
acquired physical address and the acquired information indicating
how many times greater the size of the data is than the division
size as the read destination information and the converted logical
address as the logical address of the cluster to be read. When the
cluster to be read is stored across adjacent slots in the same page
or the pages, the read control unit 214 adds the generated
information items about consecutive read destination slots and
transmits the added information to the reading unit 212. In
addition, when the cluster set to be read is written to adjacent
slots in the same page, the cluster, which is a read target, may be
read from the storage medium 251 by one reading process since data
is read from the storage medium 251 in the unit of the pages
402.
[0312] The reading unit 212 receives a cluster read request from
the read request source. The cluster read request includes read
destination information and data indicating the logical address of
the cluster to be read. The read destination information includes
the block number, the page number, the information about the offset
on a page, the information about the offset on a slot, and the
information indicating how many times greater the size of the data
is than the division size. When the cluster to be read is stored
across the slots or the pages, the reading unit 212 also receives
information about consecutive read destination slots. The
information about consecutive read destination slots includes the
block number, the page number, and the information about the offset
on a page.
[0313] The reading unit 212 extracts the block number and the page
number from the acquired read destination information and instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number, and acquires the data of the page. When the cluster
to be read is stored across the slots or the pages, the reading
unit 212 extracts the block number and the page number from the
acquired information about consecutive read destination pages,
instructs the storage medium access unit 101 to read the data of
the pages 402 with the extracted page numbers in the block 400 with
the extracted block number, and further acquires the data of the
pages. In addition, when the cluster is stored across adjacent
slots in the same page, the reading unit 212 can read the cluster
from the storage medium 251 using one reading process since data is
read from the storage medium 251 in the unit of the pages 402.
Therefore, when the cluster is stored across adjacent slots in the
same page, the reading unit 212 may read the cluster using only one
reading process.
[0314] In addition, the reading unit 212 extracts the information
about the offset on a page, the information about the offset on a
slot, and the information indicating how many times greater than
the size of the data is than the division size from the acquired
read destination information. The reading unit 212 extracts the
metadata of the slot, data with a size that is an integer multiple
of the division size, and the error correction data of the data
from the position indicated by the extracted information about the
offset on a page, the extracted information about the offset on a
slot, and the extracted information indicating how many times
greater than the size of the data is than the division size among
the data pieces of the acquired page. When the cluster to be read
is stored across the slots or the pages, the reading unit extracts
the remaining data for the cluster from the position of the head of
the consecutive slots and adds the data pieces to generate data for
the cluster.
[0315] In Step S506, the reading unit 212 decompresses the data to
be read and returns the decompressed data to the host apparatus.
Specifically, the reading unit 212 corrects the error of the
extracted error correction target data using the extracted error
correction data and acquires the error corrected data.
[0316] Specifically, the reading unit 212 uses data including the
metadata of the slot and the data with a size that is an integer
multiple of the division size as the basic data for generating the
error correction data, among the extracted data pieces. In
addition, the reading unit 212 performs error correction using the
error correction data among the extracted data pieces and acquires
the error corrected data.
[0317] When error correction fails (error correction is
unavailable), the reading unit 212 notifies the read request source
of the occurrence of a read error. When receiving a notice
indicating the occurrence of the read error from the reading unit
212, the read control unit 214 transmits data indicating the read
error to the interface unit 106. The first memory 252 may further
store information indicating that the read error occurs when the
logical address is read as one of the management information items.
In this way, when a read request for the same logical address is
issued again, it is possible to rapidly return the read error.
[0318] When receiving data (data indicating the read error) from
the read control unit 214, the interface unit 106 transmits the
received data (data indicating the read error) to the host
apparatus (not illustrated). When error correction succeeds (error
correction is available), the reading unit 212 extracts cluster
data from the error corrected data. The reading unit 212 transmits
the extracted cluster data to the decompression unit 105 and
instructs the decompression unit 105 to decompress the extracted
cluster data. The reading unit 212 acquires the decompressed
cluster data.
[0319] For example, when the cluster data extracted from the error
corrected data is not compressed, the reading unit 212 does not
transmit the cluster data to the decompression unit 105. The
reading unit 212 transmits the acquired decompressed cluster data
to the read request source. When receiving the data read from the
reading unit 212, the read control unit 214 transmits the received
data to the interface unit 106. When receiving the data from the
read control unit 114, the interface unit 106 transmits the
received data to the host apparatus (not illustrated).
[0320] Next, the procedure of the transfer process performed by the
data storage device 200 will be described with reference to FIG.
16. FIG. 16 is a flowchart illustrating an example of the procedure
of the transfer process performed by the data storage device 200.
The transfer control unit 215 controls the transfer process
illustrated in FIG. 16 according to a predetermined rule.
[0321] (Transfer Process)
[0322] In Step S600, the transfer control unit 115 determines the
cluster to be transferred. Specifically, the transfer control unit
215 instructs the first access unit 102 to read the management
information from the first memory 252 and acquires the management
information. The transfer control unit 215 determines the cluster
to be transferred from the acquired management information using a
predetermined method. In the second embodiment, any known method
may be used to determine the cluster to be transferred. The
transfer control unit 215 extracts the logical address of the
determined cluster from the acquired management information.
[0323] In Step S602, the transfer control unit 215 generates read
destination information. Specifically, the transfer control unit
215 acquires information associated with the extracted logical
address. For example, the transfer control unit 215 instructs the
first access unit 102 to read the physical address of the storage
medium 251 and the information indicating how many times greater
the size of the data is than the division size which are indicated
by the extracted logical address in the address mapping table 162,
and acquires the physical address and the information indicating
how many times greater the size of the data is than the division
size.
[0324] The transfer control unit 215 determines whether the cluster
is stored across adjacent slots in the same page or the pages on
the basis of the information about the offset on a page and the
information about the offset on a slot included in the acquired
physical address and the acquired information indicating how many
times greater the size of the data is than the division size. When
the determination result is YES (the cluster set stored across
adjacent slots in the same page or the pages), the transfer control
unit 215 generates information about consecutive read destination
slots. Specifically, the information about consecutive read
destination slots includes the block number, the page number, and
the information about the offset on a page. When the cluster is
stored across adjacent slots in the page, the block number included
in the acquired physical address is set to the block number. The
page number included in the acquired physical address is set to the
page number.
[0325] Consecutive information is set to the information about the
offset on a page. In addition, when the cluster is stored across
the pages, the block number included in the acquired physical
address is set to the block number. Consecutive numbers are set to
the page numbers, and information indicating the position of the
head is set to the information about the offset on a page.
[0326] In Step S604, the transfer control unit 215 reads data,
which is a read target. Specifically, the transfer control unit 215
instructs the reading unit 212 to perform a reading process, using
the acquired physical address and the acquired information
indicating how many times greater the size of the data is than the
division size as the read destination information and the converted
logical address as the logical address of the cluster to be
read.
[0327] When the cluster to be read is stored across adjacent slots
in the same page or the pages, the transfer control unit 215 adds
the generated information items about consecutive read destination
slots and transmits the added information to the reading unit 212.
When the cluster to be read is stored across adjacent slots in the
same page, the cluster is read from the storage medium 251 by one
reading process since data is read from the storage medium 251 in
the unit of the pages 402. Therefore, when the cluster to be read
is stored across adjacent slots in the same page, the cluster may
be read by one reading process.
[0328] The reading unit 212 receives a cluster read request from
the read request source. The cluster read request includes the read
destination information and data indicating the logical address of
the cluster to be read. The read destination information includes
the block number, the page number, the information about the offset
on a page, the information about the offset on a slot, and the
information indicating how many times greater the size of the data
is than the division size. When the cluster to be read is stored
across the slots or the pages, the reading unit 212 also receives
information about consecutive read destination slots. The
information about consecutive read destination slots includes the
block number, the page number, and the information about the offset
on a page.
[0329] The reading unit 212 extracts the block number and the page
number from the acquired read destination information, instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number and acquires the data of the page. When the cluster to
be read is stored across the slots or the pages, the reading unit
212 extracts the block number and the page number from the acquired
information about consecutive read destination pages, instructs the
storage medium access unit 101 to read the data of the pages 402
with the extracted page numbers in the block 400 with the extracted
block number, and further acquires the data of the pages. When the
cluster to be read is stored across adjacent slots in the same
page, the reading unit 212 can read data from the storage medium
251 using one reading process since data is read from the storage
medium 251 in the unit of the pages 402. Therefore, when the
cluster is stored across adjacent slots in the same page, the
reading unit 212 may perform one reading process to read data.
[0330] The reading unit 212 extracts the information about the
offset on a page, the information about the offset on a slot, and
the information indicating how many times greater the size of the
data is than the division size from the acquired read destination
information. The reading unit 212 extracts the metadata of the
slot, data with a size that is an integer multiple of the division
size, and the error correction data of the data from the position
by the extracted information about the offset on a page, the
extracted information about the offset on a slot, and the extracted
information indicating how many times greater the size of the data
is than the division size among the data pieces of the acquired
page. When the cluster to be read is stored across the slots or the
pages, the reading unit extracts the remaining data for the cluster
from the position of the head of the consecutive slots and adds the
data pieces to generate data for the cluster.
[0331] In Step S606, the transfer control unit 215 decompresses the
read data and acquires the decompressed data. Specifically, the
reading unit 212 corrects the error of the extracted error
correction target data using the extracted error correction data
and acquires the error corrected data. Specifically, the reading
unit 212 uses data including the metadata of the slot and the data
with a size that is an integer multiple of the division size as the
basic data for generating the error correction data, among the
extracted data pieces, and performs error correction using the
error correction data among the extracted data pieces to acquire
the error corrected data. When error correction fails (error
correction is unavailable), the reading unit 212 notifies the read
request source of the occurrence of a read error. When receiving a
notice indicating the occurrence of the read error from the reading
unit 212, the transfer control unit 215 performs a process of
maintaining consistency such that an error occurs when the cluster
is read after the transfer process. For example, the transfer
control unit 215 may transfer the cluster data with the read error,
without correcting the read error. In addition, the transfer
control unit 215 may insert information indicating that the read
error occurs when the logical address is read into the management
information stored in the first memory 252 such that the cluster
data with the read error is not transferred. When error correction
succeeds (error correction is available), the reading unit 212
extracts the cluster data from the error corrected data. The
reading unit 212 transmits the extracted cluster data to the
decompression unit 105, instructs the decompression unit 105 to
decompress the extracted cluster data, and acquires the
decompressed cluster data.
[0332] For example, when the cluster data extracted from the error
corrected data is not compressed, the reading unit 212 does not
transmit the cluster data to the decompression unit 105. The
reading unit 212 transmits the acquired decompressed cluster data
to the read request source. The transfer control unit 215 receives
the data read from the reading unit 212.
[0333] In Step S608, the transfer control unit 215 generates write
destination information. Specifically, the transfer control unit
215 shifts the write destination information transmitted in the
previous cluster write request for the writing unit 211 by the slot
offset indicated by the information indicating how many times
greater the size of the data is than the divides size which is
returned from the writing unit 211 in the previous cluster write
request for the writing unit 211, thereby generating the write
destination information.
[0334] Specifically, the write destination information transmitted
in the previous cluster write request for the writing unit 211
includes the block number of the write destination of the cluster,
the page number, the information about the offset on a page, and
the information about the offset on a slot. The transfer control
unit 215 adds, to the information about the offset on a slot, the
offset indicated by the information indicating how many times
greater the size of the data is than the divides size which is
returned from the writing unit 211 in the previous cluster write
request for the writing unit 211, thereby generating the write
destination information. In the previous cluster write request for
the writing unit 211, when the next write destination information
is given to the writing unit 211 (the cluster is stored across the
slots or the pages), the transfer control unit 215 shifts the next
write destination information by the remainder of the offset
indicated by the information indicating how many times greater the
size of the data is than the divides size.
[0335] Specifically, the next write destination information
includes the block number of the write destination of the cluster,
the page number, the information about the offset on a page, and
the information about the off on the slot indicating the position
of the head of the page. The writing unit 211 adds, to the
information about the offset on a slot, the remainder of the offset
indicated by the information indicating how many times greater the
size of the data is than the divides size, thereby generating the
write destination information.
[0336] In the data storage device 200, when the block 400 to which
data which is requested to be written by the host apparatus is
written is the same as the transfer destination block 400, the
write control unit 213 and the transfer control unit 215 perform a
process in cooperation with each other such that the generated
write destination information items do not overlap each other. The
transfer control unit 215 transmits the generated write destination
information, the write data extracted as the cluster data to be
written, and the logical address which is converted as the logical
address of the cluster to be written to the writing unit 211 and
instructs the writing unit 211 to perform a writing process.
[0337] The writing unit 211 receives a cluster write request from
the transfer control unit 215. The cluster write request includes
the write destination information, the cluster data to be written,
and data indicating the logical address of the cluster to be
written. The write destination information includes the block
number of the write destination of the cluster, the page number,
the information about the offset on a page, and the information
about the offset on a slot.
[0338] In Step S610, the writing unit 211 compresses the cluster
data using the compression unit 104 (if necessary). The cluster
data compression process of the writing unit 211 is the same as
that of the writing unit 111.
[0339] Specifically, the writing unit 211 extracts the cluster data
to be written from the received cluster write request. The writing
unit 211 transmits the extracted cluster data to be written to the
compression unit 104 and instructs the compression unit 104 to
compress the cluster data. Then, the writing unit 211 acquires the
cluster data to be written which is compressed by the compression
unit 104.
[0340] The writing unit 211 extracts data indicating the logical
address of the cluster to be written from the received cluster
write request and generates metadata including the extracted data
indicating the logical address of the cluster to be written. When
the metadata included in the cluster set is compressed, the writing
unit 211 treats the compressed metadata the same as the
metadata.
[0341] In Step S612, the writing unit 211 adjusts the size of the
data to be equal to an integer multiple of the division size.
Specifically, the writing unit 211 adjusts the size of the data
obtained by adding the generated metadata and the acquired
compressed cluster data to be equal to an integer multiple of the
division size.
[0342] Specifically, when the size of data obtained by adding the
metadata to be compressed and the compressed cluster data is equal
to or less than an integer multiple of the division size, the
writing unit 211 generates dummy data corresponding to the
remainder of the area of the data obtained by adding the metadata
of the cluster to be compressed and the compressed cluster data in
the area with a size that is an integer multiple of the division
size. The dummy data may have a predetermined value (for example,
all zero) or a random value. In addition, the dummy data may be the
error correction data which is generated on the basis of the data
obtained by adding the metadata of the cluster to be compressed and
the compressed cluster data. When the dummy data is the error
correction data, it is possible to improve the reliability of the
stored data.
[0343] Specifically, in the second embodiment, the cluster data is
divided into four parts. Therefore, when the size of the data
obtained by adding the metadata of the cluster to be compressed and
the compressed cluster data is equal to or less than (one time) the
division size, the dummy data is stored in the remainder of the
area of the data obtained by adding the metadata of the cluster to
be compressed and the compressed cluster data in the area with the
division size (one time), as illustrated in FIG. 10A. In this way,
the size of the data is an integer multiple of the division
size.
[0344] Similarly, when the size of the data obtained by adding the
metadata of the cluster to be compressed and the compressed cluster
data is equal to or less than two times the division size, the size
of the data is an integer multiple of the division size, as
illustrated in FIG. 10B. When the size of the data obtained by
adding the metadata of the cluster to be compressed and the
compressed cluster data is equal to or less than three times the
division size, the size of the data is an integer multiple of the
division size, as illustrated in FIG. 10C. The size of the data is
not limited to an integer multiple of the division size, but it may
be other values. For example, the size of the data may be a
multiple of 2.
[0345] When the size of the data obtained by adding the metadata of
the cluster to be compressed and the compressed cluster data is
equal to or less than four times the division size, that is, when
the size of the data is equal to or less than the size of the
cluster data which is not compressed, the size of the data may be
set as follows. For example, as illustrated in FIG. 10D, the size
of the data may be an integer multiple of the same division size as
that illustrated in FIGS. 10A to 10C. In addition, the cluster data
may be stored in a plurality of slots of the page 402 illustrated
in FIG. 9, without being compressed.
[0346] The advantage of the structure in which the cluster data is
compressed and stored and the size is an integer multiple of the
division size is that the error correction data, which is generated
on the basis of the data obtained by adding the metadata of the
cluster to be compressed and the compressed cluster data, is dummy
data and the reliability of the stored data is improved. In
addition, only when the cluster is stored across adjacent slots in
the same page or the physical addresses are consecutive in the
range in which the units of management of the block 400 do not
overlap each other (for example, in the same block 400), it is
possible to store data across the pages. Therefore, according to
the second embodiment, it is possible to improve the storage
efficiency of the storage medium 251 and increase the lifespan of
the data storage device 200.
[0347] The advantage of the structure in which the cluster data is
stored without being compressed is that it is possible to reduce
the time required for the compression process during, for example,
the writing process or the time required for the decompression
process during, for example, the reading process. The compressed
cluster may be stored across adjacent slots in the same page
illustrated in FIG. 11A, similarly to the structure in which the
cluster is stored across the pages illustrated in FIG. 3B. In
addition, as illustrated in FIG. 11B, only when the physical
addresses are consecutive in the range in which the units of
management of the block 400 do not overlap each other, the
compressed cluster may be stored across the pages 402. In FIGS. 11A
and 11B, for simplicity of explanation, the storage area of the
metadata or the error correction data in the slot is not
illustrated.
[0348] In Step S614, the writing unit 211 determines whether data
with a size that is an integer multiple of the division size is
fitted into the slot, which is a write destination. The writing
unit 211 determines whether the sum of the information about the
offset on a slot included in the write destination information and
the size that is an integer multiple of the division size is fitted
into the slot.
[0349] In Step S616, the second memory 153 temporarily stores the
data with a size that is an integer multiple of the division size.
Specifically, when the determination result in Step S614 is YES
(the data is fitted into the slot, which is a write destination),
the writing unit 211 instructs the second access unit 103 to
perform a writing process such that the second memory 153
temporarily stores the data with a size that is an integer multiple
of the division size. In addition, the writing unit 211 returns the
information indicating how many times greater the data with a size
that is an integer multiple of the division size is than the
division size to the write request source. The transfer control
unit 215 receives the information indicating how many times greater
the data is than the division size from the writing unit 211.
[0350] In Step S618, the writing unit 211 and the transfer control
unit 215 perform terminal processing. Specifically, when the
determination result is NO (the data is not fitted into the slot,
which is a write destination), the writing unit 211 returns a
response indicating the overflow of the slot, which is a write
destination, to the write request source. When the response
indicating the overflow of the slot, which is a write destination,
is received from the writing unit 211 and the cluster is stored
across adjacent slots in the same page or the physical addresses
are consecutive in the same management unit managing the block 400,
the transfer control unit 215 gives the next write destination
information to the writing unit 211. When receiving the next write
destination information from the write request source, the writing
unit 211 instructs the second access unit 103 to perform a writing
process such that the second memory 153 temporarily stores the data
with a size that is an integer multiple of the division size. In
addition, the writing unit 211 returns the information indicating
how many times greater the data with a size that is an integer
multiple of the division size is than the division size to the
write request source. The transfer control unit 215 receives the
information indicating how many times greater the data is than the
division size from the writing unit 211. Then, the transfer control
unit 215 proceeds to Step S620.
[0351] When receiving a response indicating the overflow of the
slot, which is a write destination, from the writing unit 211, the
transfer control unit 215 may give a dummy data storage instruction
to the writing unit 211. The transfer control unit 215 gives the
dummy data storage instruction to the writing unit 211 when the
cluster is not stored across adjacent slots in the same page or the
physical addresses are not consecutive in the range in which the
units of management of the block 400 do not overlap each other.
When receiving the dummy data storage instruction from the write
request source, the writing unit 211 generates dummy data
corresponding to the size of the remaining area of the slot, which
is a write destination. The writing unit 211 instructs the second
access unit 103 to perform a writing process such that the second
memory 153 temporarily stores the generated dummy data.
[0352] The writing unit 211 may generate the error correction data
of the data with a size that is an integer multiple of the division
size which is temporarily stored in the second memory 153, instead
of the dummy data. The writing unit 211 may use the error
correction data of the data with a size that is an integer multiple
of the division size which is temporarily stored in the second
memory 153 to improve the reliability of data. In addition, the
writing unit 211 may appropriately change the order of the data
with a size that is an integer multiple of the division size to
reduce the amount of dummy data stored, thereby improving the usage
efficiency of the storage medium 251.
[0353] When instructing the writing unit 211 to store the dummy
data, the transfer control unit 215 ensures a new write destination
slot in order to write the cluster data, which is a write target,
and performs the writing process again.
[0354] In Step S620, the writing unit 211 determines whether the
total size of the data temporarily stored in the second memory 153
is equal to or more than the size of one slot. When the total size
of the data temporarily stored in the second memory 153 is not
equal to or more than the size of one slot (No in Step S620), the
writing unit 211 proceeds to Step S600. When the total size of the
data temporarily stored in the second memory 153 is equal to or
more than the size of one slot (Yes in Step S620), the writing unit
211 proceeds to Step S622.
[0355] In Step S622, the writing unit 211 generates slot data.
Specifically, when data corresponding to one slot is obtained, the
writing unit 211 generates data for a special value (magic number)
indicating the arrangement pattern of the compressed and stored
cluster as the metadata in the storage format of the slot. In
addition, the writing unit 211 generates the error correction data
in the storage format of the slot.
[0356] Specifically, for example, when the cluster data is divided
into four parts, data which is a base for generating the first
error correction data piece includes the metadata indicating the
generated magic number and the first data piece, as illustrated in
FIG. 9. Data which is a base for generating the second error
correction data piece includes the metadata indicating the
generated magic number and the second data piece. Data which is a
base for generating the third error correction data piece includes
the metadata indicating the generated magic number and the third
data piece. Data which is a base for generating the fourth error
correction data piece includes the metadata indicating the
generated magic number and the fourth data piece.
[0357] The writing unit 211 instructs the second access unit 103 to
perform a writing process such that the metadata indicating the
generated magic number, the data with a size that is an integer
multiple of the division size which is temporarily stored in the
second memory 153, and the generated error correction data are
temporarily stored as data of the slot. In addition, for example,
when there is no necessity to compress data since the data size is
not reduced by compression, the writing unit 211 may store the
extracted cluster data to be written in a plurality of slots of the
page 402 without transmitting the cluster data to the compression
unit 104.
[0358] In Step S624, the transfer control unit 215 determines
whether the total size of the data temporarily stored in the second
memory 153 is equal to or more than the size of one page. When the
total size of the data temporarily stored in the second memory 153
is not equal to or more than the size of the page 402 (No in Step
S624), the writing unit 211 proceeds to Step S600. When the total
size of the data temporarily stored in the second memory 153 is
equal to or more than the size of the page 402 (Yes in Step S624),
the writing unit 211 proceeds to Step S626. The transfer control
unit 215 repeats the above-mentioned process from Step S600 until
the write request for the writing unit 211 corresponds to at least
one page as a result of the compression of the write data. The
reason is as follows. Since the unit of input and output for the
storage medium 251 is the page 402, the transfer control unit 215
needs to write data corresponding to at least one page in order to
perform a process of updating the management information, which
will be described. Therefore, the transfer process is not
completed.
[0359] In Step S626, the writing unit 211 writes data corresponding
to one page to the storage medium 251 through the storage medium
access unit 101. Specifically, when the total size of the data
temporarily stored in the second memory 153 is equal to or more
than the size of the page 402, the writing unit 211 instructs the
second access unit 103 to read data corresponding to the page size
among the data pieces temporarily stored in the second memory 153,
and acquires the data corresponding to the page size. Here, the
writing unit 211 instructs the storage medium access unit 101 to
write the block number of the write destination of the cluster and
the page number which are included in the write destination
information received from the write request source as the page,
which is a write destination.
[0360] In Step S628, the transfer control unit 215 updates the
management information. Specifically, the writing unit notifies the
write request source that the writing of data to the write
destination page has been completed. When receiving the write
completion notice from the writing unit 211, the transfer control
unit 215 updates the address mapping table 162 for the cluster
written to the page. The transfer control unit 215 instructs the
first access unit 102 to perform a writing process such that the
physical address of the storage medium 251 indicated by the
extracted logical address in the address mapping table 162 is
updated to the physical address of the storage medium 251, which is
a write destination, for the cluster written to the page. In
addition, the transfer control unit 215 instructs the first access
unit 102 to write the information indicating how many times greater
the size of the data is than the division size which is acquired
from the writing unit 211 to the address mapping table 162 for the
cluster written to the page.
[0361] As such, according to the second embodiment, it is possible
to adjust the size of the cluster set written to the page 402 to a
predetermined unit. Therefore, the storage efficiency of the
storage medium 251 is reduced a little, but it is possible to
reduce the number of processes required to manage data, as compared
to the first embodiment.
Third Embodiment
[0362] Next, a third embodiment will be described. In the third
embodiment, the size of the address mapping table is reduced and
memory capacity required for the address mapping table is reduced,
as compared to the first and second embodiments. The third
embodiment is a modification of the second embodiment, but may be a
modification of the first embodiment.
[0363] In a controller of a data storage device according to the
third embodiment, in addition to the controller of the data storage
device according to the second embodiment, the storage medium
includes a block including the plurality of pages. The write
control unit makes a control that writes the piece of cluster data
together with metadata including the logical address and
information for specifying at least the block as the physical
address of the write destination into the storage unit. The read
control unit makes a control that reads the pieces of cluster data
stored at the physical address acquired from the storage unit,
extracts metadata which is written together with the read pieces of
cluster data, compares the logical address included in the
extracted metadata with the logical address of data which is
requested to be read, and reads the pieces of cluster data with the
identical logical address. The transfer control unit makes control
that determines pieces of cluster data to be transferred among the
pieces of cluster data written into the storage medium according to
a predetermined rule, acquires the physical address corresponding
to the determined pieces of cluster data from the storage unit,
reads the pieces of cluster data stored at the acquired physical
address, extracts metadata which is written together with the read
pieces of cluster data, compares the logical address included in
the extracted metadata with the logical address of the determined
pieces of cluster data, and reads the pieces of cluster data with
the identical logical address. The transfer control unit makes a
control that writes the pieces of cluster data together with the
metadata including the logical address into the storage medium, and
writes information for specifying at least the block as the
physical address of the transfer destination into the storage
unit.
[0364] In the controller of the data storage device according to
the third embodiment, the read control unit sequentially compares
the logical address from the last piece of cluster data in a
storing order of the pieces of cluster data. The transfer control
unit sequentially compares the logical address from the last piece
of cluster data in the storing order of the pieces of cluster
data.
[0365] Hereinafter, a detailed example will be described. First,
the structure of the data storage device according to the third
embodiment will be described. In the third embodiment, components
having the same functions as those in the second embodiment are
denoted by the same reference numerals as those in the second
embodiment. For example, the third embodiment differs from the
second embodiment in that a read/write target is not the first
memory 252, but is a first memory 352. The other components have
the same functions as those in the components according to the
second embodiment and are denoted by the same reference numerals as
those in the second embodiment.
[0366] FIG. 17 is a block diagram illustrating an example of the
outline of the functional structure of a data storage device 300
according to the third embodiment. As illustrated in FIG. 17, the
data storage device 300 includes a controller 310, the first access
unit 102, the first memory 352, the second access unit 103, the
second memory 153, the storage medium access unit 101, the storage
medium 251, the interface unit 106, the compression unit 104, and
the decompression unit 105.
[0367] (First Memory 352)
[0368] The first memory 352 stores management information. The
management information includes an address mapping table 164. In
addition, the first memory 352 may be configured so as to store
information derived from the information of the address mapping
table 164 in advance in order to simplify various processes
performed by the data storage device 300.
[0369] The address mapping table 164 manages the association
between the logical address of a cluster and the physical address
of the storage medium 251 in which data for the logical address is
stored. When information about the managed logical address is
minimized, the address mapping table 164 may manage only
information indicating a block 400. For example, the address
mapping table 162 manages, as the physical address of the storage
medium 251, a set of block number information, page number
information, information about a slot offset on a page, and
information about an offset on a slot. In contrast, as illustrated
in FIG. 18A, when the amount of information about the managed
physical address is minimized, the address mapping table 164 may
manage the block number information.
[0370] When the amount of information managed by the address
mapping table 164 increases, the amount of cluster data (which will
be described below) which is read and written is reduced. When the
amount of information managed by the address mapping table 164 is
reduced, the amount of cluster data (which will be described below)
which is read and written increases. Next, in the third embodiment,
a structure in which the address mapping table 164 manages a set of
the block number information and the page number information as
illustrated in FIG. 18B will be described. However, the structure
of the address mapping table 164 is not limited to that illustrated
in FIG. 18B, but may be other structures. In the third embodiment,
the address mapping table 164 does not store the information
indicating how many times greater the size of the data is than the
division size which is stored in the address mapping table 162, in
order to reduce the amount (size) of information.
[0371] (Controller 310)
[0372] The controller 310 includes a writing unit 211, a reading
unit 312, a write control unit 313, a read control unit 314, and a
transfer control unit 315.
[0373] (Reading Unit 312)
[0374] The reading unit 312 receives a cluster read request from a
read request source. The cluster read request includes read
destination information and data indicating the logical address of
the cluster to be read. The read destination information includes a
block number and a page number. The reading unit 312 extracts the
block number and the page number from the acquired read destination
information and instructs the storage medium access unit 101 to
read the data of the page 402 with the extracted page number in the
block 400 with the extracted block number, and acquires the data of
the page. The page 402 stores a plurality of slots, but the number
of slots stored in the page 402 may be changed. The unit of data
input and output for the storage medium 251 is the page 402.
Therefore, as described above, even when all data of the page is
read, no new process occurs in the reading process.
[0375] The reading unit 312 corrects the error of slot data
included in the acquired data of the page and acquires the error
corrected slot data. When error correction fails (error correction
is unavailable), the reading unit 312 notifies the read request
source of the occurrence of a read error. When error correction
succeeds (error correction is available), the reading unit 312
extracts the metadata of each slot from the error corrected data.
The reading unit 312 calculates the arrangement pattern of the
clusters stored in each slot from the magic number included in the
extracted metadata of each slot. When the magic number indicating
that the cluster is compressed and stored in the slot is not
included in the extracted metadata of each slot, the reading unit
312 determines that the cluster is stored in the slot without being
compressed. In addition, the reading unit 312 extracts the metadata
of each cluster from the error corrected data according to the
calculated arrangement pattern of the clusters. When the metadata
of the compressed and stored cluster is stored without being
compressed, the reading unit 312 directly extracts the metadata
from the error corrected data. When the metadata of the compressed
and stored cluster is compressed and stored, the reading unit 312
instructs the decompression unit 105 to decompress the error
corrected data and acquires the metadata.
[0376] As illustrated in FIG. 19, the cluster stored at the end of
the slot is a portion of or the entire compressed cluster according
to storage conditions. Therefore, it is necessary to determine
whether the cluster is a portion of or the entire compressed
cluster. The reading unit 312 may decompress the cluster to perform
the determination. Specifically, the reading unit 312 instructs the
decompression unit 105 to decompress the cluster stored at the end
of the slot. When decompression succeeds and cluster data
corresponding to the size of the cluster is obtained by the
decompression, it may be determined that the cluster is the entire
compressed cluster. On the other hand, when decompression fails or
cluster data which does not correspond to the size of the cluster
is obtained by the decompression, the reading unit 312 determines
that the cluster is a portion of the compressed cluster. In FIG.
19, for simplicity of explanation, the storage area of the metadata
or the error correction data in the slot is not illustrated.
[0377] When it is determined that the first cluster which is stored
first in the page 402 is the entire compressed cluster, the reading
unit 312 extracts the metadata of the cluster. On the other hand,
when it is determined that the first cluster which is stored first
in the page 402 is a portion of the compressed cluster (compressed
cluster data #6 when the right page of FIG. 19 is a read target
page), the reading unit 312 does not extract the metadata of the
cluster. The reason is as follows. The physical address of the
consecutive page immediately before the cluster is written to the
address mapping table 164. Therefore, when there is a request to
read the cluster, the reading unit 312 is requested to read the
consecutive page immediately before the cluster.
[0378] When it is determined that each of the clusters stored at
adjacent ends of adjacent slot in the page is a portion of the
compressed cluster as in compressed cluster data #4 illustrated in
FIG. 19, the clusters are added to form the entire compressed
cluster. Therefore, the reading unit 312 extracts the metadata of
the entire compressed cluster. When it is determined that each of
the clusters stored at adjacent ends of adjacent slot in the page
is the entire compressed cluster as in compressed cluster data #1
and #2 illustrated in FIG. 19, the reading unit 312 extracts the
metadata of each cluster.
[0379] When it is determined that the last cluster which is stored
last in the page 402 is a portion of the compressed cluster as in
compressed cluster data #6 in the left page, which is a read target
page, illustrated in FIG. 19, the last cluster is added to the
first cluster which is stored first in the next page 402 with a
consecutive physical address to form the entire cluster data.
Therefore, the reading unit 312 acquires data stored in the next
consecutive page 402 using the same process as that up to the error
correction process, adds the last cluster and the first cluster
which is stored first in the next page 402 with a consecutive
physical address, and extracts the entire cluster data. In
addition, the reading unit 312 extracts the metadata of the entire
cluster data. On the other hand, when it is determined that the
last cluster which is stored last in the page 402 is the entire
compressed cluster, the reading unit 312 extracts the metadata of
the cluster. The reading unit 312 extracts the logical address of
the cluster to be read which is included in the received read
request. The reading unit 312 extracts the logical address included
in the extracted metadata of each cluster. The reading unit 312
compares the extracted logical address of the cluster to be read
with the extracted logical address included in the metadata of each
cluster and determines the cluster with the identical logical
address to be the cluster to be read.
[0380] When there are a plurality of clusters with the same logical
address, the reading unit determines the last cluster in the page
402 among the plurality of clusters to be the cluster to be read.
Therefore, the reading unit sequentially compares the logical
addresses from the last cluster in the page 402, which makes it
possible to reduce the time required for comparison.
[0381] The reading unit 312 transmits the cluster data which has
been determined to be the cluster to be read to the decompression
unit 105, instructs the decompression unit 105 to decompress the
cluster data, and acquires the decompressed cluster data. In some
cases, the reading unit 312 does not transmit the cluster data
which has been determined to be the cluster to be read to the
decompression unit 105, if necessary. In this case, the reading
unit 312 replaces the decompressed cluster data in the subsequent
process with the cluster data to be read which is not transmitted
to the decompression unit 105. For example, when the cluster data
is stored in the storage medium 251 without being compressed, the
reading unit 312 does not transmit the cluster data to the
decompression unit 105. The reading unit 312 transmits the acquired
cluster data to the read request source.
[0382] (Write Control Unit 313)
[0383] The write control unit 313 performs processes other than the
following processes, similarly to the write control unit 213.
[0384] When receiving a write completion notice from the writing
unit 211, the write control unit 313 updates the address mapping
table 164 for the cluster written to the page. Specifically, the
write control unit 313 instructs the first access unit 102 to
perform a writing process such that the physical address of the
storage medium 251 indicated by the converted logical address in
the address mapping table 164 is updated to the physical address of
the storage medium 251, which is a write destination, for the
cluster written to the page. However, the physical address to be
updated of the storage medium 251, which a write destination,
includes the block number information and the page number
information included in the generated write destination
information. When the first cluster which is stored first in the
page 402 is a portion of the compressed cluster data (corresponding
to compressed cluster data #6 when the right page of FIG. 19 is the
page to which the writing of data has been completed), the write
control unit 313 does not update the address mapping table 164 for
the cluster. This is because the physical address of the previous
consecutive page is written to the address mapping table 164 for
the cluster. In addition, unlike the write control unit 213, the
write control unit 313 instructs the first access unit 102 to write
the information indicating how many times greater the size of the
data is than the division size which is acquired from the writing
unit 211 to the address mapping table 164 for the cluster written
to the page.
[0385] (Read Control Unit 314)
[0386] When receiving a read instruction from the interface unit
106, the read control unit 314 extracts data storage device address
information from the received read instruction. The read control
unit 314 converts the extracted data storage device address
information to a corresponding logical address. The read control
unit 314 acquires information associated with the converted logical
address. Specifically, the read control unit 314 instructs the
first access unit 102 to read the physical address of the storage
medium 251 indicated by the converted logical address in the
address mapping table 164, and acquires information about the
physical address. The physical address includes the block number
information and the page number information.
[0387] The read control unit 314 instructs the reading unit 312 to
perform a reading process, using the acquired physical address as
the read destination information and the converted logical address
as the logical address of the cluster to be read. When receiving a
notice indicating the occurrence of the read error from the reading
unit 312, the read control unit 314 transmits data indicating the
read error to the interface unit 106. The first memory 352 may
further store information indicating that the read error occurs
when the logical address is read as one of the management
information items. In this way, when a read request is issued for
the same logical address again, it is possible to rapidly return
the read error. When receiving the data read from the reading unit
312, the read control unit 314 transmits the received data to the
interface unit 106.
[0388] (Transfer Control Unit 315)
[0389] The transfer control unit 315 controls the following
transfer process according to a predetermined rule. First, the
transfer control unit 315 determines the cluster to be transferred.
Specifically, the transfer control unit 315 instructs the first
access unit 102 to read the management information from the first
memory 352 and acquires the management information. The transfer
control unit 315 determines the cluster to be transferred from the
acquired management information according to a predetermined rule.
The cluster to be transferred may be determined according to any
known rule. The transfer control unit 315 extracts the logical
address of the determined cluster from the acquired management
information.
[0390] Then, the transfer control unit 315 reads the cluster to be
transferred. Specifically, the transfer control unit 315 acquires
information associated with the extracted logical address. The
transfer control unit 315 instructs the first access unit 102 to
read the physical address of the storage medium 251 indicated by
the converted logical address in the address mapping table 164, and
acquires information indicating the physical address. The physical
address includes the block number information and the page number
information.
[0391] The transfer control unit 315 instructs the reading unit 312
to perform a reading process, using the acquired physical address
as the read destination information and the converted logical
address as the logical address of the cluster to be read. When
receiving a notice indicating the occurrence of the read error from
the reading unit 312, the transfer control unit 315 performs a
process of maintaining consistency such that an error occurs when
the cluster is read after the transfer process. For example, the
transfer control unit 315 may transfer cluster data with the read
error, without correcting the read error. In addition, the transfer
control unit 315 may insert information indicating that the read
error occurs when the logical address is read into the management
information stored in the first memory 352 such that the cluster
data with the read error is not transferred. The transfer control
unit 315 receives the data read from the reading unit 312.
[0392] The transfer control unit 315 writes the cluster to be
transferred. The process of writing the cluster to be transferred
in the transfer control unit 315 is the same as that in the
transfer control unit 215. The transfer control unit 315 repeatedly
performs the above-mentioned process until a write request for the
writing unit 211 corresponds to at least one page. The reason is as
follows. Since the unit of input and output for the storage medium
251 is the page 402, the transfer control unit 315 needs to write
data corresponding to at least one page in order to perform a
process of updating the management information, which will be
described. Therefore, the transfer process is not completed.
[0393] The transfer control unit 315 updates the management
information about the transferred cluster. Specifically, when
receiving the write completion notice from the writing unit 211,
the transfer control unit 315 updates the address mapping table 164
for the cluster written to the page. The transfer control unit 315
instructs the first access unit 102 to perform a writing process
such that the physical address of the storage medium 251 indicated
by the converted logical address in the address mapping table 164
is updated to the physical address of the storage medium 251, which
is a write destination, for the cluster written to the page.
However, the physical address to be updated of the storage medium
251, which a write destination, includes the block number
information and the page number information included in the
generated write destination information. When the first cluster
which is stored first in the page 402 is a portion of the
compressed cluster data (corresponding to compressed cluster data
#6 when the right page of FIG. 19 is the page to which the writing
of data has been completed), the transfer control unit 315 does not
update the address mapping table 164 for the cluster. This is
because the physical address of the previous consecutive page is
registered in the address mapping table 164 for the cluster. The
transfer control unit 315 repeatedly performs the above-mentioned
process according to a predetermined rule, if necessary.
[0394] Next, the operation of the data storage device 300 according
to the third embodiment will be described. First, the procedure of
the writing process performed by the data storage device 300 in
response to a write instruction from the host apparatus (not
illustrated) will be described with reference to FIG. 20. FIG. 20
is a flowchart illustrating an example of the procedure of the
writing process performed by the data storage device 300. In the
flowchart illustrated in FIG. 20, the write control unit 313 is
used instead of the write control unit 213, as compared to the
flowchart illustrated in FIG. 14. However, in the flowchart
illustrated in FIG. 20, processes which are substantially the same
as those illustrated in FIG. 14 are denoted by the same reference
numerals as those in FIG. 14.
[0395] (Writing Process)
[0396] In Step S722, the write control unit 313 updates the
management information. Specifically, the writing unit 211
transmits a notice indicating that the writing of data to the write
destination page has been completed to the write request source.
When receiving the write completion notice from the writing unit
211, the write control unit 313 updates the address mapping table
164 for the cluster written to the page. The write control unit 313
instructs the first access unit 102 to perform a writing process
such that the physical address of the storage medium 251 indicated
by the converted logical address in the address mapping table 164
is updated to the physical address of the storage medium 251, which
is a write destination, for the cluster written to the page.
However, the physical address to be updated of the storage medium
251, which is a write destination, includes the block number
information and the page number information included in the
generated write destination information. When the first cluster
which is stored first in the page 402 is a portion of the
compressed cluster data (corresponding to compressed cluster data
#6 when the right page of FIG. 19 is the page to which the writing
of data has been completed), the write control unit 313 does not
update the address mapping table 164 for the cluster. This is
because the physical address of the previous consecutive page is
registered in the address mapping table 164 for the cluster.
[0397] Next, the procedure of the reading process performed by the
data storage device 300 in response to a read instruction from the
host apparatus (not illustrated) will be described with reference
to FIG. 21. FIG. 21 is a flowchart illustrating an example of the
procedure of the reading process performed by the data storage
device 300.
[0398] (Reading Process)
[0399] In Step S800, the data storage device 300 receives a read
instruction. Specifically, the interface unit 106 receives
instructions including a write instruction and a read instruction
from, for example, the host apparatus (not illustrated). The write
instruction includes data storage device address information and
the write data. The read instruction includes the data storage
device address information.
[0400] The data storage device address information is provided from
the data storage device 300 to the host apparatus (not
illustrated).
[0401] For example, an LBA is an example of the data storage device
address information of an HDD (Hard Disk Drive) or an SSD. The size
of the data specified by LBA is set to, for example, 512 bytes. As
described above, the size of the data specified by the data storage
device address is generally different from the size of the data
(cluster) specified by the logical address. However, the data
storage device address and the logical address can be converted
into each other. For example, when the data storage device address
information is allocated for every 512 bytes and the logical
address is allocated for every 1024 bytes, the quotient of the data
storage device address information divided by 2 can be calculated
to convert the data storage device address information into the
logical address.
[0402] In the third embodiment, for simplicity of explanation, an
example in which the size of the data specified by the data storage
device address is equal to the size of the cluster will be
described. However, the invention is not limited thereto. The data
storage device 300 may be configured such that the size of the data
specified by the data storage device address is different from the
size of the cluster.
[0403] When the received instruction is a read instruction, the
interface unit 106 transmits the received read instruction to the
read control unit 314.
[0404] In Step S802, the read control unit 314 generates read
destination information. Specifically, when receiving the read
instruction from the interface unit 106, the read control unit 314
extracts the data storage device address information from the
received read instruction. Then, the read control unit 314 converts
the extracted data storage device address information into a
corresponding logical address. The read control unit 314 acquires
information associated with the converted logical address. The read
control unit 314 instructs the first access unit 102 to read the
physical address of the storage medium 251 indicated by the
converted logical address in the address mapping table 164, and
acquires information indicating the physical address. The physical
address includes the block number information and the page number
information.
[0405] In Step S804, the read control unit 314 reads all of the
areas designated by the read destination information. Specifically,
the read control unit 314 instructs the reading unit 312 to perform
a reading process, using the acquired physical address as the read
destination information and the converted logical address as the
logical address of the cluster to be read. The reading unit 312
receives a cluster read request from the read request source. The
cluster read request includes the read destination information and
data indicating the logical address of the cluster to be read. The
read destination information includes the block number and the page
number. The reading unit 312 extracts the block number and the page
number from the acquired read destination information, instructs
the storage medium access unit 101 to read the data of the page 402
with the extracted page number in the block 400 with the extracted
block number, and acquires the data of the page.
[0406] The page 402 stores a plurality of slots, but the number of
slots stored in the page 402 may be changed. The unit of data input
and output for the storage medium 251 is the page 402. Therefore,
even when all data of the page is read, no new process is
needed.
[0407] In Step S806, the read control unit 314 extracts the
metadata. Specifically, the reading unit 312 corrects the error of
slot data included in the acquired data of the page and acquires
the error corrected slot data. When error correction fails (error
correction is unavailable), the reading unit 312 notifies the read
request source of the occurrence of a read error. When receiving a
notice indicating the occurrence of the read error from the reading
unit 312, the read control unit 314 transmits data indicating the
read error to the interface unit 106. When reading the logical
address, the first memory 352 may further store information
indicating that the read error occurs when the logical address is
read as one of the management information items. In this way, when
a read request is issued for the same logical address again, it is
possible to rapidly return the read error.
[0408] When receiving the data (data indicating the read error)
from the read control unit 114, the interface unit 106 transmits
the received data to the host apparatus (not illustrated). When
error correction succeeds (error correction is available), the
reading unit 312 extracts the metadata of each slot from the error
corrected data. The reading unit 312 calculates the arrangement
pattern of the clusters stored in each slot from the magic number
included in the extracted metadata of each slot. When the magic
number indicating that the cluster is compressed and stored in the
slot is not included in the extracted metadata of each slot, the
reading unit 312 determines that the cluster is stored in the slot
without being compressed. In addition, the reading unit 312
extracts the metadata of each cluster from the error corrected data
according to the calculated arrangement pattern of the clusters.
When the metadata of the compressed and stored cluster is stored
without being compressed, the reading unit 312 may directly extract
the metadata from the error corrected data. On the other hand, when
the metadata of the compressed and stored cluster is compressed and
stored, the reading unit 312 can instruct the decompression unit
105 to decompress the error corrected data and acquire the
metadata.
[0409] As illustrated in FIG. 19, the cluster stored at the end of
the slot is a portion of or the entire compressed cluster according
to storage conditions. Therefore, it is necessary to determine
whether the cluster is a portion of or the entire compressed
cluster. The reading unit 312 may decompress the cluster to perform
the determination. Specifically, the reading unit 312 instructs the
decompression unit 105 to decompress the cluster stored at the end
of the slot. When decompression succeeds and cluster data
corresponding to the size of the cluster is obtained by the
decompression, the read control unit 314 can determine that the
cluster is the entire compressed cluster. On the other hand, when
decompression fails or cluster data which does not correspond to
the size of the cluster is obtained by the decompression, it is
possible to determine that the cluster is a portion of the
compressed cluster. In FIG. 19, for simplicity of explanation, the
storage area of the metadata or the error correction data in the
slot is not illustrated.
[0410] When it is determined that the first cluster which is stored
first in the page 402 is the entire compressed cluster, the reading
unit 312 extracts the metadata of the cluster. On the other hand,
when it is determined that the first cluster which is stored first
in the page 402 is a portion of the compressed cluster (compressed
cluster data #6 when the right page of FIG. 19 is a read target
page), the reading unit 312 does not extract the metadata of the
cluster. The reason is as follows. The physical address of the
consecutive page immediately before the cluster is registered in
the address mapping table 164. Therefore, when there is a request
to read the cluster, the reading unit 312 is requested to read the
consecutive page immediately before the cluster.
[0411] When it is determined that each of the clusters stored at
adjacent ends of adjacent slot in the page is a portion of the
compressed cluster as in compressed cluster data #4 illustrated in
FIG. 19, the clusters are added to form the entire compressed
cluster. Therefore, the reading unit 312 extracts the metadata of
the entire compressed cluster. When it is determined that each of
the clusters stored at adjacent ends of adjacent slot in the page
is the entire compressed cluster as in compressed cluster data #1
and #2 illustrated in FIG. 19, the reading unit 312 extracts the
metadata of each cluster.
[0412] When it is determined that the last cluster which is stored
last in the page 402 is a portion of the compressed cluster as in
compressed cluster data #6 in the left page, which is a read target
page, illustrated in FIG. 19, the last cluster is added to the
first cluster which is stored first in the next page 402 with a
consecutive physical address to form the entire cluster data.
Therefore, the reading unit 312 acquires data stored in the next
consecutive page 402 using the same process as that up to the error
correction process, adds the last cluster and the first cluster
which is stored first in the next page 402 with a consecutive
physical address, and extracts the entire cluster data. In
addition, the reading unit 312 extracts the metadata of the entire
cluster data. On the other hand, when it is determined that the
last cluster which is stored last in the page 402 is the entire
compressed cluster, the reading unit 312 extracts the metadata of
the cluster.
[0413] In Step S808, the reading unit 312 extracts data to be read.
Specifically, the reading unit 312 extracts the logical address of
the cluster to be read which is included in the received read
request. The reading unit 312 extracts the logical address included
in the extracted metadata of each cluster. The reading unit 312
compares the extracted logical address of the cluster to be read
with the extracted logical address included in the metadata of each
cluster and determines the cluster with the identical logical
address to be the cluster to be read.
[0414] When there are a plurality of clusters with the same logical
address, the reading unit 312 determines the last cluster in the
page 402 among the plurality of clusters to be the cluster to be
read. Therefore, the reading unit 312 sequentially compares the
logical addresses from the last cluster in the page 402, which
makes it possible to reduce the time required for comparison.
[0415] In Step S810, the controller 310 decompresses the data to be
read and returns the decompressed data to the host apparatus.
Specifically, the reading unit 312 transmits the cluster data which
has been determined to be the cluster to be read to the
decompression unit 105, instructs the decompression unit 105 to
decompress the cluster data, and acquires the decompressed cluster
data. In some cases, the reading unit 312 does not transmit the
cluster data which has been determined to be the cluster to be read
to the decompression unit 105, if necessary. In this case, the
reading unit 312 replaces the decompressed cluster data in the
subsequent process with the cluster data to be read which is not
transmitted to the decompression unit 105. For example, when the
cluster data is stored in the storage medium 251 without being
compressed, the reading unit 312 does not transmit the cluster data
to the decompression unit 105. The reading unit 312 transmits the
acquired decompressed cluster data to the read request source. When
receiving the data read from the reading unit 312, the read control
unit 314 transmits the received data to the interface unit 106.
When receiving the data from the read control unit 314, the
interface unit 106 transmits the received data to the host
apparatus (not illustrated).
[0416] Next, the procedure of the transfer process performed by the
data storage device 300 will be described with reference to FIG.
22. FIG. 22 is a flowchart illustrating an example of the procedure
of the transfer process performed by the data storage device 300.
The transfer control unit 315 controls the transfer process
illustrated in FIG. 22 according to a predetermined rule. In the
flowchart illustrated in FIG. 22, the transfer control unit 315 is
used instead of the transfer control unit 215, as compared to the
flowchart illustrated in FIG. 16. However, in the flowchart
illustrated in FIG. 22, processes which are substantially the same
as those illustrated in FIG. 16 are denoted by the same reference
numerals as those in FIG. 16.
[0417] (Transfer Process)
[0418] In Step S900, the transfer control unit 315 determines the
cluster to be transferred. Specifically, the transfer control unit
315 instructs the first access unit 102 to read the management
information from the first memory 352 and acquires the management
information. The transfer control unit 315 determines the cluster
to be transferred from the acquired management information using a
predetermined method. In the third embodiment, any known method may
be used to determine the cluster to be transferred. The transfer
control unit 315 extracts the logical address of the determined
cluster from the acquired management information.
[0419] In Step S902, the transfer control unit 315 generates the
read destination information. Specifically, the transfer control
unit 315 acquires information associated with the extracted logical
address. For example, the transfer control unit 315 instructs the
first access unit 102 to read the physical address of the storage
medium 251 indicated by the converted logical address in the
address mapping table 164, and acquires information indicating the
physical address. The physical address includes the block number
information and the page number information.
[0420] In Step S904, the transfer control unit 315 reads all of the
areas designated by the read destination information. Specifically,
the transfer control unit 315 instructs the reading unit 312 to
perform a reading process, using the acquired physical address as
the read destination information and the converted logical address
as the logical address of the cluster to be read. The reading unit
312 receives a cluster read request from the read request source.
The cluster read request includes the read destination information
and data indicating the logical address of the cluster to be read.
The read destination information includes the block number and the
page number. The reading unit 312 extracts the block number and the
page number from the acquired read destination information,
instructs the storage medium access unit 101 to read the data of
the page 402 with the extracted page number in the block 400 with
the extracted block number, and acquires the data of the page.
[0421] The page 402 stores a plurality of slots, but the number of
slots stored in the page 402 may be changed. The unit of data input
and output for the storage medium 251 is the page 402. Therefore,
even when all data of the page is read, no new process is
needed.
[0422] In Step S906, the transfer control unit 315 extracts the
metadata. Specifically, the reading unit 312 corrects the error of
slot data included in the acquired data of the page and acquires
the error corrected slot data. When error correction fails (error
correction is unavailable), the reading unit 312 notifies the read
request source of the occurrence of a read error. When receiving a
notice indicating the occurrence of the read error from the reading
unit 312, the transfer control unit 315 performs a process of
maintaining consistency such that an error occurs when the cluster
is read after the transfer process. For example, the transfer
control unit 315 may transfer the cluster data with the read error,
without correcting the read error. In addition, the transfer
control unit 315 may insert information indicating that the read
error occurs when the logical address is read into the management
information stored in the first memory 352 such that the cluster
data with the read error is not transferred. When error correction
succeeds (error correction is available), the reading unit 312
extracts the metadata of each slot from the error corrected data.
The reading unit 312 calculates the arrangement pattern of the
clusters stored in each slot from the magic number included in the
extracted metadata of each slot. When the magic number indicating
that the cluster is compressed and stored in the slot is not
included in the extracted metadata of each slot, the reading unit
312 determines that the cluster is stored in the slot without being
compressed.
[0423] The reading unit 312 extracts the metadata of each cluster
from the error corrected data according to the calculated
arrangement pattern of the clusters. When the metadata of the
compressed and stored cluster is stored without being compressed,
the reading unit 312 directly extracts the metadata from the error
corrected data. When the metadata of the compressed and stored
cluster is compressed and stored, the reading unit 312 instructs
the decompression unit 105 to decompress the error corrected data
and acquires the metadata.
[0424] As illustrated in FIG. 19, the cluster stored at the end of
the slot is a portion of or the entire compressed cluster according
to storage conditions. Therefore, it is necessary to determine
whether the cluster stored at the end of the slot is a portion of
or the entire compressed cluster. The reading unit 312 decompresses
the cluster to determine whether the cluster is a portion of or the
entire compressed cluster. Specifically, the reading unit 312
instructs the decompression unit 105 to decompress the cluster
stored at the end of the slot. When decompression succeeds and
cluster data corresponding to the size of the cluster is obtained
by the decompression, the reading unit 312 determines that the
cluster is the entire compressed cluster. On the other hand, when
decompression fails or cluster data which does not correspond to
the size of the cluster is obtained by the decompression, the
reading unit 312 determines that the cluster is a portion of the
compressed cluster. In FIG. 19, for simplicity of explanation, the
storage area of the metadata or the error correction data in the
slot is not illustrated.
[0425] When it is determined that the first cluster which is stored
first in the page 402 is the entire compressed cluster, the reading
unit 312 extracts the metadata of the cluster. On the other hand,
when it is determined that the first cluster which is stored first
in the page 402 is a portion of the compressed cluster (compressed
cluster data #6 when the right page of FIG. 19 is a read target
page), the reading unit 312 does not extract the metadata of the
cluster. The reason is as follows. The physical address of the
consecutive page immediately before the cluster is written to the
address mapping table 164. Therefore, when there is a request to
read the cluster, the reading unit 312 is requested to read the
consecutive page immediately before the cluster.
[0426] When it is determined that each of the clusters stored at
adjacent ends of adjacent slot in the page is a portion of the
compressed cluster as in compressed cluster data #4 illustrated in
FIG. 19, the clusters are added to form the entire compressed
cluster. Therefore, the reading unit 312 extracts the metadata of
the entire compressed cluster. When it is determined that each of
the clusters stored at adjacent ends of adjacent slot in the page
is the entire compressed cluster as in compressed cluster data #1
and #2 illustrated in FIG. 19, the reading unit 312 extracts the
metadata of each cluster.
[0427] When it is determined that the last cluster which is stored
last in the page 402 is a portion of the compressed cluster as in
compressed cluster data #6 in the left page, which is a read target
page, illustrated in FIG. 19, the last cluster is added to the
first cluster which is stored first in the next page 402 with a
consecutive physical address to form the entire cluster data.
Therefore, the reading unit 312 acquires data stored in the next
consecutive page 402 using the same process as that up to the error
correction process, adds the last cluster and the first cluster
which is stored first in the next page 402 with a consecutive
physical address, and extracts the entire cluster data. In
addition, the reading unit 312 extracts the metadata of the entire
cluster data. On the other hand, when it is determined that the
last cluster which is stored last in the page 402 is the entire
compressed cluster, the reading unit 312 extracts the metadata of
the cluster.
[0428] In Step S908, the reading unit 312 extracts the data to be
read. Specifically, the reading unit 312 extracts the logical
address of the cluster to be read which is included in the received
read request. The reading unit 312 extracts the logical address
included in the extracted metadata of each cluster. The reading
unit 312 compares the extracted logical address of the cluster to
be read with the extracted logical address included in the metadata
of each cluster and determines the cluster with the identical
logical address to be the cluster to be read.
[0429] When there are a plurality of clusters with the same logical
address, the reading unit 312 determines the last cluster in the
page 402 among the plurality of clusters to be the cluster to be
read. Therefore, the reading unit 312 sequentially compares the
logical addresses from the last cluster in the page 402, which
makes it possible to reduce the time required for comparison.
[0430] In Step S910, the reading unit 312 decompresses the read
target data which has been read. Specifically, the reading unit 312
transmits the cluster data which has been determined to be the
cluster to be read to the decompression unit 105, instructs the
decompression unit 105 to decompress the cluster data, and acquires
the decompressed cluster data. In some cases, the reading unit 312
does not transmit the cluster data which has been determined to be
the cluster to be read to the decompression unit 105, if necessary.
In this case, the reading unit 312 replaces the decompressed
cluster data in the subsequent process with the cluster data to be
read which is not transmitted to the decompression unit 105. For
example, when the cluster data is stored in the storage medium 251
without being compressed, the reading unit 312 does not transmit
the cluster data to the decompression unit 105. The reading unit
312 transmits the acquired cluster data to the read request source.
The transfer control unit 315 receives the data read from the
reading unit 312.
[0431] In Step S932, the transfer control unit 315 updates the
management information. Specifically, the writing unit 211
transmits a notice indicating that the writing of data to the write
destination page has been completed to the write request source.
When receiving the write completion notice from the writing unit
211, the transfer control unit 315 updates the address mapping
table 164 for the cluster written to the page. The transfer control
unit 315 instructs the first access unit 102 to perform a writing
process such that the physical address of the storage medium 251
indicated by the converted logical address in the address mapping
table 164 is updated to the physical address of the storage medium
251, which is a write destination, for the cluster written to the
page. However, the physical address to be updated of the storage
medium 251, which a write destination, includes the block number
information and the page number information included in the
generated write destination information. When the first cluster
which is stored first in the page 402 is a portion of the
compressed cluster data (corresponding to compressed cluster data
#6 when the right page of FIG. 19 is the page to which the writing
of data has been completed), the transfer control unit 315 does not
update the address mapping table 164 for the cluster. This is
because the physical address of the previous consecutive page is
registered in the address mapping table 164 for the cluster.
[0432] As such, according to the third embodiment, it is possible
to reduce the size of the address mapping table 164, as compared to
the size of the address mapping table 162 according to the second
embodiment. That is, according to the third embodiment, it is
possible to reduce memory capacity required for the first memory
352, as compared to memory capacity required for the first memory
252 according to the second embodiment.
Fourth Embodiment
[0433] However, in the first to third embodiments, in some cases,
the writing unit 111 or the writing unit 211 gives an instruction
not to compress data. In addition, in some cases, the reading unit
112, the reading unit 212, or the reading unit 312 gives an
instruction not to decompress data. The fourth embodiment is an
example of a combination of a structure in which the compression
process is not performed and a structure in which the decompression
process is not performed. The combination of the structure in which
the compression process is not performed and the structure in which
the decompression process is not performed in the fourth embodiment
is an illustrative example, but other combinations thereof may be
made. Here, the fourth embodiment, which is a modification of the
data storage device 300, will be described. However, the fourth
embodiment may be a modification of the data storage device 100 or
the data storage device 200.
[0434] (First Combination)
[0435] First, a first combination will be described. In the first
combination, the data storage device 300 (the data storage device
100 or the data storage device 200) does not compress and store the
data which is requested to be written by the host apparatus, but
stores the data to be transferred. That is, when the cluster data
which is requested to be written by the host apparatus is stored in
the storage medium, the data storage device 300 does not compress
the cluster data. When the cluster data to be transferred is stored
in the storage medium, the data storage device 300 compresses the
cluster data. When reading the cluster data which has been
requested to be written by the host apparatus and then stored in
the storage medium, the data storage device 300 does not decompress
the read cluster data. When reading the cluster data which has been
transferred and stored in the storage medium from the storage
medium, the data storage device 300 decompresses the read cluster
data.
[0436] Specifically, when receiving a write request from the write
control unit 313, the writing unit 211 does not transmits the
cluster data to be written to the compression unit 104 and
instructs the storage medium access unit 101 to write the cluster
data, which is a write target, to the storage medium 251.
Therefore, when the data which has been requested to be written by
the host apparatus and then stored in the storage medium is read,
the reading unit 312 returns the data read from the storage medium
251 to the read request source, without transmitting the data to
the decompression unit 105, since the data stored without being
compressed.
[0437] When receiving a write request from the transfer control
unit 315, the writing unit 211 transmits the cluster data to be
written to the compression unit 104 and instructs the storage
medium access unit 101 to write the compressed data to the storage
medium 251. Therefore, when the transferred data is read, the
reading unit 312 transmits the data read from the storage medium
251 to the decompression unit 105 since the data is compressed and
stored and returns the decompressed data to the read request
source.
[0438] (Second Combination)
[0439] Next, a second combination based on the first combination
will be described. In the first combination, in the data storage
device 300, the transferred data is compressed and stored.
Therefore, in the second combination, when the previously
transferred data is a transfer source, the data, which is the
transfer source, is read in a compressed state and is then written
to a transfer destination in the compressed state. In this way, a
data decompression process during reading in the transfer process
and a data compression process during writing in the transfer
process are reduced.
[0440] In the controller of the data storage device according to
the second combination, the transfer control unit makes control
that does not decompress a piece of cluster data read for piece of
cluster data to be transferred again and being written into the
storage medium by the control of the transfer control unit among
the pieces of cluster data to be transferred which are determined
according to a predetermined rule, and a control that does not
compress the pieces of cluster data by the external compression
unit, in addition to the controller of the data storage device
according to the first combination.
[0441] Specifically, when receiving a write request from the write
control unit 313, the writing unit 211 instructs the storage medium
access unit 101 to write cluster data, which is a write target, to
the storage medium 251, without transmitting the cluster data to
the compression unit 104. When reading the data which has been
requested to be written by the host apparatus and then stored in
response to a read request from the host apparatus, the reading
unit 312 returns the data read from the storage medium 251 to the
read request source, without transmitting the data to the
decompression unit 105, since the data is stored without being
compressed.
[0442] When the data to be read has been previously transferred and
is requested to be read by a read control unit of the host
apparatus, the reading unit 312 transmits the data read from the
storage medium 251 to the decompression unit 105 since the data is
compressed and stored and returns the decompressed data to the read
request source.
[0443] When the data to be read has been previously transferred and
is requested to be read by the transfer control unit, the reading
unit 312 returns the data read from the storage medium 251 to the
read request source, without transmitting the data to the
decompression unit 105 in order to reduce the data decompression
process during reading in the transfer process although the data is
compressed and stored.
[0444] In a case in which a write request is received from the
transfer control unit 315, when the data to be transferred has not
been previously transferred (the data has been requested to be
written by the host apparatus and has not been transferred), the
writing unit 211 transmits the cluster data to be written to the
compression unit 104 and instructs the storage medium access unit
101 to write the compressed data to the storage medium 251.
[0445] In a case in which a write request is received from the
transfer control unit 315, when the data to be transferred has been
previously transferred, the writing unit 211 instructs the storage
medium access unit 101 to write the cluster data, which is a write
target, to the storage medium 251, without transmitting the cluster
data to the compression unit 104, in order to reduce the data
compression process during writing in the transfer process.
[0446] (Third Combination)
[0447] Next, a third combination will be described. In the third
combination, the data storage device 300 compresses and stores the
data which is requested to be written by the host apparatus,
constantly reads the compressed data, which is a transfer source,
in the transfer process, and writes the compressed data to a
transfer destination. In this way, the data decompression process
during reading in the transfer process and the data compression
process during writing in the transfer process are constantly
reduced.
[0448] In the third combination, the write control unit in the
controller of the data storage device 300 (the data storage device
100 or the data storage device 200) performs control such that the
compression unit compresses the cluster data, the read control unit
performs control such that the decompression unit decompresses the
cluster data, the transfer control unit performs control such that
the decompression unit does not decompress the cluster data and the
compression unit does not compress the cluster data.
[0449] Specifically, when receiving a write request from the write
control unit 313, the writing unit 211 transmits the cluster target
to be written to the compression unit 104 and instructs the storage
medium access unit 101 to write the compressed data to the storage
medium 251.
[0450] When receives a read request from the transfer control unit
315, the reading unit 312 returns the data read from the storage
medium 251 to the read request source, without transmitting the
data to the decompression unit 105, in order to reduce the data
decompression process during reading in the transfer process
although the data is compressed and stored.
[0451] When a write request is received from the transfer control
unit 315, the writing unit 211 instructs the storage medium access
unit 101 to write the cluster data, which is a write target, to the
storage medium 251, without transmitting the cluster data to the
compression unit 104 in order to reduce the data compression
process during writing in the transfer process.
[0452] When a read request is received from the read control unit
314, the reading unit 312 transmits the data read from the storage
medium 251 to the decompression unit 105 since the data is
compressed and stored and returns the decompressed data to the read
request source.
[0453] (Fourth Combination)
[0454] Next a fourth combination will be described. In the fourth
combination, when the time required for the compression process is
equal to or greater than a predetermined threshold value, the data
storage device 300 cancels a process of compressing and storing the
cluster and stores the cluster without compression.
[0455] In the fourth combination, the write control unit in the
controller of the data storage device 300 (the data storage device
100 or the data storage device 200) performs control such that,
when the time required for the compression unit to compress cluster
data is equal to or more than a predetermined time, the compression
of the cluster data by the compression unit is cancelled, the
cluster data whose compression is cancelled is written to the
storage medium according to the physical address of a write
destination, and the correspondence between the logical address and
the physical address of the write destination is written to the
storage unit; the read control unit performs control such that,
when the read cluster data is not compressed, the read cluster data
is output without being decompressed by the decompression unit; and
the transfer control unit performs control such that, when the read
cluster data is not compressed, the decompression unit does not
decompress the read cluster data, and when the time required for
the compression unit to compress the cluster data is equal to or
more than a predetermined time, the compression of the cluster data
by the compression unit is cancelled, the cluster data whose
compression is cancelled is written to the storage medium according
to the physical address of a write destination, and the
correspondence between the logical address and the physical address
of the write destination is written to the storage unit.
[0456] Specifically, the writing unit 211 transmits the cluster
data to be written to the compression unit 104. When receiving the
compressed data from the compression unit 104 at the time that is
less than the predetermined threshold value, the writing unit 211
instructs the storage medium access unit 101 to write the acquired
compressed cluster data to the storage medium 251. Therefore, when
the compressed and stored data is read, the reading unit 312
transmits the data read from the storage medium 251 to the
decompression unit 105 and returns the decompressed data to the
read request source.
[0457] The writing unit 211 transmits the cluster data to be
written to the compression unit 104. When the compressed data is
not received from the compression unit 104 after the time equal to
or more than the predetermined threshold value has elapsed, the
writing unit 211 instructs the storage medium access unit 101 to
write the (non-compressed) cluster data, which is a write target,
to the storage medium 251. Therefore, when the data which is stored
without being compressed is read, the reading unit 312 returns the
data read from the storage medium 251 to the read request source,
without transmitting the data to the decompression unit 105.
[0458] However, in general, the time required for the data
compression process is relatively longer than that required for the
data transfer process. Here, the peak write performance of the data
storage device 300 represents the performance when it is not
necessary to perform the transfer process and only the writing
process requested by the host apparatus is performed. Therefore, in
the first combination or the second combination in which the data
compression process is not performed in the writing process
requested by the host apparatus, it is possible to improve the peak
write performance of the data storage device.
[0459] In a semiconductor storage medium, such as NAND flash
memory, the time required for the data writing process is more than
that required for the data transfer process or the data reading
process. When the compression efficiency of the data which is
requested to be written is very high, the amount of data written to
the semiconductor storage medium is significantly reduced. As a
result, the time required to write data to the semiconductor
storage medium is significantly reduced. Therefore, in some cases,
the total processing time including the time required to compress
data is reduced. When the compression efficiency of data is very
high, the data storage device 300 according to the third
combination of the fourth embodiment performs the data compression
process in the writing process requested by the host apparatus. In
this way, it is possible to improve the write performance of the
data storage device. In addition, in the data storage device 300
according to the third combination of the fourth embodiment, since
the data compression process is performed in the writing process
requested by the host apparatus, it is possible to minimize the
amount of data written to the storage medium. Therefore, it is
possible to maximize the lifespan of the data storage device.
[0460] In the data storage device 300 according to the fourth
combination of the fourth embodiment, when the time required for
the compression process is equal to or greater than the
predetermined threshold value, the process of compressing and
storing the cluster data is cancelled and the cluster data is
stored without being compressed. Therefore, it is possible to
appropriately set the balance between an improvement in the write
performance of the data storage device and an increase in the
lifespan of the data storage device.
Fifth Embodiment
[0461] As an example of the effect of the fourth embodiment, the
peak write performance of the data storage device 300 is improved.
However, when the data which is requested to be written by the host
apparatus is stored in the storage medium without being compressed,
the capacity of data written to the storage medium is more than
that when data is stored without being compressed, even though data
is compressed and stored in the storage medium in the transfer
process.
[0462] However, in general, when the compression ratio of data
increases, the time required to compress data increases. When the
compression ratio of data is reduced, the time required to compress
data is reduced. Therefore, the data which is requested to be
written by the host apparatus is compressed at a low compression
ratio and is then stored in the storage medium. Data is written at
a high compression ratio in the transfer process and is then stored
in the storage medium. In this way, it is possible to reduce the
capacity of data written to the storage medium, without damaging
the peak write performance of the data storage device.
[0463] Next, a detailed example of the fifth embodiment will be
described. Here, the fifth embodiment is a modification of the data
storage device 300. However, the fifth embodiment may be a
modification of the data storage device 100 or the data storage
device 200. Combinations of the structures of the data storage
device 300 according to the fifth embodiment are illustrative, but
the data storage device 300 may have various other combinations of
the structures.
[0464] (First Combination)
[0465] First, a first combination will be described. In the first
combination, the write control unit in the controller of the data
storage device 300 (the data storage device 100 or the data storage
device 200) performs control such that data which is requested to
be written by an external apparatus is converted into a plurality
of cluster data pieces with the size of the cluster, an external
compression unit compresses the converted cluster data at a first
compression ratio, the compressed cluster data is written to the
storage medium according to the physical address of a write
destination, and the correspondence between the logical address and
the physical address of the write destination is written to the
storage unit; the read control unit performs control such that the
physical address of data which is requested to be read by the
external apparatus is acquired from the storage unit, the cluster
data is read from the storage medium according to the acquired
physical address, an external decompression unit decompresses the
read cluster data at the first compression ratio or a second
compression ratio higher than the first compression ratio, and the
decompressed cluster data is output; and the transfer control unit
performs control such that the cluster data to be transferred among
the cluster data pieces written to the storage medium is determined
according to a predetermined rule, the determined cluster data is
read from the storage medium, the external decompression unit
decompresses the read cluster data at the first compression ratio
or the second compression ratio, the external compression unit
compresses the decompressed cluster data at the second compression
ratio, the compressed cluster data is written to the storage medium
according to the physical address of a transfer destination, and
the correspondence between the logical address and the physical
address of the transfer destination is written to the storage
unit.
[0466] Specifically, in the data storage device 300 according to
the first combination, the compression unit 104 can set a plurality
of compression ratios. The decompression unit 105 can decompress
each of the data pieces which are compressed at the plurality of
compression ratios. When a write request is received from the write
control unit 313, the writing unit 211 transmits the cluster data
to be written to the compression unit 104 such that the compression
unit compresses the cluster data at a low compression ratio and
instructs the storage medium access unit 101 to write the
compressed data to the storage medium 251. Therefore, when data
which is requested to be written by the host apparatus is read, the
reading unit 312 transmits the data read from the storage medium
251 to the decompression unit 105 since the data is compressed at
the low compression ratio, instructs the decompression unit 105 to
decompress the data compressed at the low compression ratio, and
returns the decompressed data to the read request source.
[0467] When receiving a write request from the transfer control
unit 315, the writing unit 211 transmits the cluster data to be
written to the compression unit 104 such that the compression unit
104 compresses the cluster data at a high compression ratio, and
instructs the storage medium access unit 101 to write the
compressed data to the storage medium 251. Therefore, when the
transferred data is read, the reading unit 312 transmits the data
read from the storage medium 251 to the decompression unit 105
since the data is compressed at the high compression ratio,
instructs the decompression unit 105 to decompress the data
compressed at the high compression ratio, and returns the
decompressed data to the read request source.
[0468] (Second Combination)
[0469] Next, a second combination will be described. In the second
combination, in the data storage device 300, when the previously
transferred data is a transfer source and the compression ratio in
the previous transfer process is equal to that in the current
transfer process, the compressed data, which is the transfer
source, is read without being decompressed and is then written to a
transfer destination, similarly to the second combination of the
fourth embodiment. In this way, the data decompression process
during reading in the transfer process and the data compression
process during writing in the transfer process are reduced.
[0470] Specifically, the compression unit 104 can set a plurality
of compression ratios and the decompression unit 105 can set a
plurality of compression ratios. When receiving a write request
from the write control unit 313, the writing unit 211 transmits the
cluster data to be written to the compression unit 104 such that
the compression unit 104 compresses the cluster data at a low
compression ratio, and instructs the storage medium access unit 101
to write the compressed data to the storage medium 251. Therefore,
when data which has been requested to be written by the host
apparatus and then stored is read, the reading unit 312 transmits
the data read from the storage medium 251 to the decompression unit
105 since the data is compressed at the low compression ratio,
instructs the decompression unit 105 to decompress the data
compressed at the low compression ratio, and returns the
decompressed data to the read request source.
[0471] When the data to be read has been previously transferred and
is requested to be read by the read control unit 314, the reading
unit 312 transmits the data read from the storage medium 251 to the
decompression unit 105 since the data is compressed at a high
compression ratio and is then stored, instructs the decompression
unit 105 to decompress the data compressed at the high compression
ratio, and returns the decompressed data to the read request
source.
[0472] In a case in which the data to be read has been previously
transferred and is requested to be read by the transfer control
unit, when the data is compressed at a high compression ratio and
is then stored and the compression ratio in the previous transfer
process is equal to that in the current transfer process, the
reading unit 312 transmits the data read from the storage medium
251 to the read request source, without transmitting the data to
the decompression unit 105, in order to reduce the data
decompression process during reading in the transfer process.
[0473] When a write request is received from the transfer control
unit 315 and the data to be transferred has not been previously
transferred (the data has not been requested to be written by the
host apparatus and transferred), the writing unit 211 transmits the
cluster data to be written to the compression unit 104 such that
the compression unit 104 compresses the cluster data at a high
compression ratio, and instructs the storage medium access unit 101
to write the compressed data to the storage medium 251.
[0474] On the other hand, in a case in which a write request is
received from the transfer control unit 315 and the data to be
transferred has been previously transferred, when the compression
ratio in the previous transfer process is equal to that in the
current transfer process, the writing unit 211 instructs the
storage medium access unit 101 to write the cluster data, which is
a write target, to the storage medium 251, without transmitting the
cluster data to the compression unit 104 in order to reduce the
data compression process during reading in the transfer
process.
Sixth Embodiment
[0475] A data storage device without a data compression function
provides, to the host apparatus, a capacity obtained by subtracting
a predetermined capacity required for, for example, a transfer
process from the capacity of the storage medium capable of storing
data as a capacity (hereinafter, referred to as declared capacity)
which is allowed to be used for the host apparatus. In the sixth
embodiment, a variation in the structure of the declared capacity
in the data storage device with the data compression function
according to the first to fifth embodiments will be described. The
data storage device without the data compression function according
to the sixth embodiment and the data storage device with the data
compression function according to the first to fifth embodiments
are similar in the capacity of the storage medium capable of
storing data and the capacity required for, for example, the
transfer process, but the invention is not limited thereto. The
sixth embodiment may be a modification of the data storage device
100, the data storage device 200, or the data storage device
300.
[0476] (First Structure)
[0477] The first structure of the declared capacity provides the
same declared capacity as that of the data storage device without
the data compression function to the host apparatus. In this
structure, the amount of data written to the storage medium is
reduced according to the compression result of data and the
lifespan of the data storage device increases.
[0478] (Second Structure)
[0479] In the data storage device with the data compression
function, the amount of data which is actually stored in the
storage medium is the same as that in a case in which data is not
compressed according to the compression result of data, but the
data storage device stores a large amount of data than the case.
Therefore, the second structure provides a capacity more than the
declared capacity of the data storage device without the data
compression function to the host apparatus.
[0480] In some cases, in practice, a data capacity less than the
declared capacity provided to the host apparatus is stored in the
storage medium according to the compression result of data. In this
case, it is difficult to process a new write request from the host
apparatus. Therefore, in this case, the data storage device returns
a write error in response to a new write request from the host
apparatus. In addition, the data storage device may have a function
of notifying the host apparatus of the remaining capacity capable
of storing data according to the compression result of data.
[0481] As described in the second embodiment, when the size of the
compressed data is set to a predetermined unit, the data storage
device 200 according to the sixth embodiment may use the maximum
value of the declared capacity as a capacity capable of storing
data at the maximum compression ratio. In this case, when it is
difficult to process the write request from the host apparatus, the
data storage device returns a write error.
[0482] Specifically, for example, when the data size of the
compressed cluster is adjusted to one of four parts divided from
the area in which a non-compressed cluster is stored, the maximum
value of the declared capacity may be four times the declared
capacity of the data storage device without the data compression
function. However, in this case, there are the above-mentioned
restrictions.
[0483] In this structure, the capacity of data written to the
storage medium is reduced according to the compression result of
data and the lifespan of the data storage device increases. In
addition, it is possible to provide a declared capacity more than
that of the data storage device without the data compression
function to the host apparatus.
Seventh Embodiment
[0484] However, in the first to sixth embodiments, reversible
compression is assumed as the compression and decompression
processes. There is irreversible compression in which, when the
compressed data is decompressed, the decompressed data does not
return to the data before compression. Here, a mismatched portion
between the data before compression and data obtained by
decompressing the irreversibly compressed data may be considered as
the error of the data obtained by decompressing the irreversibly
compressed data with respect to the data before compression.
Therefore, when an error correction code is generated using the
data before compression as a base for generating the error
correction data, the data obtained by decompressing the
irreversibly compressed data can be corrected with the error
correction code as long as the number of mismatched portions is
within the range in which errors can be corrected with the
generated error correction code. In this way, it is possible to
obtain the data before compression. In the seventh embodiment, it
is assumed that the number of mismatched portions is within the
range in which errors can be corrected with the generated error
correction code. The seventh embodiment may be a modification of
the data storage device 100, the data storage device 200, or the
data storage device 300.
[0485] When the cluster data is stored in the storage medium, the
data storage device 200 generates error correction data for
correcting the irreversibly compressed data, using the data before
compression as a base for generating the error correction data, and
irreversible compresses the cluster data. Then, the data storage
device 200 stores the irreversibly compressed cluster data and the
generated error correction data for correcting the irreversibly
compressed data so as to be associated with each other.
[0486] When the cluster data is read from the storage medium, the
data storage device 200 decompresses the read cluster data as the
irreversibly compressed data and corrects the decompressed cluster
data with the error correction data for correcting the irreversibly
compressed data which is stored associated with the read cluster
data.
[0487] Next, the seventh embodiment will be described as a
modification of the second embodiment. When the size obtained by
adding the metadata of the cluster to be compressed and the
compressed cluster data is equal to or less than an integer
multiple of the division size, the writing unit 211 according to
the second embodiment writes the dummy data to the remainder of the
area of the data obtained by adding the metadata of the cluster to
be compressed and the compressed cluster data in the area with a
size that is an integer multiple of the division size, thereby
setting the size of the cluster data to the size that is an integer
multiple of the division size.
[0488] As illustrated in FIG. 23, when the size of data obtained by
adding the metadata of the cluster to be compressed, the compressed
cluster data, and the error correction data for correcting the
irreversibly compressed data, which is error correction data
generated using the data before compression as a base for
generating the error correction data, is equal to or less than an
integer multiple of the division size, the writing unit 211
according to the seventh embodiment writes the dummy data to the
remainder of the area of the data obtained by adding the metadata
of the cluster to be compressed, the compressed cluster data, and
the error correction data for correcting the irreversibly
compressed data in the area with a size that is an integer multiple
of the division size, thereby setting the size of the cluster data
to the size that is an integer multiple of the division size.
[0489] The reading unit 212 according to the second embodiment
transmits the extracted cluster data to the decompression unit 105,
instructs the decompression unit 105 to decompress the cluster
data, and acquires the decompressed cluster data. In contrast, the
reading unit 212 according to the seventh embodiment transmits the
extracted cluster data to the decompression unit 105, instructs the
decompression unit 105 to decompress the cluster data, acquires the
decompressed cluster data, uses the decompressed cluster data as a
base for generating the error correction data, extracts the error
correction data for correcting the irreversibly compressed data for
the cluster, performs error correction using the error correction
data for correcting the irreversibly compressed data as the error
correction data, and acquires the error corrected cluster data.
[0490] As such, the data storage device 200 according to the
seventh embodiment may perform an irreversible compression process
and a process of decompressing the irreversibly compressed
data.
[0491] While certain embodiments have been described, these
embodiments have been presented by way of example only, and are not
intended to limit the scope of the inventions. Indeed, the novel
embodiments described herein may be embodied in a variety of other
forms; furthermore, various omissions, substitutions and changes in
the form of the embodiments described herein may be made without
departing from the spirit of the inventions. The accompanying
claims and their equivalents are intended to cover such forms or
modifications as would fall within the scope and spirit of the
inventions.
* * * * *