The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/cmd/zpool/zpool.d/dm-deps

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #!/bin/sh
    2 #
    3 # Show device mapper dependent / underlying devices.  This is useful for
    4 # looking up the /dev/sd* devices associated with a dm or multipath device. 
    5 #
    6 
    7 if [ "$1" = "-h" ] ; then
    8         echo "Show device mapper dependent (underlying) devices."
    9         exit
   10 fi
   11 
   12 # shellcheck disable=SC2154
   13 dev="$VDEV_PATH"
   14 
   15 # If the VDEV path is a symlink, resolve it to a real device
   16 if [ -L "$dev" ] ; then
   17         dev=$(readlink "$dev")
   18 fi
   19 
   20 dev="${dev##*/}"
   21 val=""
   22 if [ -d "/sys/class/block/$dev/slaves" ] ; then
   23         # ls -C: output in columns, no newlines, two spaces (change to one)
   24         # shellcheck disable=SC2012
   25         val=$(ls -C "/sys/class/block/$dev/slaves" | tr -s '[:space:]' ' ')
   26 fi
   27 
   28 echo "dm-deps=$val"

Cache object: 22220caa77e73953db0470d8eadeb182


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.