1 Star 0 Fork 21

fandeyuan/udisks2

forked from src-openEuler/udisks2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-mdraid-Expose-consistency_policy-sysfs-value.patch 2.88 KB
一键复制 编辑 原始数据 按行查看 历史
From d33d1dda277a78dcf63574c567ca24d7c3462f49 Mon Sep 17 00:00:00 2001
From: Marius Vollmer <mvollmer@redhat.com>
Date: Tue, 30 Apr 2024 14:39:13 +0300
Subject: [PATCH] mdraid: Expose "consistency_policy" sysfs value
---
data/org.freedesktop.UDisks2.xml | 12 ++++++++++++
src/udiskslinuxmdraid.c | 4 ++++
2 files changed, 16 insertions(+)
diff --git a/data/org.freedesktop.UDisks2.xml b/data/org.freedesktop.UDisks2.xml
index 53194c7..5d34901 100644
--- a/data/org.freedesktop.UDisks2.xml
+++ b/data/org.freedesktop.UDisks2.xml
@@ -3137,6 +3137,18 @@
-->
<property name="Degraded" type="u" access="read"/>
+ <!-- ConsistencyPolicy:
+ @since: 2.11.0
+ The consistency policy of the array.
+
+ If the RAID array does not support consistency policies (for
+ example RAID-0 arrays), this is empty.
+
+ This property corresponds to the
+ <literal>consistency_policy</literal> sysfs file.
+ -->
+ <property name="ConsistencyPolicy" type="s" access="read"/>
+
<!-- BitmapLocation:
The location of a write-intent bitmap (empty if the array is not running), if any.
diff --git a/src/udiskslinuxmdraid.c b/src/udiskslinuxmdraid.c
index 900cd65..46ee77e 100644
--- a/src/udiskslinuxmdraid.c
+++ b/src/udiskslinuxmdraid.c
@@ -237,6 +237,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
const gchar *name = NULL;
gchar *sync_action = NULL;
gchar *sync_completed = NULL;
+ gchar *consistency_policy = NULL;
gchar *bitmap_location = NULL;
guint degraded = 0;
guint64 chunk_size = 0;
@@ -316,6 +317,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
degraded = udisks_linux_device_read_sysfs_attr_as_int (raid_device, "md/degraded", NULL);
sync_action = udisks_linux_device_read_sysfs_attr (raid_device, "md/sync_action", NULL);
sync_completed = udisks_linux_device_read_sysfs_attr (raid_device, "md/sync_completed", NULL);
+ consistency_policy = udisks_linux_device_read_sysfs_attr (raid_device, "md/consistency_policy", NULL);
bitmap_location = udisks_linux_device_read_sysfs_attr (raid_device, "md/bitmap/location", NULL);
}
@@ -326,6 +328,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
}
udisks_mdraid_set_degraded (iface, degraded);
udisks_mdraid_set_sync_action (iface, sync_action);
+ udisks_mdraid_set_consistency_policy (iface, consistency_policy);
udisks_mdraid_set_bitmap_location (iface, bitmap_location);
udisks_mdraid_set_chunk_size (iface, chunk_size);
@@ -517,6 +520,7 @@ udisks_linux_mdraid_update (UDisksLinuxMDRaid *mdraid,
bd_md_examine_data_free (raid_data);
g_free (sync_completed);
g_free (sync_action);
+ g_free (consistency_policy);
g_free (bitmap_location);
g_list_free_full (member_devices, g_object_unref);
g_clear_object (&raid_device);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fandeyuan/udisks2.git
git@gitee.com:fandeyuan/udisks2.git
fandeyuan
udisks2
udisks2
master

搜索帮助