]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - man/man8/xfs_io.8
xfs_io: hook up statx
[thirdparty/xfsprogs-dev.git] / man / man8 / xfs_io.8
1 .TH xfs_io 8
2 .SH NAME
3 xfs_io \- debug the I/O path of an XFS filesystem
4 .SH SYNOPSIS
5 .B xfs_io
6 [
7 .B \-adfimrRstxT
8 ] [
9 .B \-c
10 .I cmd
11 ] ... [
12 .B \-C
13 .I cmd
14 ] ... [
15 .B \-p
16 .I prog
17 ]
18 .I [ file ]
19 .br
20 .B xfs_io \-V
21 .SH DESCRIPTION
22 .B xfs_io
23 is a debugging tool like
24 .BR xfs_db (8),
25 but is aimed at examining the regular file I/O paths rather than the
26 raw XFS volume itself.
27 These code paths include not only the obvious read/write/mmap interfaces
28 for manipulating files, but also cover all of the XFS extensions (such
29 as space preallocation, additional inode flags, etc).
30 .SH OPTIONS
31 .B xfs_io
32 commands may be run interactively (the default) or as arguments on the
33 command line.
34 Interactive mode always runs commands on the current open file, whilst commands
35 run from the command line may be repeated on all open files rather than just the current
36 open file.
37 In general, open file iteration will occur for commands that operate on file
38 content or state. In contrast, commands that operate on filesystem or
39 system-wide state will only be run on the current file regardless of how many
40 files are currently open.
41 Multiple arguments may be given on the command line and they are run in the
42 sequence given. The program exits one all commands have
43 been run.
44 .TP 1.0i
45 .BI \-c " cmd"
46 Run the specified command on all currently open files.
47 To maintain compatibility with historical usage, commands that can not be run on
48 all open files will still be run but only execute once on the current open file.
49 Multiple
50 .B \-c
51 arguments may be given and may be interleaved on the command line in any order
52 with
53 .B \-C
54 commands.
55 .TP
56 .BI \-C " cmd"
57 Run the specified command only on the current open file.
58 Multiple
59 .B \-C
60 arguments may be given and may be interleaved on the command line in any order
61 with
62 .B \-c
63 commands.
64 .TP
65 .BI \-p " prog"
66 Set the program name for prompts and some error messages,
67 the default value is
68 .BR xfs_io .
69 .TP
70 .B \-f
71 Create
72 .I file
73 if it does not already exist.
74 .TP
75 .B \-r
76 Open
77 .I file
78 read-only, initially. This is required if
79 .I file
80 is immutable or append-only.
81 .TP
82 .B \-i
83 Start an idle thread. The purpose of this idle thread is to test io
84 from a multi threaded process. With single threaded process,
85 the file table is not shared and file structs are not reference counted.
86 Spawning an idle thread can help detecting file struct reference leaks.
87 .TP
88 .B \-x
89 Expert mode. Dangerous commands are only available in this mode.
90 These commands also tend to require additional privileges.
91 .TP
92 .B \-V
93 Prints the version number and exits.
94 .PP
95 The other
96 .BR open (2)
97 options described below are also available from the command line.
98 .SH CONCEPTS
99 .B xfs_io
100 maintains a number of open files and memory mappings.
101 Files can be initially opened on the command line (optionally),
102 and additional files can also be opened later.
103 .PP
104 .B xfs_io
105 commands can be broken up into three groups.
106 Some commands are aimed at doing regular file I/O - read, write,
107 sync, space preallocation, etc.
108 .PP
109 The second set of commands exist for manipulating memory mapped regions
110 of a file - mapping, accessing, storing, unmapping, flushing, etc.
111 .PP
112 The remaining commands are for the navigation and display of data
113 structures relating to the open files, mappings, and the filesystems
114 where they reside.
115 .PP
116 Many commands have extensive online help. Use the
117 .B help
118 command for more details on any command.
119 .SH FILE I/O COMMANDS
120 .TP
121 .BI "file [ " N " ]"
122 Display a list of all open files and (optionally) switch to an alternate
123 current open file.
124 .TP
125 .BI "open [[ \-acdfrstRT ] " path " ]"
126 Closes the current file, and opens the file specified by
127 .I path
128 instead. Without any arguments, displays statistics about the current
129 file \- see the
130 .B stat
131 command.
132 .RS 1.0i
133 .PD 0
134 .TP 0.4i
135 .B \-a
136 opens append-only (O_APPEND).
137 .TP
138 .B \-d
139 opens for direct I/O (O_DIRECT).
140 .TP
141 .B \-f
142 creates the file if it doesn't already exist (O_CREAT).
143 .TP
144 .B \-r
145 opens read-only (O_RDONLY).
146 .TP
147 .B \-s
148 opens for synchronous I/O (O_SYNC).
149 .TP
150 .B \-t
151 truncates on open (O_TRUNC).
152 .TP
153 .B \-n
154 opens in non-blocking mode if possible (O_NONBLOCK).
155 .TP
156 .B \-T
157 create a temporary file not linked into the filesystem namespace
158 (O_TMPFILE). The pathname passed must refer to a directory which
159 is treated as virtual parent for the newly created invisible file.
160 Can not be used together with the
161 .B \-r
162 option.
163 .TP
164 .B \-R
165 marks the file as a realtime XFS file after
166 opening it, if it is not already marked as such.
167 .PD
168 .RE
169 .TP
170 .B o
171 See the
172 .B open
173 command.
174 .TP
175 .B close
176 Closes the current open file, marking the next open file as current
177 (if one exists).
178 .TP
179 .B c
180 See the
181 .B close
182 command.
183 .TP
184 .BI "pread [ \-b " bsize " ] [ \-v ] [ \-FBR [ \-Z " seed " ] ] [ \-V " vectors " ] " "offset length"
185 Reads a range of bytes in a specified blocksize from the given
186 .IR offset .
187 .RS 1.0i
188 .PD 0
189 .TP 0.4i
190 .B \-b
191 can be used to set the blocksize into which the
192 .BR read (2)
193 requests will be split. The default blocksize is 4096 bytes.
194 .TP
195 .B \-v
196 dump the contents of the buffer after reading,
197 by default only the count of bytes actually read is dumped.
198 .TP
199 .B \-F
200 read the buffers in a forwards sequential direction.
201 .TP
202 .B \-B
203 read the buffers in a reserve sequential direction.
204 .TP
205 .B \-R
206 read the buffers in the give range in a random order.
207 .TP
208 .B \-Z seed
209 specify the random number seed used for random reads.
210 .TP
211 .B \-V vectors
212 Use the vectored IO read syscall
213 .BR preadv (2)
214 with a number of blocksize length iovecs. The number of iovecs is set by the
215 .I vectors
216 parameter.
217 .PD
218 .RE
219 .TP
220 .B r
221 See the
222 .B pread
223 command.
224 .TP
225 .BI "pwrite [ \-i " file " ] [ \-d ] [ \-s " skip " ] [ \-b " size " ] [ \-S " seed " ] [ \-FBR [ \-Z " zeed " ] ] [ \-wW ] [ \-V " vectors " ] " "offset length"
226 Writes a range of bytes in a specified blocksize from the given
227 .IR offset .
228 The bytes written can be either a set pattern or read in from another
229 file before writing.
230 .RS 1.0i
231 .PD 0
232 .TP 0.4i
233 .B \-i
234 allows an input
235 .I file
236 to be specified as the source of the data to be written.
237 .TP
238 .B \-d
239 causes direct I/O, rather than the usual buffered
240 I/O, to be used when reading the input file.
241 .TP
242 .B \-s
243 specifies the number of bytes to
244 .I skip
245 from the start of the input file before starting to read.
246 .TP
247 .B \-b
248 used to set the blocksize into which the
249 .BR write (2)
250 requests will be split. The default blocksize is 4096 bytes.
251 .TP
252 .B \-S
253 used to set the (repeated) fill pattern which
254 is used when the data to write is not coming from a file.
255 The default buffer fill pattern value is 0xcdcdcdcd.
256 .TP
257 .B \-F
258 write the buffers in a forwards sequential direction.
259 .TP
260 .B \-B
261 write the buffers in a reserve sequential direction.
262 .TP
263 .B \-R
264 write the buffers in the give range in a random order.
265 .TP
266 .B \-Z seed
267 specify the random number seed used for random write
268 .TP
269 .B \-w
270 call
271 .BR fdatasync (2)
272 once all writes are complete (included in timing results)
273 .TP
274 .B \-W
275 call
276 .BR fsync (2)
277 once all writes are complete (included in timing results)
278 .TP
279 .B \-V vectors
280 Use the vectored IO write syscall
281 .BR pwritev (2)
282 with a number of blocksize length iovecs. The number of iovecs is set by the
283 .I vectors
284 parameter.
285 .RE
286 .PD
287 .TP
288 .B w
289 See the
290 .B pwrite
291 command.
292 .TP
293 .BI "bmap [ \-acdelpv ] [ \-n " nx " ]"
294 Prints the block mapping for the current open file. Refer to the
295 .BR xfs_bmap (8)
296 manual page for complete documentation.
297 .TP
298 .BI "fiemap [ \-alv ] [ \-n " nx " ]"
299 Prints the block mapping for the current open file using the fiemap
300 ioctl. Options behave as described in the
301 .BR xfs_bmap (8)
302 manual page.
303 .TP
304 .BI "extsize [ \-R | \-D ] [ " value " ]"
305 Display and/or modify the preferred extent size used when allocating
306 space for the currently open file. If the
307 .B \-R
308 option is specified, a recursive descent is performed
309 for all directory entries below the currently open file
310 .RB ( \-D
311 can be used to restrict the output to directories only).
312 If the target file is a directory, then the inherited extent size
313 is set for that directory (new files created in that directory
314 inherit that extent size).
315 The
316 .I value
317 should be specified in bytes, or using one of the usual units suffixes
318 (k, m, g, b, etc). The extent size is always reported in units of bytes.
319 .TP
320 .BI "cowextsize [ \-R | \-D ] [ " value " ]"
321 Display and/or modify the preferred copy-on-write extent size used
322 when allocating space for the currently open file. If the
323 .B \-R
324 option is specified, a recursive descent is performed
325 for all directory entries below the currently open file
326 .RB ( \-D
327 can be used to restrict the output to directories only).
328 If the target file is a directory, then the inherited CoW extent size
329 is set for that directory (new files created in that directory
330 inherit that CoW extent size).
331 The
332 .I value
333 should be specified in bytes, or using one of the usual units suffixes
334 (k, m, g, b, etc). The extent size is always reported in units of bytes.
335 .TP
336 .BI "allocsp " size " 0"
337 Sets the size of the file to
338 .I size
339 and zeroes any additional space allocated using the
340 XFS_IOC_ALLOCSP/XFS_IOC_FREESP system call described in the
341 .BR xfsctl (3)
342 manual page.
343 .B allocsp
344 and
345 .B freesp
346 do exactly the same thing.
347 .TP
348 .BI "freesp " size " 0"
349 See the
350 .B allocsp
351 command.
352 .TP
353 .BI "fadvise [ \-r | \-s | [[ \-d | \-n | \-w ] " "offset length " ]]
354 On platforms which support it, allows hints be given to the system
355 regarding the expected I/O patterns on the file.
356 The range arguments are required by some advise commands ([*] below), and
357 the others must have no range arguments.
358 With no arguments, the POSIX_FADV_NORMAL advice is implied (default readahead).
359 .RS 1.0i
360 .PD 0
361 .TP 0.4i
362 .B \-d
363 the data will not be accessed again in the near future (POSIX_FADV_DONTNEED[*]).
364 .TP
365 .B \-n
366 data will be accessed once and not be reused (POSIX_FADV_NOREUSE[*]).
367 .TP
368 .B \-r
369 expect access to data in random order (POSIX_FADV_RANDOM), which sets readahead to zero.
370 .TP
371 .B \-s
372 expect access to data in sequential order (POSIX_FADV_SEQUENTIAL),
373 which doubles the default readahead on the file.
374 .TP
375 .B \-w
376 advises the specified data will be needed again (POSIX_FADV_WILLNEED[*])
377 which forces the maximum readahead.
378 .RE
379 .PD
380 .TP
381 .B fdatasync
382 Calls
383 .BR fdatasync (2)
384 to flush the file's in-core data to disk.
385 .TP
386 .B fsync
387 Calls
388 .BR fsync (2)
389 to flush all in-core file state to disk.
390 .TP
391 .B s
392 See the
393 .B fsync
394 command.
395 .TP
396 .BI "sync_range [ \-a | \-b | \-w ] offset length "
397 On platforms which support it, allows control of syncing a range of the file to
398 disk. With no options, SYNC_FILE_RANGE_WRITE is implied on the range supplied.
399 .RS 1.0i
400 .PD 0
401 .TP 0.4i
402 .B \-a
403 wait for IO in the given range to finish after writing
404 (SYNC_FILE_RANGE_WAIT_AFTER).
405 .TP
406 .B \-b
407 wait for IO in the given range to finish before writing
408 (SYNC_FILE_RANGE_WAIT_BEFORE).
409 .TP
410 .B \-w
411 start writeback of dirty data in the given range (SYNC_FILE_RANGE_WRITE).
412 .RE
413 .PD
414 .TP
415 .B sync
416 Calls
417 .BR sync (2)
418 to flush all filesystems' in-core data to disk.
419 .TP
420 .B syncfs
421 Calls
422 .BR syncfs (2)
423 to flush this filesystem's in-core data to disk.
424 .TP
425 .BI resvsp " offset length"
426 Allocates reserved, unwritten space for part of a file using the
427 XFS_IOC_RESVSP system call described in the
428 .BR xfsctl (3)
429 manual page.
430 .TP
431 .BI unresvsp " offset length"
432 Frees reserved space for part of a file using the XFS_IOC_UNRESVSP
433 system call described in the
434 .BR xfsctl (3)
435 manual page.
436 .TP
437 .BI "falloc [ \-k ]" " offset length"
438 Allocates reserved, unwritten space for part of a file using the
439 fallocate routine as described in the
440 .BR fallocate (2)
441 manual page.
442 .RS 1.0i
443 .PD 0
444 .TP 0.4i
445 .B \-k
446 will set the FALLOC_FL_KEEP_SIZE flag as described in
447 .BR fallocate (2).
448 .PD
449 .RE
450 .TP
451 .BI fcollapse " offset length"
452 Call fallocate with FALLOC_FL_COLLAPSE_RANGE flag as described in the
453 .BR fallocate (2)
454 manual page to de-allocates blocks and eliminates the hole created in this process
455 by shifting data blocks into the hole.
456 .TP
457 .BI finsert " offset length"
458 Call fallocate with FALLOC_FL_INSERT_RANGE flag as described in the
459 .BR fallocate (2)
460 manual page to create the hole by shifting data blocks.
461 .TP
462 .BI fpunch " offset length"
463 Punches (de-allocates) blocks in the file by calling fallocate with
464 the FALLOC_FL_PUNCH_HOLE flag as described in the
465 .BR fallocate (2)
466 manual page.
467 .TP
468 .BI funshare " offset length"
469 Call fallocate with FALLOC_FL_UNSHARE_RANGE flag as described in the
470 .BR fallocate (2)
471 manual page to unshare all shared blocks within the range.
472 .TP
473 .BI fzero " offset length"
474 Call fallocate with FALLOC_FL_ZERO_RANGE flag as described in the
475 .BR fallocate (2)
476 manual page to allocate and zero blocks within the range.
477 .TP
478 .BI zero " offset length"
479 Call xfsctl with
480 .B XFS_IOC_ZERO_RANGE
481 as described in the
482 .BR xfsctl (3)
483 manual page to allocate and zero blocks within the range.
484 .TP
485 .BI truncate " offset"
486 Truncates the current file at the given offset using
487 .BR ftruncate (2).
488 .TP
489 .BI "sendfile \-i " srcfile " | \-f " N " [ " "offset length " ]
490 On platforms which support it, allows a direct in-kernel copy between
491 two file descriptors. The current open file is the target, the source
492 must be specified as another open file
493 .RB ( \-f )
494 or by path
495 .RB ( \-i ).
496 .TP
497 .BI "readdir [ -v ] [ -o " offset " ] [ -l " length " ] "
498 Read a range of directory entries from a given offset of a directory.
499 .RS 1.0i
500 .PD 0
501 .TP 0.4i
502 .B \-v
503 verbose mode - dump dirent content as defined in
504 .BR readdir (3)
505 .TP
506 .B \-o
507 specify starting
508 .I offset
509 .TP
510 .B \-l
511 specify total
512 .I length
513 to read (in bytes)
514 .RE
515 .PD
516 .TP
517 .BI "seek \-a | \-d | \-h [ \-r ] [ \-s ] offset"
518 On platforms that support the
519 .BR lseek (2)
520 .B SEEK_DATA
521 and
522 .B SEEK_HOLE
523 options, display the offsets of the specified segments.
524 .RS 1.0i
525 .PD 0
526 .TP 0.4i
527 .B \-a
528 Display both
529 .B data
530 and
531 .B hole
532 segments starting at the specified
533 .B offset.
534 .TP
535 .B \-d
536 Display the
537 .B data
538 segment starting at the specified
539 .B offset.
540 .TP
541 .B \-h
542 Display the
543 .B hole
544 segment starting at the specified
545 .B offset.
546 .TP
547 .B \-r
548 Recursively display all the specified segments starting at the specified
549 .B offset.
550 .TP
551 .B \-s
552 Display the starting lseek(2) offset. This offset will be a calculated value when
553 both data and holes are displayed together or performing a recusively display.
554 .RE
555 .PD
556 .TP
557 .BI "reflink [ \-C ] [ \-q ] src_file [src_offset dst_offset length]"
558 On filesystems that support the
559 .B FICLONERANGE
560 or
561 .B BTRFS_IOC_CLONE_RANGE
562 ioctls, map
563 .I length
564 bytes at offset
565 .I dst_offset
566 in the open file to the same physical blocks that are mapped at offset
567 .I src_offset
568 in the file
569 .I src_file
570 , replacing any contents that may already have been there. If a program
571 writes into a reflinked block range of either file, the dirty blocks will be
572 cloned, written to, and remapped ("copy on write") in the affected file,
573 leaving the other file(s) unchanged. If src_offset, dst_offset, and length
574 are omitted, all contents of src_file will be reflinked into the open file.
575 .RS 1.0i
576 .PD 0
577 .TP 0.4i
578 .B \-C
579 Print timing statistics in a condensed format.
580 .TP
581 .B \-q
582 Do not print timing statistics at all.
583 .RE
584 .PD
585 .TP
586 .BI "dedupe [ \-C ] [ \-q ] src_file src_offset dst_offset length"
587 On filesystems that support the
588 .B FIDEDUPERANGE
589 or
590 .B BTRFS_IOC_FILE_EXTENT_SAME
591 ioctls, map
592 .I length
593 bytes at offset
594 .I dst_offset
595 in the open file to the same physical blocks that are mapped at offset
596 .I src_offset
597 in the file
598 .I src_file
599 , but only if the contents of both ranges are identical. This is known as
600 block-based deduplication. If a program writes into a reflinked block range of
601 either file, the dirty blocks will be cloned, written to, and remapped ("copy
602 on write") in the affected file, leaving the other file(s) unchanged.
603 .RS 1.0i
604 .PD 0
605 .TP 0.4i
606 .B \-C
607 Print timing statistics in a condensed format.
608 .TP
609 .B \-q
610 Do not print timing statistics at all.
611 .RE
612 .PD
613 .TP
614 .BI "copy_range [ -s " src_offset " ] [ -d " dst_offset " ] [ -l " length " ] src_file"
615 On filesystems that support the
616 .BR copy_file_range (2)
617 system call, copies data from the
618 .I src_file
619 into the open file. If
620 .IR src_offset ,
621 .IR dst_offset ,
622 and
623 .I length
624 are omitted the contents of src_file will be copied to the beginning of the
625 open file, overwriting any data already there.
626 .RS 1.0i
627 .PD 0
628 .TP 0.4i
629 .B \-s
630 Copy data from
631 .I src_file
632 beginning from
633 .IR src_offset .
634 .TP
635 .B \-d
636 Copy data into the open file beginning at
637 .IR dst_offset .
638 .TP
639 .B \-l
640 Copy up to
641 .I length
642 bytes of data.
643 .RE
644 .PD
645 .TP
646 .BI utimes " atime_sec atime_nsec mtime_sec mtime_nsec"
647 The utimes command changes the atime and mtime of the current file.
648 sec uses UNIX timestamp notation and is the seconds elapsed since
649 1970-01-01 00:00:00 UTC.
650 nsec is the nanoseconds since the sec. This value needs to be in
651 the range 0-999999999 with UTIME_NOW and UTIME_OMIT being exceptions.
652 Each (sec, nsec) pair constitutes a single timestamp value.
653
654 .SH MEMORY MAPPED I/O COMMANDS
655 .TP
656 .BI "mmap [ " N " | [[ \-rwx ] [\-s " size " ] " "offset length " ]]
657 With no arguments,
658 .B mmap
659 shows the current mappings. Specifying a single numeric argument
660 .I N
661 sets the current mapping. If two arguments are specified (a range specified by
662 .I offset
663 and
664 .IR length ),
665 a new mapping is created spanning the range, and the protection mode can
666 be given as a combination of PROT_READ
667 .RB ( \-r ),
668 PROT_WRITE
669 .RB ( \-w ),
670 and PROT_EXEC
671 .RB ( \-x ).
672 .BI \-s " size"
673 is used to do a mmap(size) && munmap(size) operation at first, try to reserve some
674 extendible free memory space, if
675 .I size
676 is bigger than
677 .I length
678 parameter. But there's not guarantee that the memory after
679 .I length
680 ( up to
681 .I size
682 ) will stay free.
683 .B e.g.
684 "mmap -rw -s 8192 1024" will mmap 0 ~ 1024 bytes memory, but try to reserve 1024 ~ 8192
685 free space(no guarantee). This free space will helpful for "mremap 8192" without
686 MREMAP_MAYMOVE flag.
687 .TP
688 .B mm
689 See the
690 .B mmap
691 command.
692 .TP
693 .BI "mremap [ \-f <new_address> ] [ \-m ] " new_length
694 Changes the current mapping size to
695 .IR new_length .
696 Whether the mapping may be moved is controlled by the flags passed;
697 MREMAP_FIXED
698 .RB ( \-f ),
699 or MREMAP_MAYMOVE
700 .RB ( \-m ).
701 .IR new_length
702 specifies a page-aligned address to which the mapping must be moved. It
703 can be setted to 139946004389888, 4096k or 1g etc.
704 .TP
705 .B mrm
706 See the
707 .B mremap
708 command.
709 .TP
710 .B munmap
711 Unmaps the current memory mapping.
712 .TP
713 .B mu
714 See the
715 .B munmap
716 command.
717 .TP
718 .BI "mread [ \-f | \-v ] [ \-r ] [" " offset length " ]
719 Accesses a segment of the current memory mapping, optionally dumping it to
720 the standard output stream (with
721 .B \-v
722 or
723 .B \-f
724 option) for inspection. The accesses are performed sequentially from the start
725 .I offset
726 by default, but can also be done from the end backwards through the
727 mapping if the
728 .B \-r
729 option in specified.
730 The two verbose modes differ only in the relative offsets they display, the
731 .B \-f
732 option is relative to file start, whereas
733 .B \-v
734 shows offsets relative to the start of the mapping.
735 .TP
736 .B mr
737 See the
738 .B mread
739 command.
740 .TP
741 .BI "mwrite [ \-r ] [ \-S " seed " ] [ " "offset length " ]
742 Stores a byte into memory for a range within a mapping.
743 The default stored value is 'X', repeated to fill the range specified,
744 but this can be changed using the
745 .B \-S
746 option.
747 The memory stores are performed sequentially from the start offset by default,
748 but can also be done from the end backwards through the mapping if the
749 .B \-r
750 option in specified.
751 .TP
752 .B mw
753 See the
754 .B mwrite
755 command.
756 .TP
757 .BI "msync [ \-i ] [ \-a | \-s ] [ " "offset length " ]
758 Writes all modified copies of pages over the specified range (or entire
759 mapping if no range specified) to their backing storage locations.
760 Also, optionally invalidates
761 .RB ( \-i )
762 so that subsequent references to the pages will be obtained from their
763 backing storage locations (instead of cached copies).
764 The flush can be done synchronously
765 .RB ( \-s)
766 or asynchronously
767 .RB ( \-a ).
768 .TP
769 .B ms
770 See the
771 .B msync
772 command.
773 .TP
774 .BI "madvise [ \-d | \-r | \-s | \-w ] [ " "offset length " ]
775 Modifies page cache behavior when operating on the current mapping.
776 The range arguments are required by some advise commands ([*] below).
777 With no arguments, the POSIX_MADV_NORMAL advice is implied (default readahead).
778 .RS 1.0i
779 .PD 0
780 .TP 0.4i
781 .B \-d
782 the pages will not be needed (POSIX_MADV_DONTNEED[*]).
783 .TP
784 .B \-r
785 expect random page references (POSIX_MADV_RANDOM), which sets readahead to zero.
786 .TP
787 .B \-s
788 expect sequential page references (POSIX_MADV_SEQUENTIAL),
789 which doubles the default readahead on the file.
790 .TP
791 .B \-w
792 advises the specified pages will be needed again (POSIX_MADV_WILLNEED[*])
793 which forces the maximum readahead.
794 .RE
795 .PD
796 .TP
797 .B mincore
798 Dumps a list of pages or ranges of pages that are currently in core,
799 for the current memory mapping.
800
801 .SH OTHER COMMANDS
802 .TP
803 .BR "help [ " command " ]"
804 Display a brief description of one or all commands.
805 .TP
806 .B print
807 Display a list of all open files and memory mapped regions.
808 The current file and current mapping are distinguishable from
809 any others.
810 .TP
811 .B p
812 See the
813 .B print
814 command.
815 .TP
816 .B quit
817 Exit
818 .BR xfs_io .
819 .TP
820 .B q
821 See the
822 .B quit
823 command.
824 .TP
825 .BR lsattr " [ " \-R " | " \-D " | " \-a " | " \-v " ]"
826 List extended inode flags on the currently open file. If the
827 .B \-R
828 option is specified, a recursive descent is performed
829 for all directory entries below the currently open file
830 .RB ( \-D
831 can be used to restrict the output to directories only).
832 This is a depth first descent, it does not follow symlinks and
833 it also does not cross mount points.
834 .TP
835 .BR chattr " [ " \-R " | " \-D " ] [ " + / \-riasAdtPneEfSxC " ]"
836 Change extended inode flags on the currently open file. The
837 .B \-R
838 and
839 .B \-D
840 options have the same meaning as above. The mapping between each
841 letter and the inode flags (refer to
842 .BR xfsctl (3)
843 for the full list) is available via the
844 .B help
845 command.
846 .TP
847 .B freeze
848 Suspend all write I/O requests to the filesystem of the current file.
849 Only available in expert mode and requires privileges.
850 .TP
851 .B thaw
852 Undo the effects of a filesystem freeze operation.
853 Only available in expert mode and requires privileges.
854 .TP
855 .BI "flink " path
856 Link the currently open file descriptor into the filesystem namespace.
857 .TP
858 .BI "inject [ " tag " ]"
859 Inject errors into a filesystem to observe filesystem behavior at
860 specific points under adverse conditions. Without the
861 .I tag
862 argument, displays the list of error tags available.
863 Only available in expert mode and requires privileges.
864 .TP
865 .BI "resblks [ " blocks " ]"
866 Get and/or set count of reserved filesystem blocks using the
867 XFS_IOC_GET_RESBLKS or XFS_IOC_SET_RESBLKS system calls.
868 Note \-\- this can be useful for exercising out of space behavior.
869 Only available in expert mode and requires privileges.
870 .TP
871 .BR shutdown " [ " \-f " ]"
872 Force the filesystem to shutdown (with or without flushing the log).
873 Only available in expert mode and requires privileges.
874 .TP
875 .BR stat " [ " \-v "|" \-r " ]"
876 Selected statistics from
877 .BR stat (2)
878 and the XFS_IOC_GETXATTR system call on the current file. If the
879 .B \-v
880 option is specified, the atime (last access), mtime
881 (last modify), and ctime (last change) timestamps are also displayed. The
882 .B \-r
883 option dumps raw fields from the stat structure.
884 .TP
885 .BI "statx [ \-v|\-r ][ \-m " basic " | \-m " all " | -m " <mask> " ][ \-FD ]"
886 Selected statistics from
887 .BR stat (2)
888 and the XFS_IOC_GETXATTR system call on the current file.
889 .RS 1.0i
890 .PD 0
891 .TP 0.4i
892 .B \-v
893 Show timestamps.
894 .TP
895 .B \-r
896 Dump raw statx structure values.
897 .TP
898 .B \-m basic
899 Set the field mask for the statx call to STATX_BASIC_STATS.
900 .TP
901 .B \-m all
902 Set the the field mask for the statx call to STATX_ALL (default).
903 .TP
904 .B \-m <mask>
905 Specify a numeric field mask for the statx call.
906 .TP
907 .B \-F
908 Force the attributes to be synced with the server.
909 .TP
910 .B \-D
911 Don't sync attributes with the server.
912 .PD
913 .RE
914 .TP
915 .B statfs
916 Selected statistics from
917 .BR statfs (2)
918 and the XFS_IOC_FSGEOMETRY
919 system call on the filesystem where the current file resides.
920 .TP
921 .BR chproj " [ " \-R | \-D " ]"
922 Modifies the project identifier associated with the current path. The
923 .B \-R
924 option will recursively descend if the current path is a directory. The
925 .B \-D
926 option will also recursively descend, only setting modifying projects
927 on subdirectories. See the
928 .BR xfs_quota (8)
929 manual page for more information about project identifiers.
930 .TP
931 .BR lsproj " [ " \-R | \-D " ]"
932 Displays the project identifier associated with the current path. The
933 .B \-R
934 and
935 .B \-D
936 options behave as described above, in
937 .B chproj.
938 .TP
939 .BR parent " [ " \-cpv " ]"
940 By default this command prints out the parent inode numbers,
941 inode generation numbers and basenames of all the hardlinks which
942 point to the inode of the current file.
943 .RS 1.0i
944 .PD 0
945 .TP 0.4i
946 .B \-p
947 the output is similar to the default output except pathnames up to
948 the mount-point are printed out instead of the component name.
949 .TP
950 .B \-c
951 the file's filesystem will check all the parent attributes for consistency.
952 .TP
953 .B \-v
954 verbose output will be printed.
955 .RE
956 .IP
957 .B [NOTE: Not currently operational on Linux.]
958 .PD
959 .TP
960 .BI "set_encpolicy [ \-c " mode " ] [ \-n " mode " ] [ \-f " flags " ] [ \-v " version " ] [ " keydesc " ]
961 On filesystems that support encryption, assign an encryption policy to the
962 current file.
963 .I keydesc
964 is a 16-byte hex string which identifies the encryption key to use.
965 If not specified, a "default" key descriptor of all 0's will be used.
966 .RS 1.0i
967 .PD 0
968 .TP 0.4i
969 .BI \-c " mode
970 contents encryption mode (e.g. AES-256-XTS)
971 .TP
972 .BI \-n " mode
973 filenames encryption mode (e.g. AES-256-CTS)
974 .TP
975 .BI \-f " flags
976 policy flags (numeric)
977 .TP
978 .BI \-v " version
979 version of policy structure (numeric)
980 .RE
981 .PD
982 .TP
983 .BR get_encpolicy
984 On filesystems that support encryption, display the encryption policy of the
985 current file.
986
987 .SH SEE ALSO
988 .BR mkfs.xfs (8),
989 .BR xfsctl (3),
990 .BR xfs_bmap (8),
991 .BR xfs_db (8),
992 .BR xfs (5),
993 .BR fdatasync (2),
994 .BR fstat (2),
995 .BR fstatfs (2),
996 .BR fsync (2),
997 .BR ftruncate (2),
998 .BR futimens (3),
999 .BR mmap (2),
1000 .BR msync (2),
1001 .BR open (2),
1002 .BR pread (2),
1003 .BR pwrite (2),
1004 .BR readdir (3).