[PATCH] udisks: add nilfs2 label rename
Jiro SEKIBA
jir at unicus.jp
Wed Oct 13 22:56:19 PDT 2010
Hi,
This is a patch to support renaming label of nilfs2 partition.
Renaming is done by nilfs2-tune, which is in nilfs2-util > 2.0.20.
This patch enables the label test excluded for lacking utility.
Signed-off-by: Jiro SEKIBA <jir at unicus.jp>
---
src/daemon.c | 2 +-
src/helpers/job-change-filesystem-label.c | 4 ++++
tests/run | 4 ++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/daemon.c b/src/daemon.c
index 44be94f..d46c6da 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -395,7 +395,7 @@ static const Filesystem known_file_systems[] =
TRUE, /* can_mount */
TRUE, /* can_create */
80, /* max_label_len */
- FALSE, /* supports_label_rename */
+ TRUE, /* supports_label_rename */
FALSE, /* supports_online_label_rename*/
FALSE, /* supports_fsck */
FALSE, /* supports_online_fsck */
diff --git a/src/helpers/job-change-filesystem-label.c b/src/helpers/job-change-filesystem-label.c
index 5b3e746..bdb28c6 100644
--- a/src/helpers/job-change-filesystem-label.c
+++ b/src/helpers/job-change-filesystem-label.c
@@ -103,6 +103,10 @@ main (int argc,
{
command_line = g_strdup_printf ("ntfslabel %s \"%s\"", device, new_label);
}
+ else if (strcmp (fstype, "nilfs2") == 0)
+ {
+ command_line = g_strdup_printf ("nilfs-tune -L %s \"%s\"", new_label, device);
+ }
else
{
g_printerr ("fstype %s not supported\n", fstype);
diff --git a/tests/run b/tests/run
index d320333..bc27cc9 100755
--- a/tests/run
+++ b/tests/run
@@ -590,8 +590,8 @@ class FS(UDisksTestCase):
self.assertEqual(fs[3], type != 'swap') # can_mount
self.assert_(fs[4]) # can_create
supports_label_rename = fs[6]
- # minix does not support labels; EXFAIL: swap, btrfs, nilfs2 don't have a program for it
- self.assertEqual(supports_label_rename, type not in ('nilfs2', 'btrfs', 'minix', 'swap'))
+ # minix does not support labels; EXFAIL: swap, btrfs don't have a program for it
+ self.assertEqual(supports_label_rename, type not in ('btrfs', 'minix', 'swap'))
break
else:
self.fail('KnownFilesystems does not contain ' + type)
--
1.7.0.4
More information about the devkit-devel
mailing list