Commit ce24fde
f2fs_io: defrag_file supports automatic file length handling
Previously, executing defrag_file required specifying the starting
position and file length, such as [0, 3276800] or [122880, 368640].
For the former, sometimes we only want to defrag the entire file, not
just a portion of it, so the file length had to be manually entered
regardless. To improve usability, a feature to automatically handle
file length has been added.
The following is a test:
- When parameters are incorrect:
root@android-pc:/home/android# ./f2fs_io defrag_file
Excess arguments
f2fs_io defrag_file [file_path] - defrag whole file automatically
f2fs_io defrag_file [start] [length] [file_path]
start : start offset of defragment region, unit: bytes
length : bytes number of defragment region
- When only a file is specified:
root@android-pc:/home/android# ./f2fs_io defrag_file /mnt/uotan-rom/test/disk
defrag /mnt/uotan-rom/test/disk in region[0, 4294967296]
- When specifying the sorting range:
root@android-pc:/home/android# ./f2fs_io defrag_file 2408448 9998336 /mnt/uotan-rom/test/disk
defrag /mnt/uotan-rom/test/disk in region[2408448, 12406784]
Signed-off-by: zhaoyuenan <amktiao030215@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent 8731801 commit ce24fde
1 file changed
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
| 1472 | + | |
1472 | 1473 | | |
1473 | 1474 | | |
1474 | 1475 | | |
1475 | 1476 | | |
1476 | 1477 | | |
1477 | 1478 | | |
| 1479 | + | |
1478 | 1480 | | |
1479 | | - | |
1480 | 1481 | | |
| 1482 | + | |
1481 | 1483 | | |
1482 | | - | |
| 1484 | + | |
1483 | 1485 | | |
1484 | 1486 | | |
1485 | 1487 | | |
1486 | 1488 | | |
1487 | 1489 | | |
1488 | | - | |
1489 | | - | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1490 | 1503 | | |
1491 | | - | |
| 1504 | + | |
1492 | 1505 | | |
1493 | 1506 | | |
1494 | 1507 | | |
1495 | 1508 | | |
1496 | 1509 | | |
1497 | 1510 | | |
1498 | | - | |
| 1511 | + | |
| 1512 | + | |
1499 | 1513 | | |
1500 | 1514 | | |
1501 | 1515 | | |
| |||
0 commit comments