]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-misc-minor.m4
Allow mounting snapshots in .zfs/snapshot as a regular user
[mirror_zfs.git] / config / kernel-misc-minor.m4
CommitLineData
a6cc9756
BB
1dnl #
2dnl # Determine an available miscellaneous minor number which can be used
3dnl # for the /dev/zfs device. This is needed because kernel module
4dnl # auto-loading depends on registering a reserved non-conflicting minor
5dnl # number. Start with a large known available unreserved minor and work
6dnl # our way down to lower value if a collision is detected.
7dnl #
8AC_DEFUN([ZFS_AC_KERNEL_MISC_MINOR], [
608f8749 9 AC_MSG_CHECKING([whether /dev/zfs minor is available])
a6cc9756
BB
10
11 for i in $(seq 249 -1 200); do
12 if ! grep -q "^#define\s\+.*_MINOR\s\+.*$i" \
13 ${LINUX}/include/linux/miscdevice.h; then
fa61e723
OF
14 ZFS_DEVICE_MINOR="$i"
15 AC_MSG_RESULT($ZFS_DEVICE_MINOR)
16 AC_DEFINE_UNQUOTED([ZFS_DEVICE_MINOR],
17 [$ZFS_DEVICE_MINOR], [/dev/zfs minor])
a6cc9756
BB
18 break
19 fi
20 done
21
fa61e723 22 AS_IF([ test -z "$ZFS_DEVICE_MINOR"], [
a6cc9756
BB
23 AC_MSG_ERROR([
24 *** No available misc minor numbers available for use.])
25 ])
26])