Remove remaining bits of zpool addlog and ZFS_IOC_ADD_LOG
This commit is contained in:
parent
676d1dcc8c
commit
dcf745c378
|
@ -129,9 +129,6 @@ static int zpool_do_wait(int, char **);
|
|||
static zpool_compat_status_t zpool_do_load_compat(
|
||||
const char *, boolean_t *);
|
||||
|
||||
/* fmgw - added to allow injection into zfs kernel log */
|
||||
static int zpool_do_addlog(int, char **);
|
||||
|
||||
/*
|
||||
* These libumem hooks provide a reasonable set of defaults for the allocator's
|
||||
* debugging facilities.
|
||||
|
@ -165,7 +162,6 @@ typedef enum {
|
|||
HELP_IOSTAT,
|
||||
HELP_LABELCLEAR,
|
||||
HELP_LIST,
|
||||
HELP_ADDLOG,
|
||||
HELP_OFFLINE,
|
||||
HELP_ONLINE,
|
||||
HELP_REPLACE,
|
||||
|
@ -294,7 +290,6 @@ static zpool_command_t command_table[] = {
|
|||
{ "labelclear", zpool_do_labelclear, HELP_LABELCLEAR },
|
||||
{ NULL },
|
||||
{ "checkpoint", zpool_do_checkpoint, HELP_CHECKPOINT },
|
||||
{ "addlog", zpool_do_addlog, HELP_ADDLOG },
|
||||
{ NULL },
|
||||
{ "list", zpool_do_list, HELP_LIST },
|
||||
{ "iostat", zpool_do_iostat, HELP_IOSTAT },
|
||||
|
@ -385,9 +380,6 @@ get_usage(zpool_help_t idx)
|
|||
return (gettext("\tlist [-gHLpPv] [-o property[,...]] "
|
||||
"[-T d|u] [pool] ... \n"
|
||||
"\t [interval [count]]\n"));
|
||||
case HELP_ADDLOG:
|
||||
return (gettext("\taddlog [-m message]\n"
|
||||
"\tmessage <= 254 characters\n"));
|
||||
case HELP_OFFLINE:
|
||||
return (gettext("\toffline [-f] [-t] <pool> <device> ...\n"));
|
||||
case HELP_ONLINE:
|
||||
|
@ -3438,46 +3430,6 @@ zpool_do_checkpoint(int argc, char **argv)
|
|||
return (err);
|
||||
}
|
||||
|
||||
static int zpool_addlog(char *msg)
|
||||
{
|
||||
int ret;
|
||||
zfs_cmd_t zc = {"\0"};
|
||||
|
||||
if (msg == NULL)
|
||||
msg = (char *)"---EMPTY---";
|
||||
(void) strlcpy(zc.zc_name, msg, sizeof (zc.zc_name));
|
||||
ret = zfs_ioctl(g_zfs, ZFS_IOC_ADD_LOG, &zc);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int zpool_do_addlog(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
char *msg = NULL;
|
||||
int err = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, "m:")) != -1) {
|
||||
switch (c) {
|
||||
case 'm':
|
||||
msg = optarg;
|
||||
break;
|
||||
case ':':
|
||||
(void) fprintf(stderr,
|
||||
gettext("missing argument for "
|
||||
"'%c' option\n"), optopt);
|
||||
usage(B_FALSE);
|
||||
break;
|
||||
case '?':
|
||||
(void) fprintf(stderr,
|
||||
gettext("invalid option '%c'\n"),
|
||||
optopt);
|
||||
usage(B_FALSE);
|
||||
}
|
||||
}
|
||||
err = zpool_addlog(msg);
|
||||
return (err);
|
||||
}
|
||||
|
||||
#define CHECKPOINT_OPT 1024
|
||||
|
||||
/*
|
||||
|
|
|
@ -1702,44 +1702,6 @@ else if (zc->zc_cookie == POOL_SCAN_NONE)
|
|||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* This interface lets us put messages into zfs_dbgmsg() log. We
|
||||
* also look at the message; if the first character is *, we take
|
||||
* it as a private command. *D0..F sets fmgw_debug bits to 0..F
|
||||
*/
|
||||
static int
|
||||
zfs_ioc_addlog(zfs_cmd_t *zc)
|
||||
{
|
||||
char *s = "(NULL)";
|
||||
s = zc->zc_name;
|
||||
if ((s[0] == '*') && (s[1] == 'D')) {
|
||||
switch (s[2]) {
|
||||
case '0': fmgw_debug = 0x0; break;
|
||||
case '1': fmgw_debug = 0x1; break;
|
||||
case '2': fmgw_debug = 0x2; break;
|
||||
case '3': fmgw_debug = 0x3; break;
|
||||
case '4': fmgw_debug = 0x4; break;
|
||||
case '5': fmgw_debug = 0x5; break;
|
||||
case '6': fmgw_debug = 0x6; break;
|
||||
case '7': fmgw_debug = 0x7; break;
|
||||
case '8': fmgw_debug = 0x8; break;
|
||||
case '9': fmgw_debug = 0x9; break;
|
||||
case 'A': fmgw_debug = 0xa; break;
|
||||
case 'B': fmgw_debug = 0xb; break;
|
||||
case 'C': fmgw_debug = 0xc; break;
|
||||
case 'D': fmgw_debug = 0xd; break;
|
||||
case 'E': fmgw_debug = 0xe; break;
|
||||
case 'F': fmgw_debug = 0xf; break;
|
||||
default: break;
|
||||
}
|
||||
} else if (s[0] == '*') {
|
||||
zfs_dbgmsg("bad command %c", s[1]);
|
||||
} else {
|
||||
zfs_dbgmsg("%s", s);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
zfs_ioc_pool_freeze(zfs_cmd_t *zc)
|
||||
{
|
||||
|
@ -7165,12 +7127,6 @@ zfs_ioctl_init(void)
|
|||
zfs_ioctl_register_legacy(ZFS_IOC_POOL_FREEZE, zfs_ioc_pool_freeze,
|
||||
zfs_secpolicy_config, NO_NAME, B_FALSE, POOL_CHECK_READONLY);
|
||||
|
||||
/* fmgw - we sneak this in here... just as awful as zfs_ioc_pool_freeze
|
||||
* which we are modeled on.
|
||||
*/
|
||||
zfs_ioctl_register_legacy(ZFS_IOC_ADD_LOG, zfs_ioc_addlog,
|
||||
zfs_secpolicy_none, NO_NAME, B_FALSE, POOL_CHECK_READONLY);
|
||||
|
||||
zfs_ioctl_register_pool(ZFS_IOC_POOL_CREATE, zfs_ioc_pool_create,
|
||||
zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE);
|
||||
zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_SCAN,
|
||||
|
|
Loading…
Reference in New Issue