1 Star 0 Fork 40

lijie345/multipath-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0026-add-the-support-for-NOF-devices.patch 994 Bytes
一键复制 编辑 原始数据 按行查看 历史
lijie345 提交于 2020-11-08 20:52 . add the support for NOF devices
From e8e1cd4592a9a9b186359a219f510f2e658e5de8 Mon Sep 17 00:00:00 2001
From: lijie345 <553175351@qq.com>
Date: Sun, 8 Nov 2020 20:38:56 +0800
Subject: [PATCH] add the support for NOF devices
multipath-tools can not take over the NOF devices, so add the support for NOF devices.
Signed-off-by: lijie345 <553175351@qq.com>
---
libmultipath/discovery.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index c49848e..144959a 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -108,6 +108,16 @@ transport (int h)
if ((stat(buff, &a_stat) >= 0) && S_ISDIR(a_stat.st_mode)) {
return 0;
}
+ memset(buff, 0, PATH_SIZE);
+
+ /* nof device */
+ strcpy(buff, "/sys");
+ strcat(buff, "/class/nvme-fabrics/ctl/");
+ off = strlen(buff);
+ snprintf(buff + off, PATH_SIZE - off, "nvme%d", h);
+ if ((stat(buff, &a_stat) >= 0) && S_ISDIR(a_stat.st_mode)) {
+ return 0;
+ }
return 1;
}
--
2.29.2.windows.2
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lijie345/multipath-tools.git
git@gitee.com:lijie345/multipath-tools.git
lijie345
multipath-tools
multipath-tools
master

搜索帮助