FreeBSD Bugzilla – Attachment 174723 Details for
Bug 162690
[geom] [patch] gpart label changes only take effect after a reboot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to add refresh method to glabel
geom_label.patch (text/plain), 1.48 KB, created by
Ben RUBSON
on 2016-09-13 12:13:46 UTC
(
hide
)
Description:
patch to add refresh method to glabel
Filename:
MIME Type:
Creator:
Ben RUBSON
Created:
2016-09-13 12:13:46 UTC
Size:
1.48 KB
patch
obsolete
>--- sbin/geom/class/label/geom_label.c.ori 2016-08-12 02:08:20.000000000 +0200 >+++ sbin/geom/class/label/geom_label.c 2016-09-13 14:08:08.659901000 +0200 >@@ -53,6 +53,7 @@ > static void label_clear(struct gctl_req *req); > static void label_dump(struct gctl_req *req); > static void label_label(struct gctl_req *req); >+static void label_refresh(struct gctl_req *req); > > struct g_command PUBSYM(class_commands)[] = { > { "clear", G_FLAG_VERBOSE, label_main, G_NULL_OPTS, >@@ -74,6 +75,9 @@ > { "label", G_FLAG_VERBOSE | G_FLAG_LOADKLD, label_main, G_NULL_OPTS, > "[-v] name dev" > }, >+ { "refresh", 0, label_main, G_NULL_OPTS, >+ "dev ..." >+ }, > { "stop", G_FLAG_VERBOSE, NULL, > { > { 'f', "force", NULL, G_TYPE_BOOL }, >@@ -105,6 +109,8 @@ > label_clear(req); > else if (strcmp(name, "dump") == 0) > label_dump(req); >+ else if (strcmp(name, "refresh") == 0) >+ label_refresh(req); > else > gctl_error(req, "Unknown command: %s.", name); > } >@@ -223,3 +229,29 @@ > printf("\n"); > } > } >+ >+static void >+label_refresh(struct gctl_req *req) >+{ >+ const char *name; >+ int i, nargs; >+ >+ nargs = gctl_get_int(req, "nargs"); >+ if (nargs < 1) { >+ gctl_error(req, "Too few arguments."); >+ return; >+ } >+ >+ for (i = 0; i < nargs; i++) { >+ name = gctl_get_ascii(req, "arg%d", i); >+ int fd = g_open(name, 1); >+ if (fd == -1) { >+ printf("Can't refresh metadata from %s: %s.\n", >+ name, strerror(errno)); >+ } >+ else { >+ printf("Metadata from %s refreshed.\n", name); >+ (void)g_close(fd); >+ } >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162690
:
174723
|
174918
|
177389