mount-util: add new path_get_mnt_id() call that queries the mnt ID of a path
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Nov 2017 15:05:41 +0000 (16:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Nov 2017 10:37:12 +0000 (11:37 +0100)
commitc2a986d5091af4e9c6f43695ecbfd7519f86e465
tree0535fb107d9566a4477730899384e456fd0ede31
parentcbfb8679dd5812a43252b9665f472a6cfeb3768f
mount-util: add new path_get_mnt_id() call that queries the mnt ID of a path

This is a simple wrapper around name_to_handle_at_loop() and
fd_fdinfo_mnt_id() to query the mnt ID of a path. It uses
name_to_handle_at() where it can, and falls back to to
fd_fdinfo_mnt_id() where that doesn't work.

This is a best-effort thing of course, since neither name_to_handle_at()
nor the fdinfo logic work on all kernels.
src/basic/mount-util.c
src/basic/mount-util.h
src/test/test-mount-util.c