drbd: rename "usermode_helper" to "drbd_usermode_helper"
Nothing like having a very generic global variable in a tiny driver subsystem to make a mess of the global namespace... Note, there are many other "generic" named global variables in the drbd subsystem, someone should fix those up one day before they hit a linking error. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Родитель
cde81d99af
Коммит
8ab761e17e
|
@ -75,7 +75,7 @@ extern int fault_rate;
|
||||||
extern int fault_devs;
|
extern int fault_devs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern char usermode_helper[];
|
extern char drbd_usermode_helper[];
|
||||||
|
|
||||||
|
|
||||||
/* This is used to stop/restart our threads.
|
/* This is used to stop/restart our threads.
|
||||||
|
|
|
@ -109,9 +109,9 @@ int proc_details; /* Detail level in proc drbd*/
|
||||||
|
|
||||||
/* Module parameter for setting the user mode helper program
|
/* Module parameter for setting the user mode helper program
|
||||||
* to run. Default is /sbin/drbdadm */
|
* to run. Default is /sbin/drbdadm */
|
||||||
char usermode_helper[80] = "/sbin/drbdadm";
|
char drbd_usermode_helper[80] = "/sbin/drbdadm";
|
||||||
|
|
||||||
module_param_string(usermode_helper, usermode_helper, sizeof(usermode_helper), 0644);
|
module_param_string(usermode_helper, drbd_usermode_helper, sizeof(drbd_usermode_helper), 0644);
|
||||||
|
|
||||||
/* in 2.6.x, our device mapping and config info contains our virtual gendisks
|
/* in 2.6.x, our device mapping and config info contains our virtual gendisks
|
||||||
* as member "struct gendisk *vdisk;"
|
* as member "struct gendisk *vdisk;"
|
||||||
|
|
|
@ -344,7 +344,7 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
|
||||||
(char[60]) { }, /* address */
|
(char[60]) { }, /* address */
|
||||||
NULL };
|
NULL };
|
||||||
char mb[14];
|
char mb[14];
|
||||||
char *argv[] = {usermode_helper, cmd, mb, NULL };
|
char *argv[] = {drbd_usermode_helper, cmd, mb, NULL };
|
||||||
struct drbd_connection *connection = first_peer_device(device)->connection;
|
struct drbd_connection *connection = first_peer_device(device)->connection;
|
||||||
struct sib_info sib;
|
struct sib_info sib;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -359,19 +359,19 @@ int drbd_khelper(struct drbd_device *device, char *cmd)
|
||||||
* write out any unsynced meta data changes now */
|
* write out any unsynced meta data changes now */
|
||||||
drbd_md_sync(device);
|
drbd_md_sync(device);
|
||||||
|
|
||||||
drbd_info(device, "helper command: %s %s %s\n", usermode_helper, cmd, mb);
|
drbd_info(device, "helper command: %s %s %s\n", drbd_usermode_helper, cmd, mb);
|
||||||
sib.sib_reason = SIB_HELPER_PRE;
|
sib.sib_reason = SIB_HELPER_PRE;
|
||||||
sib.helper_name = cmd;
|
sib.helper_name = cmd;
|
||||||
drbd_bcast_event(device, &sib);
|
drbd_bcast_event(device, &sib);
|
||||||
notify_helper(NOTIFY_CALL, device, connection, cmd, 0);
|
notify_helper(NOTIFY_CALL, device, connection, cmd, 0);
|
||||||
ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC);
|
ret = call_usermodehelper(drbd_usermode_helper, argv, envp, UMH_WAIT_PROC);
|
||||||
if (ret)
|
if (ret)
|
||||||
drbd_warn(device, "helper command: %s %s %s exit code %u (0x%x)\n",
|
drbd_warn(device, "helper command: %s %s %s exit code %u (0x%x)\n",
|
||||||
usermode_helper, cmd, mb,
|
drbd_usermode_helper, cmd, mb,
|
||||||
(ret >> 8) & 0xff, ret);
|
(ret >> 8) & 0xff, ret);
|
||||||
else
|
else
|
||||||
drbd_info(device, "helper command: %s %s %s exit code %u (0x%x)\n",
|
drbd_info(device, "helper command: %s %s %s exit code %u (0x%x)\n",
|
||||||
usermode_helper, cmd, mb,
|
drbd_usermode_helper, cmd, mb,
|
||||||
(ret >> 8) & 0xff, ret);
|
(ret >> 8) & 0xff, ret);
|
||||||
sib.sib_reason = SIB_HELPER_POST;
|
sib.sib_reason = SIB_HELPER_POST;
|
||||||
sib.helper_exit_code = ret;
|
sib.helper_exit_code = ret;
|
||||||
|
@ -396,24 +396,24 @@ enum drbd_peer_state conn_khelper(struct drbd_connection *connection, char *cmd)
|
||||||
(char[60]) { }, /* address */
|
(char[60]) { }, /* address */
|
||||||
NULL };
|
NULL };
|
||||||
char *resource_name = connection->resource->name;
|
char *resource_name = connection->resource->name;
|
||||||
char *argv[] = {usermode_helper, cmd, resource_name, NULL };
|
char *argv[] = {drbd_usermode_helper, cmd, resource_name, NULL };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
setup_khelper_env(connection, envp);
|
setup_khelper_env(connection, envp);
|
||||||
conn_md_sync(connection);
|
conn_md_sync(connection);
|
||||||
|
|
||||||
drbd_info(connection, "helper command: %s %s %s\n", usermode_helper, cmd, resource_name);
|
drbd_info(connection, "helper command: %s %s %s\n", drbd_usermode_helper, cmd, resource_name);
|
||||||
/* TODO: conn_bcast_event() ?? */
|
/* TODO: conn_bcast_event() ?? */
|
||||||
notify_helper(NOTIFY_CALL, NULL, connection, cmd, 0);
|
notify_helper(NOTIFY_CALL, NULL, connection, cmd, 0);
|
||||||
|
|
||||||
ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC);
|
ret = call_usermodehelper(drbd_usermode_helper, argv, envp, UMH_WAIT_PROC);
|
||||||
if (ret)
|
if (ret)
|
||||||
drbd_warn(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
|
drbd_warn(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
|
||||||
usermode_helper, cmd, resource_name,
|
drbd_usermode_helper, cmd, resource_name,
|
||||||
(ret >> 8) & 0xff, ret);
|
(ret >> 8) & 0xff, ret);
|
||||||
else
|
else
|
||||||
drbd_info(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
|
drbd_info(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
|
||||||
usermode_helper, cmd, resource_name,
|
drbd_usermode_helper, cmd, resource_name,
|
||||||
(ret >> 8) & 0xff, ret);
|
(ret >> 8) & 0xff, ret);
|
||||||
/* TODO: conn_bcast_event() ?? */
|
/* TODO: conn_bcast_event() ?? */
|
||||||
notify_helper(NOTIFY_RESPONSE, NULL, connection, cmd, ret);
|
notify_helper(NOTIFY_RESPONSE, NULL, connection, cmd, ret);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче