]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libxfs: factor mount checks into helper function
authorEric Sandeen <sandeen@sandeen.net>
Mon, 19 Sep 2016 22:49:41 +0000 (08:49 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 19 Sep 2016 22:49:41 +0000 (08:49 +1000)
commit4d457e2472108185d767299e35efbaca07e9fcb0
treee282e649998e81a4f1c225a9e767c2a8698c29d4
parentf10a5ab0b3a4cb8a7e17a4935fb33d283c3dd31f
libxfs: factor mount checks into helper function

platform_check_ismounted switched to a getmntent() loop after
ustat disappeared on some new platforms.

We also use a similar mechanism for determining the
ro/rw-mounted status of a device in platform_check_iswritable.

Because the loops are essentially the same, factor them into a
single helper which accepts a VERBOSE flag to print info if the
device is found in the checked-for state, and a WRITABLE flag
which only checks specifically for a mounted and /writable/ device.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/linux.c