Print this page
NEX-3165 need some dedup improvements
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Moved closed ZFS files to open repo, changed Makefiles accordingly
Removed unneeded weak symbols
Bug 11205: add missing libzfs_closed_stubs.c to fix opensource-only build.
ZFS plus work: special vdevs, cos, cos/vdev properties


   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  25  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  26  * Copyright (c) 2015, Joyent, Inc. All rights reserved.
  27  * Copyright (c) 2014, OmniTI Computer Consulting, Inc. All rights reserved.
  28  */
  29 
  30 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  31 /*        All Rights Reserved   */
  32 
  33 
  34 #include <stdio.h>
  35 #include <stdlib.h>
  36 #include <unistd.h>
  37 #include <sys/types.h>
  38 #include <libproc.h>
  39 
  40 #include <ctype.h>
  41 #include <string.h>
  42 #include <sys/dlpi.h>
  43 #include <sys/ipc.h>
  44 #include <sys/ipc_impl.h>
  45 #include <sys/msg.h>


1157         { (uint_t)ZFS_IOC_POOL_TRYIMPORT,       "ZFS_IOC_POOL_TRYIMPORT",
1158                 "zfs_cmd_t" },
1159         { (uint_t)ZFS_IOC_POOL_SCAN,            "ZFS_IOC_POOL_SCAN",
1160                 "zfs_cmd_t" },
1161         { (uint_t)ZFS_IOC_POOL_FREEZE,          "ZFS_IOC_POOL_FREEZE",
1162                 "zfs_cmd_t" },
1163         { (uint_t)ZFS_IOC_POOL_UPGRADE,         "ZFS_IOC_POOL_UPGRADE",
1164                 "zfs_cmd_t" },
1165         { (uint_t)ZFS_IOC_POOL_GET_HISTORY,     "ZFS_IOC_POOL_GET_HISTORY",
1166                 "zfs_cmd_t" },
1167         { (uint_t)ZFS_IOC_VDEV_ADD,             "ZFS_IOC_VDEV_ADD",
1168                 "zfs_cmd_t" },
1169         { (uint_t)ZFS_IOC_VDEV_REMOVE,          "ZFS_IOC_VDEV_REMOVE",
1170                 "zfs_cmd_t" },
1171         { (uint_t)ZFS_IOC_VDEV_SET_STATE,       "ZFS_IOC_VDEV_SET_STATE",
1172                 "zfs_cmd_t" },
1173         { (uint_t)ZFS_IOC_VDEV_ATTACH,          "ZFS_IOC_VDEV_ATTACH",
1174                 "zfs_cmd_t" },
1175         { (uint_t)ZFS_IOC_VDEV_DETACH,          "ZFS_IOC_VDEV_DETACH",
1176                 "zfs_cmd_t" },


1177         { (uint_t)ZFS_IOC_VDEV_SETPATH,         "ZFS_IOC_VDEV_SETPATH",
1178                 "zfs_cmd_t" },
1179         { (uint_t)ZFS_IOC_VDEV_SETFRU,          "ZFS_IOC_VDEV_SETFRU",
1180                 "zfs_cmd_t" },
1181         { (uint_t)ZFS_IOC_OBJSET_STATS,         "ZFS_IOC_OBJSET_STATS",
1182                 "zfs_cmd_t" },
1183         { (uint_t)ZFS_IOC_OBJSET_ZPLPROPS,      "ZFS_IOC_OBJSET_ZPLPROPS",
1184                 "zfs_cmd_t" },
1185         { (uint_t)ZFS_IOC_DATASET_LIST_NEXT,    "ZFS_IOC_DATASET_LIST_NEXT",
1186                 "zfs_cmd_t" },
1187         { (uint_t)ZFS_IOC_SNAPSHOT_LIST_NEXT,   "ZFS_IOC_SNAPSHOT_LIST_NEXT",
1188                 "zfs_cmd_t" },
1189         { (uint_t)ZFS_IOC_SET_PROP,             "ZFS_IOC_SET_PROP",
1190                 "zfs_cmd_t" },
1191         { (uint_t)ZFS_IOC_CREATE,               "ZFS_IOC_CREATE",
1192                 "zfs_cmd_t" },
1193         { (uint_t)ZFS_IOC_DESTROY,              "ZFS_IOC_DESTROY",
1194                 "zfs_cmd_t" },
1195         { (uint_t)ZFS_IOC_ROLLBACK,             "ZFS_IOC_ROLLBACK",
1196                 "zfs_cmd_t" },


