Skip to content

Commit

Permalink
Use udev to create /dev/zvol/[dataset_name] links
Browse files Browse the repository at this point in the history
This commit allows zvols with names longer than 32 characters, which
fixes issue on https://github.com/behlendorf/zfs/issues/#issue/102.

Changes include:
- use /dev/zd* device names for zvol, where * is the device minor
  (include/sys/fs/zfs.h, module/zfs/zvol.c).
- add BLKZNAME ioctl to get dataset name from userland
  (include/sys/fs/zfs.h, module/zfs/zvol.c, cmd/zvol_id).
- add udev rule to create /dev/zvol/[dataset_name] and the legacy
  /dev/[dataset_name] symlink. For partitions on zvol, it will create
  /dev/zvol/[dataset_name]-part* (etc/udev/rules.d/60-zvol.rules,
  cmd/zvol_id).

Signed-off-by: Brian Behlendorf <[email protected]>
  • Loading branch information
fajarnugraha authored and behlendorf committed Feb 25, 2011
1 parent 61da501 commit 4c0d8e5
Show file tree
Hide file tree
Showing 10 changed files with 761 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SUBDIRS = zfs zpool zpool_id zpool_layout zdb zinject ztest zpios
SUBDIRS = zfs zpool zpool_id zpool_layout zdb zinject ztest zpios zvol_id
2 changes: 1 addition & 1 deletion cmd/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = zfs zpool zpool_id zpool_layout zdb zinject ztest zpios
SUBDIRS = zfs zpool zpool_id zpool_layout zdb zinject ztest zpios zvol_id
all: all-recursive

.SUFFIXES:
Expand Down
10 changes: 10 additions & 0 deletions cmd/zvol_id/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include $(top_srcdir)/config/Rules.am

DEFAULT_INCLUDES += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include

bin_PROGRAMS = zvol_id

zvol_id_SOURCES = \
$(top_srcdir)/cmd/zvol_id/zvol_id_main.c
Loading

0 comments on commit 4c0d8e5

Please sign in to comment.