summaryrefslogtreecommitdiff
path: root/usr/src/cmd/lofiadm
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-05-15 11:54:15 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-05-15 11:54:15 +0000
commit187b276d8e492a172d021a78b5c087647ad8a3dc (patch)
tree15e3a2f22d63ade9c16b4726f468a1753f74c66e /usr/src/cmd/lofiadm
parente847b91c79ac0a60cba1e1852929eb37e96cf21c (diff)
parent39df76fb09f8b2678db1cae82e66cd47f6930e4f (diff)
downloadillumos-joyent-187b276d8e492a172d021a78b5c087647ad8a3dc.tar.gz
[illumos-gate merge]
commit 39df76fb09f8b2678db1cae82e66cd47f6930e4f 9453 Include KPTI status in kernel boot messages commit bfcdb3d6fab8a8c00779b849f9f4505b2befd14d 9125 mdb's ::zfs_params needs updating commit 35f80dcb41f3a97bbb452a00537b4a72e7dc9996 7941 cannot use crypto lofi on a block/character device commit 3e8bfa75f73c9b5453b9ac29c9febcf211f061be 9274 loader: Make struct libi386_devdesc match the struct devdesc better commit 37367bbad5a7ff7127e57468cb6088cfca4bbd22 9095 ixgbe MAC_CAPAB_LED support commit 890c86716e81b6b22639ff07791007b82c26e6c5 9122 libstand: Consolidate tftp sendrecv into net.c sendrecv commit b8f90f25b92fc9ac25542c21076fda8ff8c6fa59 8931 boot1.efi: scan all display modes rather than sequential try-fail way commit 208e1562df6d45a86b71f40db0028ada4de4b56a 9502 expose thresholds as properties on sensor facility nodes commit bc0e4c28fd7055db02709c3af822f81959511c73 9400 avs: comparison between pointer and zero character constant commit de6ecd7f43e1627e7b738535c187ace8c2fd8f85 9239 mr_sas: this statement may fall through commit 6cd9fed7b76d776476aa3e2d7d235423dcbf1e56 9150 libfcoe: this statement may fall through commit 4e5127e8d53552c26604da7ec1d20e29b8196086 9273 loader.efi: We can't use d_opendata for blkio storage. commit e86c665f2e10cf29ac3b5f93b53c60bef762a690 9335 ficl: makesoftcore should be in tools commit 2c6e2b378f8445b330094f0316685e546585f44d 9520 list_link_replace(9f): Documentation does not match reality commit 71b76ee353d2a2effae389b51205465a42199e9d 9518 mdb conn_status doesn't do port byte order conversion Conflicts: usr/src/uts/common/io/ixgbe/ixgbe_gld.c usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c
Diffstat (limited to 'usr/src/cmd/lofiadm')
-rw-r--r--usr/src/cmd/lofiadm/main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/src/cmd/lofiadm/main.c b/usr/src/cmd/lofiadm/main.c
index 87c6435386..6ed5b49050 100644
--- a/usr/src/cmd/lofiadm/main.c
+++ b/usr/src/cmd/lofiadm/main.c
@@ -40,6 +40,7 @@
#include <sys/lofi.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
+#include <sys/modctl.h>
#include <netinet/in.h>
#include <stdio.h>
#include <fcntl.h>
@@ -302,8 +303,22 @@ name_to_minor(const char *devicename)
return (0);
}
+ /*
+ * For disk devices we use modctl(MODGETNAME) to read driver name
+ * for major device.
+ */
if (st.st_mode & S_IFCHR || st.st_mode & S_IFBLK) {
- return (LOFI_MINOR2ID(minor(st.st_rdev)));
+ major_t maj;
+ char mname[MODMAXNAMELEN];
+
+ maj = major(st.st_rdev);
+
+ if (modctl(MODGETNAME, mname, MODMAXNAMELEN, &maj) == 0) {
+ if (strncmp(mname, LOFI_DRIVER_NAME,
+ sizeof (LOFI_DRIVER_NAME)) == 0) {
+ return (LOFI_MINOR2ID(minor(st.st_rdev)));
+ }
+ }
}
return (0);