summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-06-28 03:53:51 +0100
committerPádraig Brady <P@draigBrady.com>2015-06-28 03:56:41 +0100
commiteff511bd3cecaab30df75a854f01566ce45c5876 (patch)
tree7b737d33f99b7fdc706c8cc4820d20d7e6cec972 /src
parente0c5ca485c9a5f016650f2c78e4d2edb6e44b2bb (diff)
downloadcoreutils-eff511bd3cecaab30df75a854f01566ce45c5876.tar.xz
maint: clarify df's use of device IDs from /proc/self/mountinfo
* src/df.c (filter_mount_list): Clarify why we still stat even though devices IDs may already be available. Note using /proc/self/mountinfo is still an advantage to get filtered items with accurate device patchs in chroots and with bind mounts. I.E. on older setups with static /etc/mtab, df will now bypass that to get the more accuracte and dynamic info.
Diffstat (limited to 'src')
-rw-r--r--src/df.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/df.c b/src/df.c
index 9d4c02740..2e541b952 100644
--- a/src/df.c
+++ b/src/df.c
@@ -623,10 +623,8 @@ filter_mount_list (bool devices_only)
struct mount_entry *discard_me = NULL;
/* Avoid stating remote file systems as that may hang.
- TODO: On Linux we might avoid this stat() and another in get_dev()
- by using the device IDs available from /proc/self/mountinfo.
- read_file_system_list() could populate me_dev from those
- for efficiency and accuracy. */
+ On Linux we probably have me_dev populated from /proc/self/mountinfo,
+ however we still stat() in case another device was mounted later. */
if ((me->me_remote && show_local_fs)
|| -1 == stat (me->me_mountdir, &buf))
{