Remove remaining bits of zpool addlog and ZFS_IOC_ADD_LOG

This commit is contained in:
Mateusz Piotrowski 2023-05-10 13:41:53 +02:00 committed by Geoff Amey
parent 676d1dcc8c
commit dcf745c378
2 changed files with 0 additions and 92 deletions

View File

@ -129,9 +129,6 @@ static int zpool_do_wait(int, char **);
static zpool_compat_status_t zpool_do_load_compat( static zpool_compat_status_t zpool_do_load_compat(
const char *, boolean_t *); 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 * These libumem hooks provide a reasonable set of defaults for the allocator's
* debugging facilities. * debugging facilities.
@ -165,7 +162,6 @@ typedef enum {
HELP_IOSTAT, HELP_IOSTAT,
HELP_LABELCLEAR, HELP_LABELCLEAR,
HELP_LIST, HELP_LIST,
HELP_ADDLOG,
HELP_OFFLINE, HELP_OFFLINE,
HELP_ONLINE, HELP_ONLINE,
HELP_REPLACE, HELP_REPLACE,
@ -294,7 +290,6 @@ static zpool_command_t command_table[] = {
{ "labelclear", zpool_do_labelclear, HELP_LABELCLEAR }, { "labelclear", zpool_do_labelclear, HELP_LABELCLEAR },
{ NULL }, { NULL },
{ "checkpoint", zpool_do_checkpoint, HELP_CHECKPOINT }, { "checkpoint", zpool_do_checkpoint, HELP_CHECKPOINT },
{ "addlog", zpool_do_addlog, HELP_ADDLOG },
{ NULL }, { NULL },
{ "list", zpool_do_list, HELP_LIST }, { "list", zpool_do_list, HELP_LIST },
{ "iostat", zpool_do_iostat, HELP_IOSTAT }, { "iostat", zpool_do_iostat, HELP_IOSTAT },
@ -385,9 +380,6 @@ get_usage(zpool_help_t idx)
return (gettext("\tlist [-gHLpPv] [-o property[,...]] " return (gettext("\tlist [-gHLpPv] [-o property[,...]] "
"[-T d|u] [pool] ... \n" "[-T d|u] [pool] ... \n"
"\t [interval [count]]\n")); "\t [interval [count]]\n"));
case HELP_ADDLOG:
return (gettext("\taddlog [-m message]\n"
"\tmessage <= 254 characters\n"));
case HELP_OFFLINE: case HELP_OFFLINE:
return (gettext("\toffline [-f] [-t] <pool> <device> ...\n")); return (gettext("\toffline [-f] [-t] <pool> <device> ...\n"));
case HELP_ONLINE: case HELP_ONLINE:
@ -3438,46 +3430,6 @@ zpool_do_checkpoint(int argc, char **argv)
return (err); 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 #define CHECKPOINT_OPT 1024
/* /*

View File

@ -1702,44 +1702,6 @@ else if (zc->zc_cookie == POOL_SCAN_NONE)
return (error); 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 static int
zfs_ioc_pool_freeze(zfs_cmd_t *zc) 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_ioctl_register_legacy(ZFS_IOC_POOL_FREEZE, zfs_ioc_pool_freeze,
zfs_secpolicy_config, NO_NAME, B_FALSE, POOL_CHECK_READONLY); 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_ioctl_register_pool(ZFS_IOC_POOL_CREATE, zfs_ioc_pool_create,
zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE); zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE);
zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_SCAN, zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_SCAN,