From 8a5edb110cee8d3395866deff3803563fdc3722f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 10 Oct 2024 14:22:39 +0200 Subject: [PATCH] findmnt: add docs for --kernel Signed-off-by: Karel Zak --- misc-utils/findmnt.8.adoc | 10 ++++++++-- misc-utils/findmnt.c | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/misc-utils/findmnt.8.adoc b/misc-utils/findmnt.8.adoc index 23fb14da5..88c33c8c6 100644 --- a/misc-utils/findmnt.8.adoc +++ b/misc-utils/findmnt.8.adoc @@ -78,8 +78,14 @@ Invert the sense of matching. *-J*, *--json*:: Use JSON output format. -*-k*, *--kernel*:: -Search in _/proc/self/mountinfo_. The output is in the tree-like format. This is the default. The output contains only mount options maintained by kernel (see also *--mtab*). +*-k*, *--kernel*[_=method_]:: +Reads information about filesystems from the kernel. This is the default output. The format is tree-like and only includes mount options managed by the kernel (see also *--mtab*). ++ +The optional argument _method_ can be either: ++ +* *mountinfo* - this is the default method and it reads data from the _/proc/self/mountinfo_ file. ++ +* *listmount* - This is an EXPERIMENTAL method that uses the listmount() and statmount() syscalls to generate the mount table. The output may not contain all details about mount nodes (for example, SOURCE is currently missing). *-l*, *--list*:: Use the list output format. This output format is automatically enabled if the output is restricted by the *-t*, *-O*, *-S* or *-T* option and the option *--submounts* is not used or if more that one source file (the option *-F*) is specified. diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 7e60a903c..c32d7352b 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1505,8 +1505,8 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -s, --fstab search in static table of filesystems\n"), out); fputs(_(" -m, --mtab search in table of mounted filesystems\n" " (includes user space mount options)\n"), out); - fputs(_(" -k, --kernel search in kernel table of mounted\n" - " filesystems (default)\n"), out); + fputs(_(" -k, --kernel[=] search in kernel mount table (default)\n" + " is mountinfo or listmount\n"), out); fputc('\n', out); fputs(_(" -p, --poll[=] monitor changes in table of mounted filesystems\n"), out); fputs(_(" -w, --timeout upper limit in milliseconds that --poll will block\n"), out); -- 2.47.3