From c4f12c134069e191b08074b4ed7ba689d0827d11 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 23 May 2006 04:57:04 +0000 Subject: Allow --update=name to update the name during assembly. Signed-off-by: Neil Brown --- super1.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'super1.c') diff --git a/super1.c b/super1.c index 533929a..2ccda5d 100644 --- a/super1.c +++ b/super1.c @@ -496,6 +496,19 @@ static int update_super1(struct mdinfo *info, void *sbv, char *update, memcpy(bm->uuid, info->uuid, 16); } } + if (strcmp(update, "name") == 0) { + if (info->name[0] == 0) + sprintf(info->name, "%d", info->array.md_minor); + memset(sb->set_name, 0, sizeof(sb->set_name)); + if (homehost && + strchr(info->name, ':') == NULL && + strlen(homehost)+1+strlen(info->name) < 32) { + strcpy(sb->set_name, homehost); + strcat(sb->set_name, ":"); + strcat(sb->set_name, info->name); + } else + strcpy(sb->set_name, info->name); + } if (strcmp(update, "_reshape_progress")==0) sb->reshape_position = __cpu_to_le64(info->reshape_progress); -- cgit