1257         { (uint_t)ZFS_IOC_OBJ_TO_STATS,         "ZFS_IOC_OBJ_TO_STATS",
1258                 "zfs_cmd_t" },
1259         { (uint_t)ZFS_IOC_SPACE_WRITTEN,        "ZFS_IOC_SPACE_WRITTEN",
1260                 "zfs_cmd_t" },
1261         { (uint_t)ZFS_IOC_DESTROY_SNAPS,        "ZFS_IOC_DESTROY_SNAPS",
1262                 "zfs_cmd_t" },
1263         { (uint_t)ZFS_IOC_POOL_REGUID,          "ZFS_IOC_POOL_REGUID",
1264                 "zfs_cmd_t" },
1265         { (uint_t)ZFS_IOC_POOL_REOPEN,          "ZFS_IOC_POOL_REOPEN",
1266                 "zfs_cmd_t" },
1267         { (uint_t)ZFS_IOC_SEND_PROGRESS,        "ZFS_IOC_SEND_PROGRESS",
1268                 "zfs_cmd_t" },
1269         { (uint_t)ZFS_IOC_LOG_HISTORY,          "ZFS_IOC_LOG_HISTORY",
1270                 "zfs_cmd_t" },
1271         { (uint_t)ZFS_IOC_SEND_NEW,             "ZFS_IOC_SEND_NEW",
1272                 "zfs_cmd_t" },
1273         { (uint_t)ZFS_IOC_SEND_SPACE,           "ZFS_IOC_SEND_SPACE",
1274                 "zfs_cmd_t" },
1275         { (uint_t)ZFS_IOC_CLONE,                "ZFS_IOC_CLONE",
1276                 "zfs_cmd_t" },
1277         { (uint_t)ZFS_IOC_REMAP,                "ZFS_IOC_REMAP",
1278                 "zfs_cmd_t" },
1279         { (uint_t)ZFS_IOC_BOOKMARK,             "ZFS_IOC_BOOKMARK",
1280                 "zfs_cmd_t" },
1281         { (uint_t)ZFS_IOC_GET_BOOKMARKS,        "ZFS_IOC_GET_BOOKMARKS",
1282                 "zfs_cmd_t" },
1283         { (uint_t)ZFS_IOC_DESTROY_BOOKMARKS,    "ZFS_IOC_DESTROY_BOOKMARKS",
1284                 "zfs_cmd_t" },














1285         { (uint_t)ZFS_IOC_CHANNEL_PROGRAM,      "ZFS_IOC_CHANNEL_PROGRAM",
1286                 "zfs_cmd_t" },
1287 
1288         /* kssl ioctls */
1289         { (uint_t)KSSL_ADD_ENTRY,               "KSSL_ADD_ENTRY",
1290                 "kssl_params_t"},
1291         { (uint_t)KSSL_DELETE_ENTRY,            "KSSL_DELETE_ENTRY",
1292                 "sockaddr_in"},
1293 
1294         /* disk ioctls - (0x04 << 8) - dkio.h */
1295         { (uint_t)DKIOCGGEOM,           "DKIOCGGEOM",
1296                 "struct dk_geom"},
1297         { (uint_t)DKIOCINFO,            "DKIOCINFO",
1298                 "struct dk_info"},
1299         { (uint_t)DKIOCEJECT,           "DKIOCEJECT",
1300                 NULL},
1301         { (uint_t)DKIOCGVTOC,           "DKIOCGVTOC",
1302                 "struct vtoc"},
1303         { (uint_t)DKIOCSVTOC,           "DKIOCSVTOC",
1304                 "struct vtoc"},




   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2013, 2016 by Delphix. All rights reserved.
  25  * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  26  * Copyright (c) 2015, Joyent, Inc. All rights reserved.
  27  * Copyright (c) 2014, OmniTI Computer Consulting, Inc. All rights reserved.
  28  */
  29 
  30 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  31 /*        All Rights Reserved   */
  32 
  33 
  34 #include <stdio.h>
  35 #include <stdlib.h>
  36 #include <unistd.h>
  37 #include <sys/types.h>
  38 #include <libproc.h>
  39 
  40 #include <ctype.h>
  41 #include <string.h>
  42 #include <sys/dlpi.h>
  43 #include <sys/ipc.h>
  44 #include <sys/ipc_impl.h>
  45 #include <sys/msg.h>


