diff options
author | Don Brady <[email protected]> | 2018-03-29 18:43:25 -0600 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2018-05-07 17:19:57 -0700 |
commit | 3b118f0a34201b4192b510385f2bbcf4c58c662b (patch) | |
tree | 41cbdf8b63f70e97bf57ebfafe4ad18d7951c8ad | |
parent | ebe443c8ffd494adf9181f33f24a1a2aafdeca8f (diff) |
Add support for nvme based devids
Adds a devid for nvme devices. This is very similar to how the
other 'bus' (scsi|sata|usb) devids are generated. The devid
resides in a name/value pair in the leaf vdevs in a zpool config.
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Richard Elling <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Don Brady <[email protected]>
Closes #7356
-rw-r--r-- | lib/libzfs/libzfs_import.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index 39c067293..9dbf20795 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -21,7 +21,7 @@ /* * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. * Copyright 2015 RackTop Systems. * Copyright (c) 2016, Intel Corporation. */ @@ -142,7 +142,18 @@ zfs_device_get_devid(struct udev_device *dev, char *bufptr, size_t buflen) (void) snprintf(bufptr, buflen, "dm-uuid-%s", dm_uuid); return (0); } - return (ENODATA); + + /* + * NVME 'by-id' symlinks are similar to bus case + */ + struct udev_device *parent; + + parent = udev_device_get_parent_with_subsystem_devtype(dev, + "nvme", NULL); + if (parent != NULL) + bus = "nvme"; /* continue with bus symlink search */ + else + return (ENODATA); } /* |