# US 9,355,027 B2 · Zone-based defragmentation methods and user devices using the same

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,355,027 B2
- Document ID: US9355027B2
- Status: Granted
- Kind: B2
- Application number: 14/152,333
- Filed: 2014-01-10
- Published: 2014-08-07
- Granted: 2016-05-31
- Earliest claimed: 2013-02-04
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Hyunchul Park; Sangmok Kim
- Web page: https://patentgrep.com/patent/US9355027B2

## CPC

- G06F 12/0246: {in block erasable memory, e.g. flash memory}
- G06F 2212/7205: Cleaning, compaction, garbage collection, erase control
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A defragmentation method of a user device which includes a host and a nonvolatile storage device includes: determining whether fragments of a first file stored at the nonvolatile storage device are in a same logical address zone; and executing defragmentation on the fragments of the first file if the fragments of the first file are in different logical address zones by moving the fragments of the first file to a logical address space corresponding to at least one of the different logical address zones.

## Claims

### Claim 1

A defragmentation method for a user device including a host and a nonvolatile storage device, the method comprising:
determining whether fragments of a first file stored at the nonvolatile storage device are in a same logical address zone;
determining, if the fragments of the first file are in different logical address zones, that usable space is available in at least one of the different logical address zones; and
executing defragmentation of the fragments of the first file if the fragments of the first file are in the different logical address zones by moving the fragments of the first file to a logical address space corresponding to the at least one of the different logical address zones.

### Claim 2 (depends on 1)

The defragmentation method of claim 1, further comprising:
skipping defragmentation of the fragments of the first file when the fragments of the first file are in the same logical address zone.

### Claim 3 (depends on 1)

The defragmentation method of claim 1, wherein the executing defragmentation of the fragments of the first file comprises:
sending read and write commands for each of the fragments of the first file from the host to the nonvolatile storage device.

### Claim 4 (depends on 1)

The defragmentation method of claim 1, wherein the executing defragmentation of the fragments of the first file comprises:
sending a series of defrag commands from the host to the nonvolatile storage device.

### Claim 5 (depends on 4)

The defragmentation method of claim 4, wherein each of the defrag commands uses a read/write command including defragmentation and end of defragmentation information.

### Claim 6 (depends on 4)

The defragmentation method of claim 4, wherein the executing defragmentation further comprises:
classifying the series of defrag commands according to logical address zone; and
moving the fragments of the first file to logical address spaces corresponding to logical address zones based on the classified series of defrag commands.

### Claim 7 (depends on 6)

The defragmentation method of claim 6, further comprising:
setting a physical block storing invalid data generated during the executing of defragmentation on the fragments of the first file to an invalid block without additional information from the host.

### Claim 8 (depends on 1)

The defragmentation method of claim 1, further comprising:
determining whether rearrangement of fragments of the defragmented file is required after defragmentation on the fragments of the first file is completed; and
rearranging the fragments of the defragmented file if rearrangement of the fragments of the defragmented file is required.

### Claim 9 (depends on 8)

The defragmentation method of claim 8, wherein the rearranging the fragments of the defragmented file comprises:
issuing, by the host to the nonvolatile storage device, an LBA (logical block address) command including source and destination addresses for fragments of the defragmented file to be rearranged; and
changing mapping information of the defragmented file without physical movement of the fragments of the defragmented file.

### Claim 10

A user device, comprising:
a host including a defragmentation program; and
a memory controller configured to control a storage medium in response to a request from the host;
wherein a logical address space managed by the host is divided into a plurality of logical address zones, each of the plurality of logical address zones including logical addresses associated with physical addresses of the storage medium; and
wherein the host is configured to skip defragmentation of a fragmented file stored at a same logical address zone and to perform logical defragmentation of a fragmented file stored at different logical address zones.

### Claim 11 (depends on 10)

The user device of claim 10, wherein the host is configured to
determine that usable space is available in at least one of the different logical address zones; and
send read and write commands for each fragment of the fragmented file to the memory controller for defragmentation of the fragments of the fragmented file.

### Claim 12 (depends on 10)

The user device of claim 10, wherein the host is configured to
determine that usable space is available in at least one of the different logical address zones; and
send a series of defrag commands to the memory controller for performing defragmentation of fragments of the fragmented file.

### Claim 13 (depends on 12)

The user device of claim 12, wherein each of the defrag commands uses a read/write command including defragmentation and end of defragmentation information.

### Claim 14 (depends on 13)

The user device of claim 13, wherein the memory controller is configured to classify the series of defrag commands according to logical address zone, and to move fragments of the fragmented file to logical address spaces corresponding to logical address zones based on the classified series of defrag commands.

### Claim 15 (depends on 10)

The user device of claim 10, wherein the host is further configured to determine whether rearrangement of fragments of the defragmented file is required after defragmentation of the fragmented file is completed, and issue, to the memory controller, an LBA (logical block address) command including source and destination addresses for fragments to be rearranged if rearrangement of the fragments of the defragmented file is required, and wherein the memory controller is configured to rearrange the fragments of the defragmented file by changing mapping information of the defragmented file without physical movement of the fragments of the defragmented file.

### Claim 16

A file defragmentation method for a user device including a host and a nonvolatile storage medium, the method comprising:
selectively defragmenting, by the host, a fragmented file stored in the nonvolatile storage medium based on whether fragments of the fragmented file are associated with a same logical address zone in a logical address space corresponding to a physical address space of the nonvolatile storage medium, the logical address space including a plurality of logical address zones, and each of the plurality of logical address zones including a plurality of continuous logical addresses.

### Claim 17 (depends on 16)

The method of claim 16, wherein the selectively defragmenting comprises:
skipping defragmentation of the fragmented file if the fragments of the fragmented file are associated with the same logical address zone.

### Claim 18 (depends on 16)

The method of claim 16, further comprising:
determining that usable space is available in a logical address zone among the plurality of logical address zones; and
wherein the selectively defragmenting includes
defragmenting the fragmented file by moving the fragments of the fragmented file such that the fragments of the fragmented file are associated with only the logical address zone among the plurality of logical address zones.

### Claim 19 (depends on 16)

The method of claim 16, wherein the selectively defragmenting comprises:
defragmenting the fragmented file only if the fragments of fragmented file are associated with different logical address zones.

### Claim 20 (depends on 16)

The method of claim 16, wherein fragments of the defragmented file are associated with the same logical address zone, and wherein the method further includes,
rearranging the fragments of the defragmented file by changing mapping information of the defragmented file without physical movement of the fragments of the defragmented file in the physical address space of the nonvolatile storage medium.