1157         { (uint_t)ZFS_IOC_POOL_TRYIMPORT,       "ZFS_IOC_POOL_TRYIMPORT",
1158                 "zfs_cmd_t" },
1159         { (uint_t)ZFS_IOC_POOL_SCAN,            "ZFS_IOC_POOL_SCAN",
1160                 "zfs_cmd_t" },
1161         { (uint_t)ZFS_IOC_POOL_FREEZE,          "ZFS_IOC_POOL_FREEZE",
1162                 "zfs_cmd_t" },
1163         { (uint_t)ZFS_IOC_POOL_UPGRADE,         "ZFS_IOC_POOL_UPGRADE",
1164                 "zfs_cmd_t" },
1165         { (uint_t)ZFS_IOC_POOL_GET_HISTORY,     "ZFS_IOC_POOL_GET_HISTORY",
1166                 "zfs_cmd_t" },
1167         { (uint_t)ZFS_IOC_VDEV_ADD,             "ZFS_IOC_VDEV_ADD",
1168                 "zfs_cmd_t" },
1169         { (uint_t)ZFS_IOC_VDEV_REMOVE,          "ZFS_IOC_VDEV_REMOVE",
1170                 "zfs_cmd_t" },
1171         { (uint_t)ZFS_IOC_VDEV_SET_STATE,       "ZFS_IOC_VDEV_SET_STATE",
1172                 "zfs_cmd_t" },
1173         { (uint_t)ZFS_IOC_VDEV_ATTACH,          "ZFS_IOC_VDEV_ATTACH",
1174                 "zfs_cmd_t" },
1175         { (uint_t)ZFS_IOC_VDEV_DETACH,          "ZFS_IOC_VDEV_DETACH",
1176                 "zfs_cmd_t" },
1177         { (uint_t)ZFS_IOC_VDEV_SETL2ADDDT,      "ZFS_IOC_VDEV_SETL2ADDDT",
1178                 "zfs_cmd_t" },
1179         { (uint_t)ZFS_IOC_VDEV_SETPATH,         "ZFS_IOC_VDEV_SETPATH",
1180                 "zfs_cmd_t" },
1181         { (uint_t)ZFS_IOC_VDEV_SETFRU,          "ZFS_IOC_VDEV_SETFRU",
1182                 "zfs_cmd_t" },
1183         { (uint_t)ZFS_IOC_OBJSET_STATS,         "ZFS_IOC_OBJSET_STATS",
1184                 "zfs_cmd_t" },
1185         { (uint_t)ZFS_IOC_OBJSET_ZPLPROPS,      "ZFS_IOC_OBJSET_ZPLPROPS",
1186                 "zfs_cmd_t" },
1187         { (uint_t)ZFS_IOC_DATASET_LIST_NEXT,    "ZFS_IOC_DATASET_LIST_NEXT",
1188                 "zfs_cmd_t" },
1189         { (uint_t)ZFS_IOC_SNAPSHOT_LIST_NEXT,   "ZFS_IOC_SNAPSHOT_LIST_NEXT",
1190                 "zfs_cmd_t" },
1191         { (uint_t)ZFS_IOC_SET_PROP,             "ZFS_IOC_SET_PROP",
1192                 "zfs_cmd_t" },
1193         { (uint_t)ZFS_IOC_CREATE,               "ZFS_IOC_CREATE",
1194                 "zfs_cmd_t" },
1195         { (uint_t)ZFS_IOC_DESTROY,              "ZFS_IOC_DESTROY",
1196                 "zfs_cmd_t" },
1197         { (uint_t)ZFS_IOC_ROLLBACK,             "ZFS_IOC_ROLLBACK",
1198                 "zfs_cmd_t" },


