-
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, initially only support libmount v2.30 or above which was released in June 2017. Distros which track upstream mostly seem to meet this requirement at least in the latest version. Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
- Loading branch information
Showing
4 changed files
with
134 additions
and
5 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,12 @@ | ||
dnl # | ||
dnl # Check for libmount. libmount is a part of util-linux source code, | ||
dnl # but requires libmount-devel (or something similar) 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