blob: f097bde6010cb23e82b2ea35543e76715ea7f662 [file] [log] [blame]
.\" Generated by help2man 1.47.12.
.TH f2fs_io "8" "March 2020" "f2fs-tools" "System Administration Utilities"
.SH NAME
f2fs_io \- f2fs ioctl utility
.SH DESCRIPTION
.B f2fs_io
is used to send various commands to the f2fs file system for
administrative purposes.
.SH "AVAILABLE COMMANDS"
.TP
\fBset_verity\fR \fI[file]\fR
Set the verity flags associated with the specified file.
.TP
\fBgetflags\fR \fI[file]\fR
Get the flags associated with the specified file.
.TP
\fBsetflags\fR \fI[flag] [file]\fR
Set an f2fs file on specified file. The flag can be casefold,
compression, and nocompression.
.TP
\fBclearflags\fR \fI[flag] [file]\fR
Clear the specified flag on the target file, which can be compression
and nocompression.
.TP
\fBshutdown\fR \fIshutdown filesystem\fR
Freeze and stop all IOs for the file system mounted on
.IR dir.
The level parameter can be:
.RS 1.2i
.TP
0
going down with full sync
.TP
1
going down with checkpoint only
.TP
2
going down with no sync
.TP
3
going down with metadata flush
.TP
4
going down with fsck mark
.RE
.TP
\fBpinfile\fR \fI[get|set] [file]\fR
Get or set the pinning status on a file.
.TP
\fBfadvise\fR \fI[advice] [offset] [length] [file]\fR
Pass an advice to the specified file. The advice can be willneed and sequential.
.TP
\fBfallocate\fR \fI[-c] [-i] [-p] [-z] [keep_size] [offset] [length] [file]\fR
Request that space be allocated on a file. The
.I keep_size
parameter can be either 1 or 0.
The
.I pattern
parameter can be:
.RS 1.2in
.TP
.B -c
collapse range
.TP
.B -i
insert range
.TP
.B -p
punch hole
.TP
.B -z
zero range
.RE
.TP
\fBwrite\fR \fI[chunk_size in 4kb] [offset in chunk_size] [count] [pattern] [IO] [file_path]\fR
Write a given pattern to
.IR file_path .
The
.I pattern
parameter can be:
.RS 1.2in
.TP
.B zero
zeros
.TP
.B inc_num
incrementing numbers
.TP
.B rand
random numbers
.RE
.IP
The
.I IO
parameter can be:
.RS 1.2in
.TP
.B buffered
buffered I/O
.TP
.B dio
direct I/O
.TP
.B dsync
direct I/O with O_DSYNC
.RE
.TP
\fBread\fR \fI[chunk_size in 4kb] [offset in chunk_size] [count] [IO] [print_nbytes] [file_path]\fR
Read data in
.I file_path
and print
.IR print_nbytes .
The
.I IO
options can be:
.RS 1.2in
.TP
.B buffered
buffered I/O
.TP
.B dio
direct I/O
.RE
.TP
\fBfiemap\fR \fI[offset in 4kb] [count] [file_path]\fR
get block address in file
.TP
\fBgc_urgent\fR \fIdev [start|end|run] [time in sec]\fR
Start, end, or run gc_urgent for a given time period
.TP
\fBdefrag_file\fR \fI[start] [length] [file_path]\fR
Defragment a file.
.TP
\fBcopy\fR \fI[-d] [-m] [-s] [src_path] [dst_path]\fR
Copy file from src_path to dst_path.
The
.I pattern
parameter can be:
.RS 1.2in
.TP
.B -d
use direct I/O
.TP
.B -m
use mmap for source file
.TP
.B -s
use sendfile to transfer data
.RE
.TP
\fBget_cblocks\fR \fI[file]\fR
Get the number of compressed blocks.
.TP
\fBrelease_cblocks\fR \fI[file]\fR
Release compressed blocks to get free space.
.TP
\fBreserve_cblocks\fR \fI[file]\fR
Reserve free blocks to prepare decompressing blocks in the file.
.TP
\fBgc\fR \fI[sync_mode] [file]\fR
Trigger filesystem GC
.TP
\fBcheckpoint\fR \fI[file]\fR
Trigger filesystem checkpoint
.TP
\fBprecache_extents\fR \fI[file]\fR
Trigger precache extents
.TP
\fBmove_range\fR \fI[src_path] [dst_path] [src_start] [dst_start] [length]\fR
Move a range of data blocks from source file to destination file
.TP
\fBgc_range\fR \fI[sync_mode] [start in 4kb] [length in 4kb] [file]\fR
Trigger gc to move data blocks from specified address range
.TP
\fBget_advise\fR \fI[file]\fR
Get i_advise value and info in file
.SH AUTHOR
This version of
.B f2fs_io
has been written by Jaegeuk Kim <jaegeuk@kernel.org>.
.SH AVAILABILITY
.B f2fs_io
is available from git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git.