summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab.c
diff options
context:
space:
mode:
authorKarel Zak2012-09-10 10:30:11 +0200
committerKarel Zak2012-09-10 10:30:11 +0200
commitc667aff93fb9f16121fcb1ed32f557949dab3eee (patch)
tree2211b7895bc4e700f167fa8e8517be5189c4d0e0 /libmount/src/tab.c
parentwdctl: add fallbacks for old kernel headers (diff)
downloadkernel-qcow2-util-linux-c667aff93fb9f16121fcb1ed32f557949dab3eee.tar.gz
kernel-qcow2-util-linux-c667aff93fb9f16121fcb1ed32f557949dab3eee.tar.xz
kernel-qcow2-util-linux-c667aff93fb9f16121fcb1ed32f557949dab3eee.zip
libmount: improve mnt_table_get_root_fs() docs
Fix info about return value, improve description. Reported-by: Amit <amit.uttam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r--libmount/src/tab.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 1c159b56f..bac6cf87b 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -210,7 +210,18 @@ int mnt_table_remove_fs(struct libmnt_table *tb, struct libmnt_fs *fs)
* @tb: mountinfo file (/proc/self/mountinfo)
* @root: returns pointer to the root filesystem (/)
*
- * Returns: 0 on success or -1 case of error.
+ * The function uses parent ID from mountinfo file to determine root filesystem
+ * (the filesystem with the smallest ID). The function is designed mostly for
+ * applications where is necessary to sort mountpoints by IDs to get the tree
+ * of the mountpoints (e.g. findmnt default output).
+ *
+ * If you're not sure than use
+ *
+ * mnt_table_find_target(tb, "/", MNT_ITER_BACKWARD);
+ *
+ * this is more robust and usable for arbitrary tab file (including fstab).
+ *
+ * Returns: 0 on success or less then zero case of error.
*/
int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)
{