1259         { (uint_t)ZFS_IOC_OBJ_TO_STATS,         "ZFS_IOC_OBJ_TO_STATS",
1260                 "zfs_cmd_t" },
1261         { (uint_t)ZFS_IOC_SPACE_WRITTEN,        "ZFS_IOC_SPACE_WRITTEN",
1262                 "zfs_cmd_t" },
1263         { (uint_t)ZFS_IOC_DESTROY_SNAPS,        "ZFS_IOC_DESTROY_SNAPS",
1264                 "zfs_cmd_t" },
1265         { (uint_t)ZFS_IOC_POOL_REGUID,          "ZFS_IOC_POOL_REGUID",
1266                 "zfs_cmd_t" },
1267         { (uint_t)ZFS_IOC_POOL_REOPEN,          "ZFS_IOC_POOL_REOPEN",
1268                 "zfs_cmd_t" },
1269         { (uint_t)ZFS_IOC_SEND_PROGRESS,        "ZFS_IOC_SEND_PROGRESS",
1270                 "zfs_cmd_t" },
1271         { (uint_t)ZFS_IOC_LOG_HISTORY,          "ZFS_IOC_LOG_HISTORY",
1272                 "zfs_cmd_t" },
1273         { (uint_t)ZFS_IOC_SEND_NEW,             "ZFS_IOC_SEND_NEW",
1274                 "zfs_cmd_t" },
1275         { (uint_t)ZFS_IOC_SEND_SPACE,           "ZFS_IOC_SEND_SPACE",
1276                 "zfs_cmd_t" },
1277         { (uint_t)ZFS_IOC_CLONE,                "ZFS_IOC_CLONE",
1278                 "zfs_cmd_t" },


1279         { (uint_t)ZFS_IOC_BOOKMARK,             "ZFS_IOC_BOOKMARK",
1280                 "zfs_cmd_t" },
1281         { (uint_t)ZFS_IOC_GET_BOOKMARKS,        "ZFS_IOC_GET_BOOKMARKS",
1282                 "zfs_cmd_t" },
1283         { (uint_t)ZFS_IOC_DESTROY_BOOKMARKS,    "ZFS_IOC_DESTROY_BOOKMARKS",
1284                 "zfs_cmd_t" },
1285         { (uint_t)ZFS_IOC_VDEV_SET_PROPS,       "ZFS_IOC_VDEV_SET_PROPS",
1286                 "zfs_cmd_t" },
1287         { (uint_t)ZFS_IOC_VDEV_GET_PROPS,       "ZFS_IOC_VDEV_GET_PROPS",
1288                 "zfs_cmd_t" },
1289         { (uint_t)ZFS_IOC_COS_ALLOC,            "ZFS_IOC_COS_ALLOC",
1290                 "zfs_cmd_t" },
1291         { (uint_t)ZFS_IOC_COS_FREE,             "ZFS_IOC_COS_FREE",
1292                 "zfs_cmd_t" },
1293         { (uint_t)ZFS_IOC_COS_LIST,             "ZFS_IOC_COS_LIST",
1294                 "zfs_cmd_t" },
1295         { (uint_t)ZFS_IOC_COS_SET_PROPS,        "ZFS_IOC_COS_SET_PROPS",
1296                 "zfs_cmd_t" },
1297         { (uint_t)ZFS_IOC_COS_GET_PROPS,        "ZFS_IOC_COS_GET_PROPS",
1298                 "zfs_cmd_t" },
1299         { (uint_t)ZFS_IOC_CHANNEL_PROGRAM,      "ZFS_IOC_CHANNEL_PROGRAM",
1300                 "zfs_cmd_t" },
1301 
1302         /* kssl ioctls */
1303         { (uint_t)KSSL_ADD_ENTRY,               "KSSL_ADD_ENTRY",
1304                 "kssl_params_t"},
1305         { (uint_t)KSSL_DELETE_ENTRY,            "KSSL_DELETE_ENTRY",
1306                 "sockaddr_in"},
1307 
1308         /* disk ioctls - (0x04 << 8) - dkio.h */
1309         { (uint_t)DKIOCGGEOM,           "DKIOCGGEOM",
1310                 "struct dk_geom"},
1311         { (uint_t)DKIOCINFO,            "DKIOCINFO",
1312                 "struct dk_info"},
1313         { (uint_t)DKIOCEJECT,           "DKIOCEJECT",
1314                 NULL},
1315         { (uint_t)DKIOCGVTOC,           "DKIOCGVTOC",
1316                 "struct vtoc"},
1317         { (uint_t)DKIOCSVTOC,           "DKIOCSVTOC",
1318                 "struct vtoc"},