summaryrefslogtreecommitdiffstats
path: root/platform-intel.h
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2021-05-17 16:39:00 +0200
committerJes Sorensen <jsorensen@fb.com>2021-05-26 13:26:21 +0200
commit7c798f870900f6f4d4647dd3c88318524d7ccee4 (patch)
treecc2a1a94251ff5c6aa9c4f828a5e9dcb0ced8a91 /platform-intel.h
parentPrevent user from using --stop with ambiguous args (diff)
downloadmdadm-7c798f870900f6f4d4647dd3c88318524d7ccee4.tar.xz
mdadm-7c798f870900f6f4d4647dd3c88318524d7ccee4.zip
imsm: add generic method to resolve "device" links
Each virtual device is linked with parent by "device". This patch adds possibility to get previous device in sysfs tree. Depending on device type, there is a different amount of virutal layers. The best we can do is allow to directly specify how many "device" links need to be resolved. This approach also allows to get previous virtual device, which may contain some attributes. Simplify fd2devname, this function doesn't require new functionality and shall use generic fd2kname. For nvme drives represented via nvme-subystem when path to block device if requested, then return it without translation. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'platform-intel.h')
-rw-r--r--platform-intel.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform-intel.h b/platform-intel.h
index 8396a0f1..f93add51 100644
--- a/platform-intel.h
+++ b/platform-intel.h
@@ -237,7 +237,7 @@ static inline char *guid_str(char *buf, struct efi_guid guid)
}
char *get_nvme_multipath_dev_hw_path(const char *dev_path);
-char *diskfd_to_devpath(int fd);
+char *diskfd_to_devpath(int fd, int dev_level, char *buf);
__u16 devpath_to_vendor(const char *dev_path);
struct sys_dev *find_driver_devices(const char *bus, const char *driver);
struct sys_dev *find_intel_devices(void);
@@ -245,7 +245,7 @@ const struct imsm_orom *find_imsm_capability(struct sys_dev *hba);
const struct imsm_orom *find_imsm_orom(void);
int disk_attached_to_hba(int fd, const char *hba_path);
int devt_attached_to_hba(dev_t dev, const char *hba_path);
-char *devt_to_devpath(dev_t dev);
+char *devt_to_devpath(dev_t dev, int dev_level, char *buf);
int path_attached_to_hba(const char *disk_path, const char *hba_path);
const char *get_sys_dev_type(enum sys_dev_type);
const struct orom_entry *get_orom_entry_by_device_id(__u16 dev_id);