-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use libmount instead of invoking mount(8)/umount(8)
ZoL has been relying on external commands mount(8)/umount(8) to mount/unmount datasets. As the comment in `lib/libzfs/libzfs_mount.c` suggests, use libmount to mount/unmount without fork(2)+exec(2) of mount(8)/umount(8) if libmount exists. mount(8)/umount(8) are nowadays libmount based (see util-linux code), so there is 1:1 correspondence between the existing implementation and this one. Due to API instability, only support util-linux v2.30 or above which was released in June 2017. Distros which track upstream mostly seem to meet this requirement with releases after 2017. (It's technically possible to support < v2.30 using low level API's which are still public interface, but need to draw the line. v2.30 is reasonably old with stable enough API to maintain builds now and in the future.) Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
- Loading branch information
Showing
4 changed files
with
140 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
dnl # | ||
dnl # Check for libmount. libmount is a part of util-linux source code, | ||
dnl # but requires libmount-devel (or similar name) for <libmount/libmount.h> | ||
dnl # on distros. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_CONFIG_USER_LIBMOUNT], [ | ||
LIBMOUNT= | ||
AC_CHECK_HEADER([libmount/libmount.h], [ | ||
AC_SUBST([LIBMOUNT], ["-lmount"]) | ||
AC_DEFINE([HAVE_LIBMOUNT], 1, [Define if you have libmount]) | ||
], []) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters