Delete fnptr-global-struct.md with huggingface_hub
Browse files- fnptr-global-struct.md +0 -1417
fnptr-global-struct.md
DELETED
|
@@ -1,1417 +0,0 @@
|
|
| 1 |
-
# Example 1
|
| 2 |
-
|
| 3 |
-
## Callsite
|
| 4 |
-
|
| 5 |
-
*/home/yuanting/work/icall-benchmarks/llm/zfs-build/../zfs-2.2.2/cmd/zdb/zdb.c:6019:2*
|
| 6 |
-
|
| 7 |
-
fnptr: *vdev_indirect_ops.vdev_op_remap*
|
| 8 |
-
|
| 9 |
-
targets: vdev_indirect_remap
|
| 10 |
-
|
| 11 |
-
## Related Code Snippets
|
| 12 |
-
|
| 13 |
-
```c
|
| 14 |
-
static void
|
| 15 |
-
claim_segment_cb(void *arg, uint64_t offset, uint64_t size)
|
| 16 |
-
{
|
| 17 |
-
vdev_t *vd = arg;
|
| 18 |
-
|
| 19 |
-
vdev_indirect_ops.vdev_op_remap(vd, offset, size,
|
| 20 |
-
claim_segment_impl_cb, NULL);
|
| 21 |
-
}
|
| 22 |
-
```
|
| 23 |
-
|
| 24 |
-
```c
|
| 25 |
-
vdev_ops_t vdev_indirect_ops = {
|
| 26 |
-
.vdev_op_init = NULL,
|
| 27 |
-
.vdev_op_fini = NULL,
|
| 28 |
-
.vdev_op_open = vdev_indirect_open,
|
| 29 |
-
.vdev_op_close = vdev_indirect_close,
|
| 30 |
-
.vdev_op_asize = vdev_default_asize,
|
| 31 |
-
.vdev_op_min_asize = vdev_default_min_asize,
|
| 32 |
-
.vdev_op_min_alloc = NULL,
|
| 33 |
-
.vdev_op_io_start = vdev_indirect_io_start,
|
| 34 |
-
.vdev_op_io_done = vdev_indirect_io_done,
|
| 35 |
-
.vdev_op_state_change = NULL,
|
| 36 |
-
.vdev_op_need_resilver = NULL,
|
| 37 |
-
.vdev_op_hold = NULL,
|
| 38 |
-
.vdev_op_rele = NULL,
|
| 39 |
-
.vdev_op_remap = vdev_indirect_remap,
|
| 40 |
-
.vdev_op_xlate = NULL,
|
| 41 |
-
.vdev_op_rebuild_asize = NULL,
|
| 42 |
-
.vdev_op_metaslab_init = NULL,
|
| 43 |
-
.vdev_op_config_generate = NULL,
|
| 44 |
-
.vdev_op_nparity = NULL,
|
| 45 |
-
.vdev_op_ndisks = NULL,
|
| 46 |
-
.vdev_op_type = VDEV_TYPE_INDIRECT, /* name of this vdev type */
|
| 47 |
-
.vdev_op_leaf = B_FALSE /* leaf vdev */
|
| 48 |
-
};
|
| 49 |
-
```
|
| 50 |
-
|
| 51 |
-
```c
|
| 52 |
-
static void
|
| 53 |
-
vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize,
|
| 54 |
-
void (*func)(uint64_t, vdev_t *, uint64_t, uint64_t, void *), void *arg)
|
| 55 |
-
```
|
| 56 |
-
|
| 57 |
-
# Example 2
|
| 58 |
-
|
| 59 |
-
## Callsite
|
| 60 |
-
|
| 61 |
-
*/home/yuanting/work/icall-benchmarks/llm/curl-build/lib/../../curl-8.5.0/lib/vtls/vtls.c:1018:14*
|
| 62 |
-
|
| 63 |
-
fnptr: *Curl_ssl->sha256sum*
|
| 64 |
-
|
| 65 |
-
targets: ossl_sha256sum
|
| 66 |
-
|
| 67 |
-
## Related Code Snippets
|
| 68 |
-
|
| 69 |
-
```c
|
| 70 |
-
CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
|
| 71 |
-
const char *pinnedpubkey,
|
| 72 |
-
const unsigned char *pubkey, size_t pubkeylen)
|
| 73 |
-
{
|
| 74 |
-
...
|
| 75 |
-
/* compute sha256sum of public key */
|
| 76 |
-
sha256sumdigest = malloc(CURL_SHA256_DIGEST_LENGTH);
|
| 77 |
-
if(!sha256sumdigest)
|
| 78 |
-
return CURLE_OUT_OF_MEMORY;
|
| 79 |
-
encode = Curl_ssl->sha256sum(pubkey, pubkeylen,
|
| 80 |
-
sha256sumdigest, CURL_SHA256_DIGEST_LENGTH);
|
| 81 |
-
...
|
| 82 |
-
}
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
-
```c
|
| 86 |
-
const struct Curl_ssl *Curl_ssl =
|
| 87 |
-
#if defined(CURL_WITH_MULTI_SSL)
|
| 88 |
-
&Curl_ssl_multi;
|
| 89 |
-
#elif defined(USE_WOLFSSL)
|
| 90 |
-
&Curl_ssl_wolfssl;
|
| 91 |
-
#elif defined(USE_SECTRANSP)
|
| 92 |
-
&Curl_ssl_sectransp;
|
| 93 |
-
#elif defined(USE_GNUTLS)
|
| 94 |
-
&Curl_ssl_gnutls;
|
| 95 |
-
#elif defined(USE_MBEDTLS)
|
| 96 |
-
&Curl_ssl_mbedtls;
|
| 97 |
-
#elif defined(USE_RUSTLS)
|
| 98 |
-
&Curl_ssl_rustls;
|
| 99 |
-
#elif defined(USE_OPENSSL)
|
| 100 |
-
&Curl_ssl_openssl;
|
| 101 |
-
#elif defined(USE_SCHANNEL)
|
| 102 |
-
&Curl_ssl_schannel;
|
| 103 |
-
#elif defined(USE_BEARSSL)
|
| 104 |
-
&Curl_ssl_bearssl;
|
| 105 |
-
#else
|
| 106 |
-
#error "Missing struct Curl_ssl for selected SSL backend"
|
| 107 |
-
#endif
|
| 108 |
-
```
|
| 109 |
-
|
| 110 |
-
```c
|
| 111 |
-
const struct Curl_ssl Curl_ssl_openssl = {
|
| 112 |
-
{ CURLSSLBACKEND_OPENSSL, "openssl" }, /* info */
|
| 113 |
-
...
|
| 114 |
-
ossl_get_internals, /* get_internals */
|
| 115 |
-
ossl_close, /* close_one */
|
| 116 |
-
ossl_close_all, /* close_all */
|
| 117 |
-
ossl_session_free, /* session_free */
|
| 118 |
-
ossl_set_engine, /* set_engine */
|
| 119 |
-
ossl_set_engine_default, /* set_engine_default */
|
| 120 |
-
ossl_engines_list, /* engines_list */
|
| 121 |
-
Curl_none_false_start, /* false_start */
|
| 122 |
-
#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256)
|
| 123 |
-
ossl_sha256sum, /* sha256sum */
|
| 124 |
-
#else
|
| 125 |
-
NULL, /* sha256sum */
|
| 126 |
-
#endif
|
| 127 |
-
NULL, /* use of data in this connection */
|
| 128 |
-
...
|
| 129 |
-
};
|
| 130 |
-
|
| 131 |
-
```
|
| 132 |
-
|
| 133 |
-
# Example 3
|
| 134 |
-
|
| 135 |
-
## Callsite
|
| 136 |
-
|
| 137 |
-
*/home/yuanting/work/icall-benchmarks/llm/redis-stable/src/pubsub.c:167:24*
|
| 138 |
-
|
| 139 |
-
fnptr: *type.clientPubSubChannels*
|
| 140 |
-
|
| 141 |
-
targets: getClientPubSubChannels
|
| 142 |
-
|
| 143 |
-
## Related Code Snippets
|
| 144 |
-
|
| 145 |
-
```c
|
| 146 |
-
/*
|
| 147 |
-
* Pub/Sub type for global channels.
|
| 148 |
-
*/
|
| 149 |
-
pubsubtype pubSubType = {
|
| 150 |
-
.shard = 0,
|
| 151 |
-
.clientPubSubChannels = getClientPubSubChannels,
|
| 152 |
-
.subscriptionCount = clientSubscriptionsCount,
|
| 153 |
-
.serverPubSubChannels = &server.pubsub_channels,
|
| 154 |
-
.subscribeMsg = &shared.subscribebulk,
|
| 155 |
-
.unsubscribeMsg = &shared.unsubscribebulk,
|
| 156 |
-
.messageBulk = &shared.messagebulk,
|
| 157 |
-
};
|
| 158 |
-
```
|
| 159 |
-
|
| 160 |
-
```c
|
| 161 |
-
/* SUBSCRIBE channel [channel ...] */
|
| 162 |
-
void subscribeCommand(client *c) {
|
| 163 |
-
int j;
|
| 164 |
-
if ((c->flags & CLIENT_DENY_BLOCKING) && !(c->flags & CLIENT_MULTI)) {
|
| 165 |
-
/**
|
| 166 |
-
* A client that has CLIENT_DENY_BLOCKING flag on
|
| 167 |
-
* expect a reply per command and so can not execute subscribe.
|
| 168 |
-
*
|
| 169 |
-
* Notice that we have a special treatment for multi because of
|
| 170 |
-
* backward compatibility
|
| 171 |
-
*/
|
| 172 |
-
addReplyError(c, "SUBSCRIBE isn't allowed for a DENY BLOCKING client");
|
| 173 |
-
return;
|
| 174 |
-
}
|
| 175 |
-
for (j = 1; j < c->argc; j++)
|
| 176 |
-
pubsubSubscribeChannel(c,c->argv[j],pubSubType);
|
| 177 |
-
c->flags |= CLIENT_PUBSUB;
|
| 178 |
-
}
|
| 179 |
-
```
|
| 180 |
-
|
| 181 |
-
```c
|
| 182 |
-
/* Subscribe a client to a channel. Returns 1 if the operation succeeded, or
|
| 183 |
-
* 0 if the client was already subscribed to that channel. */
|
| 184 |
-
int pubsubSubscribeChannel(client *c, robj *channel, pubsubtype type) {
|
| 185 |
-
dictEntry *de;
|
| 186 |
-
list *clients = NULL;
|
| 187 |
-
int retval = 0;
|
| 188 |
-
|
| 189 |
-
/* Add the channel to the client -> channels hash table */
|
| 190 |
-
if (dictAdd(type.clientPubSubChannels(c),channel,NULL) == DICT_OK) {
|
| 191 |
-
retval = 1;
|
| 192 |
-
incrRefCount(channel);
|
| 193 |
-
/* Add the client to the channel -> list of clients hash table */
|
| 194 |
-
de = dictFind(*type.serverPubSubChannels, channel);
|
| 195 |
-
if (de == NULL) {
|
| 196 |
-
clients = listCreate();
|
| 197 |
-
dictAdd(*type.serverPubSubChannels, channel, clients);
|
| 198 |
-
incrRefCount(channel);
|
| 199 |
-
} else {
|
| 200 |
-
clients = dictGetVal(de);
|
| 201 |
-
}
|
| 202 |
-
listAddNodeTail(clients,c);
|
| 203 |
-
}
|
| 204 |
-
/* Notify the client */
|
| 205 |
-
addReplyPubsubSubscribed(c,channel,type);
|
| 206 |
-
return retval;
|
| 207 |
-
}
|
| 208 |
-
```
|
| 209 |
-
|
| 210 |
-
# Example 4
|
| 211 |
-
|
| 212 |
-
## Callsite
|
| 213 |
-
|
| 214 |
-
*/home/yuanting/work/icall-benchmarks/llm/zfs-build/../zfs-2.2.2/module/zfs/zfs_ioctl.c:7848:11*
|
| 215 |
-
|
| 216 |
-
fnptr: *vec->zvec_legacy_func*
|
| 217 |
-
|
| 218 |
-
targets: zfs_ioc_clear, zfs_ioc_clear_fault, zfs_ioc_dataset_list_next, zfs_ioc_destroy, zfs_ioc_diff, zfs_ioc_dsobj_to_dsname, zfs_ioc_error_log, zfs_ioc_events_clear, zfs_ioc_events_next, zfs_ioc_events_seek, zfs_ioc_get_fsacl, zfs_ioc_inherit_prop, zfs_ioc_inject_fault, zfs_ioc_inject_list_next, zfs_ioc_next_obj, zfs_ioc_obj_to_path, zfs_ioc_obj_to_stats, zfs_ioc_objset_recvd_props, zfs_ioc_objset_stats, zfs_ioc_objset_zplprops, zfs_ioc_pool_configs, zfs_ioc_pool_create, zfs_ioc_pool_destroy, zfs_ioc_pool_export, zfs_ioc_pool_freeze, zfs_ioc_pool_get_history, zfs_ioc_pool_get_props, zfs_ioc_pool_import, zfs_ioc_pool_reguid, zfs_ioc_pool_scan, zfs_ioc_pool_set_props, zfs_ioc_pool_stats, zfs_ioc_pool_tryimport, zfs_ioc_pool_upgrade, zfs_ioc_promote, zfs_ioc_recv, zfs_ioc_rename, zfs_ioc_send, zfs_ioc_send_progress, zfs_ioc_set_fsacl, zfs_ioc_set_prop, zfs_ioc_share, zfs_ioc_smb_acl, zfs_ioc_snapshot_list_next, zfs_ioc_space_written, zfs_ioc_tmp_snapshot, zfs_ioc_userspace_many, zfs_ioc_userspace_one, zfs_ioc_userspace_upgrade, zfs_ioc_vdev_add, zfs_ioc_vdev_attach, zfs_ioc_vdev_detach, zfs_ioc_vdev_remove, zfs_ioc_vdev_set_state, zfs_ioc_vdev_setfru, zfs_ioc_vdev_setpath, zfs_ioc_vdev_split
|
| 219 |
-
|
| 220 |
-
## Related Code Snippets
|
| 221 |
-
|
| 222 |
-
```c
|
| 223 |
-
long zfsdev_ioctl_common(uint_t vecnum, zfs_cmd_t *zc, int flag)
|
| 224 |
-
{
|
| 225 |
-
...
|
| 226 |
-
if (vec->zvec_func != NULL) {
|
| 227 |
-
....
|
| 228 |
-
|
| 229 |
-
if ((error == 0 ||
|
| 230 |
-
(cmd == ZFS_IOC_CHANNEL_PROGRAM && error != EINVAL)) &&
|
| 231 |
-
vec->zvec_allow_log &&
|
| 232 |
-
spa_open(zc->zc_name, &spa, FTAG) == 0) {
|
| 233 |
-
...
|
| 234 |
-
} else {
|
| 235 |
-
cookie = spl_fstrans_mark();
|
| 236 |
-
error = vec->zvec_legacy_func(zc);
|
| 237 |
-
spl_fstrans_unmark(cookie);
|
| 238 |
-
}
|
| 239 |
-
...
|
| 240 |
-
}
|
| 241 |
-
}
|
| 242 |
-
```
|
| 243 |
-
|
| 244 |
-
```c
|
| 245 |
-
static void zfs_ioctl_register_legacy(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func,
|
| 246 |
-
zfs_secpolicy_func_t *secpolicy, zfs_ioc_namecheck_t namecheck,
|
| 247 |
-
boolean_t log_history, zfs_ioc_poolcheck_t pool_check)
|
| 248 |
-
{
|
| 249 |
-
zfs_ioc_vec_t *vec = &zfs_ioc_vec[ioc - ZFS_IOC_FIRST];
|
| 250 |
-
|
| 251 |
-
...
|
| 252 |
-
|
| 253 |
-
vec->zvec_legacy_func = func;
|
| 254 |
-
vec->zvec_secpolicy = secpolicy;
|
| 255 |
-
vec->zvec_namecheck = namecheck;
|
| 256 |
-
vec->zvec_allow_log = log_history;
|
| 257 |
-
vec->zvec_pool_check = pool_check;
|
| 258 |
-
}
|
| 259 |
-
|
| 260 |
-
static void
|
| 261 |
-
zfs_ioctl_register_pool(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func,
|
| 262 |
-
zfs_secpolicy_func_t *secpolicy, boolean_t log_history,
|
| 263 |
-
zfs_ioc_poolcheck_t pool_check)
|
| 264 |
-
{
|
| 265 |
-
zfs_ioctl_register_legacy(ioc, func, secpolicy,
|
| 266 |
-
POOL_NAME, log_history, pool_check);
|
| 267 |
-
}
|
| 268 |
-
|
| 269 |
-
void
|
| 270 |
-
zfs_ioctl_register_dataset_nolog(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func,
|
| 271 |
-
zfs_secpolicy_func_t *secpolicy, zfs_ioc_poolcheck_t pool_check)
|
| 272 |
-
{
|
| 273 |
-
zfs_ioctl_register_legacy(ioc, func, secpolicy,
|
| 274 |
-
DATASET_NAME, B_FALSE, pool_check);
|
| 275 |
-
}
|
| 276 |
-
|
| 277 |
-
static void
|
| 278 |
-
zfs_ioctl_register_pool_modify(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func)
|
| 279 |
-
{
|
| 280 |
-
zfs_ioctl_register_legacy(ioc, func, zfs_secpolicy_config,
|
| 281 |
-
POOL_NAME, B_TRUE, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY);
|
| 282 |
-
}
|
| 283 |
-
|
| 284 |
-
static void
|
| 285 |
-
zfs_ioctl_register_pool_meta(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func,
|
| 286 |
-
zfs_secpolicy_func_t *secpolicy)
|
| 287 |
-
{
|
| 288 |
-
zfs_ioctl_register_legacy(ioc, func, secpolicy,
|
| 289 |
-
NO_NAME, B_FALSE, POOL_CHECK_NONE);
|
| 290 |
-
}
|
| 291 |
-
|
| 292 |
-
static void
|
| 293 |
-
zfs_ioctl_register_dataset_read_secpolicy(zfs_ioc_t ioc,
|
| 294 |
-
zfs_ioc_legacy_func_t *func, zfs_secpolicy_func_t *secpolicy)
|
| 295 |
-
{
|
| 296 |
-
zfs_ioctl_register_legacy(ioc, func, secpolicy,
|
| 297 |
-
DATASET_NAME, B_FALSE, POOL_CHECK_SUSPENDED);
|
| 298 |
-
}
|
| 299 |
-
|
| 300 |
-
static void
|
| 301 |
-
zfs_ioctl_register_dataset_read(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func)
|
| 302 |
-
{
|
| 303 |
-
zfs_ioctl_register_dataset_read_secpolicy(ioc, func,
|
| 304 |
-
zfs_secpolicy_read);
|
| 305 |
-
}
|
| 306 |
-
|
| 307 |
-
static void
|
| 308 |
-
zfs_ioctl_register_dataset_modify(zfs_ioc_t ioc, zfs_ioc_legacy_func_t *func,
|
| 309 |
-
zfs_secpolicy_func_t *secpolicy)
|
| 310 |
-
{
|
| 311 |
-
zfs_ioctl_register_legacy(ioc, func, secpolicy,
|
| 312 |
-
DATASET_NAME, B_TRUE, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY);
|
| 313 |
-
}
|
| 314 |
-
```
|
| 315 |
-
|
| 316 |
-
```c
|
| 317 |
-
static void
|
| 318 |
-
zfs_ioctl_init(void)
|
| 319 |
-
{
|
| 320 |
-
zfs_ioctl_register("snapshot", ZFS_IOC_SNAPSHOT,
|
| 321 |
-
zfs_ioc_snapshot, zfs_secpolicy_snapshot, POOL_NAME,
|
| 322 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 323 |
-
zfs_keys_snapshot, ARRAY_SIZE(zfs_keys_snapshot));
|
| 324 |
-
|
| 325 |
-
zfs_ioctl_register("log_history", ZFS_IOC_LOG_HISTORY,
|
| 326 |
-
zfs_ioc_log_history, zfs_secpolicy_log_history, NO_NAME,
|
| 327 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_FALSE,
|
| 328 |
-
zfs_keys_log_history, ARRAY_SIZE(zfs_keys_log_history));
|
| 329 |
-
|
| 330 |
-
zfs_ioctl_register("space_snaps", ZFS_IOC_SPACE_SNAPS,
|
| 331 |
-
zfs_ioc_space_snaps, zfs_secpolicy_read, DATASET_NAME,
|
| 332 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE,
|
| 333 |
-
zfs_keys_space_snaps, ARRAY_SIZE(zfs_keys_space_snaps));
|
| 334 |
-
|
| 335 |
-
zfs_ioctl_register("send", ZFS_IOC_SEND_NEW,
|
| 336 |
-
zfs_ioc_send_new, zfs_secpolicy_send_new, DATASET_NAME,
|
| 337 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE,
|
| 338 |
-
zfs_keys_send_new, ARRAY_SIZE(zfs_keys_send_new));
|
| 339 |
-
|
| 340 |
-
zfs_ioctl_register("send_space", ZFS_IOC_SEND_SPACE,
|
| 341 |
-
zfs_ioc_send_space, zfs_secpolicy_read, DATASET_NAME,
|
| 342 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE,
|
| 343 |
-
zfs_keys_send_space, ARRAY_SIZE(zfs_keys_send_space));
|
| 344 |
-
|
| 345 |
-
zfs_ioctl_register("create", ZFS_IOC_CREATE,
|
| 346 |
-
zfs_ioc_create, zfs_secpolicy_create_clone, DATASET_NAME,
|
| 347 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 348 |
-
zfs_keys_create, ARRAY_SIZE(zfs_keys_create));
|
| 349 |
-
|
| 350 |
-
zfs_ioctl_register("clone", ZFS_IOC_CLONE,
|
| 351 |
-
zfs_ioc_clone, zfs_secpolicy_create_clone, DATASET_NAME,
|
| 352 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 353 |
-
zfs_keys_clone, ARRAY_SIZE(zfs_keys_clone));
|
| 354 |
-
|
| 355 |
-
zfs_ioctl_register("remap", ZFS_IOC_REMAP,
|
| 356 |
-
zfs_ioc_remap, zfs_secpolicy_none, DATASET_NAME,
|
| 357 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_TRUE,
|
| 358 |
-
zfs_keys_remap, ARRAY_SIZE(zfs_keys_remap));
|
| 359 |
-
|
| 360 |
-
zfs_ioctl_register("destroy_snaps", ZFS_IOC_DESTROY_SNAPS,
|
| 361 |
-
zfs_ioc_destroy_snaps, zfs_secpolicy_destroy_snaps, POOL_NAME,
|
| 362 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 363 |
-
zfs_keys_destroy_snaps, ARRAY_SIZE(zfs_keys_destroy_snaps));
|
| 364 |
-
|
| 365 |
-
zfs_ioctl_register("hold", ZFS_IOC_HOLD,
|
| 366 |
-
zfs_ioc_hold, zfs_secpolicy_hold, POOL_NAME,
|
| 367 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 368 |
-
zfs_keys_hold, ARRAY_SIZE(zfs_keys_hold));
|
| 369 |
-
zfs_ioctl_register("release", ZFS_IOC_RELEASE,
|
| 370 |
-
zfs_ioc_release, zfs_secpolicy_release, POOL_NAME,
|
| 371 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 372 |
-
zfs_keys_release, ARRAY_SIZE(zfs_keys_release));
|
| 373 |
-
|
| 374 |
-
zfs_ioctl_register("get_holds", ZFS_IOC_GET_HOLDS,
|
| 375 |
-
zfs_ioc_get_holds, zfs_secpolicy_read, DATASET_NAME,
|
| 376 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE,
|
| 377 |
-
zfs_keys_get_holds, ARRAY_SIZE(zfs_keys_get_holds));
|
| 378 |
-
|
| 379 |
-
zfs_ioctl_register("rollback", ZFS_IOC_ROLLBACK,
|
| 380 |
-
zfs_ioc_rollback, zfs_secpolicy_rollback, DATASET_NAME,
|
| 381 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_TRUE,
|
| 382 |
-
zfs_keys_rollback, ARRAY_SIZE(zfs_keys_rollback));
|
| 383 |
-
|
| 384 |
-
zfs_ioctl_register("bookmark", ZFS_IOC_BOOKMARK,
|
| 385 |
-
zfs_ioc_bookmark, zfs_secpolicy_bookmark, POOL_NAME,
|
| 386 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 387 |
-
zfs_keys_bookmark, ARRAY_SIZE(zfs_keys_bookmark));
|
| 388 |
-
|
| 389 |
-
zfs_ioctl_register("get_bookmarks", ZFS_IOC_GET_BOOKMARKS,
|
| 390 |
-
zfs_ioc_get_bookmarks, zfs_secpolicy_read, DATASET_NAME,
|
| 391 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE,
|
| 392 |
-
zfs_keys_get_bookmarks, ARRAY_SIZE(zfs_keys_get_bookmarks));
|
| 393 |
-
|
| 394 |
-
zfs_ioctl_register("get_bookmark_props", ZFS_IOC_GET_BOOKMARK_PROPS,
|
| 395 |
-
zfs_ioc_get_bookmark_props, zfs_secpolicy_read, ENTITY_NAME,
|
| 396 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_FALSE, zfs_keys_get_bookmark_props,
|
| 397 |
-
ARRAY_SIZE(zfs_keys_get_bookmark_props));
|
| 398 |
-
|
| 399 |
-
zfs_ioctl_register("destroy_bookmarks", ZFS_IOC_DESTROY_BOOKMARKS,
|
| 400 |
-
zfs_ioc_destroy_bookmarks, zfs_secpolicy_destroy_bookmarks,
|
| 401 |
-
POOL_NAME,
|
| 402 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 403 |
-
zfs_keys_destroy_bookmarks,
|
| 404 |
-
ARRAY_SIZE(zfs_keys_destroy_bookmarks));
|
| 405 |
-
|
| 406 |
-
zfs_ioctl_register("receive", ZFS_IOC_RECV_NEW,
|
| 407 |
-
zfs_ioc_recv_new, zfs_secpolicy_recv, DATASET_NAME,
|
| 408 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 409 |
-
zfs_keys_recv_new, ARRAY_SIZE(zfs_keys_recv_new));
|
| 410 |
-
zfs_ioctl_register("load-key", ZFS_IOC_LOAD_KEY,
|
| 411 |
-
zfs_ioc_load_key, zfs_secpolicy_load_key,
|
| 412 |
-
DATASET_NAME, POOL_CHECK_SUSPENDED, B_TRUE, B_TRUE,
|
| 413 |
-
zfs_keys_load_key, ARRAY_SIZE(zfs_keys_load_key));
|
| 414 |
-
zfs_ioctl_register("unload-key", ZFS_IOC_UNLOAD_KEY,
|
| 415 |
-
zfs_ioc_unload_key, zfs_secpolicy_load_key,
|
| 416 |
-
DATASET_NAME, POOL_CHECK_SUSPENDED, B_TRUE, B_TRUE,
|
| 417 |
-
zfs_keys_unload_key, ARRAY_SIZE(zfs_keys_unload_key));
|
| 418 |
-
zfs_ioctl_register("change-key", ZFS_IOC_CHANGE_KEY,
|
| 419 |
-
zfs_ioc_change_key, zfs_secpolicy_change_key,
|
| 420 |
-
DATASET_NAME, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY,
|
| 421 |
-
B_TRUE, B_TRUE, zfs_keys_change_key,
|
| 422 |
-
ARRAY_SIZE(zfs_keys_change_key));
|
| 423 |
-
|
| 424 |
-
zfs_ioctl_register("sync", ZFS_IOC_POOL_SYNC,
|
| 425 |
-
zfs_ioc_pool_sync, zfs_secpolicy_none, POOL_NAME,
|
| 426 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_FALSE,
|
| 427 |
-
zfs_keys_pool_sync, ARRAY_SIZE(zfs_keys_pool_sync));
|
| 428 |
-
zfs_ioctl_register("reopen", ZFS_IOC_POOL_REOPEN, zfs_ioc_pool_reopen,
|
| 429 |
-
zfs_secpolicy_config, POOL_NAME, POOL_CHECK_SUSPENDED, B_TRUE,
|
| 430 |
-
B_TRUE, zfs_keys_pool_reopen, ARRAY_SIZE(zfs_keys_pool_reopen));
|
| 431 |
-
|
| 432 |
-
zfs_ioctl_register("channel_program", ZFS_IOC_CHANNEL_PROGRAM,
|
| 433 |
-
zfs_ioc_channel_program, zfs_secpolicy_config,
|
| 434 |
-
POOL_NAME, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE,
|
| 435 |
-
B_TRUE, zfs_keys_channel_program,
|
| 436 |
-
ARRAY_SIZE(zfs_keys_channel_program));
|
| 437 |
-
|
| 438 |
-
zfs_ioctl_register("redact", ZFS_IOC_REDACT,
|
| 439 |
-
zfs_ioc_redact, zfs_secpolicy_config, DATASET_NAME,
|
| 440 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 441 |
-
zfs_keys_redact, ARRAY_SIZE(zfs_keys_redact));
|
| 442 |
-
|
| 443 |
-
zfs_ioctl_register("zpool_checkpoint", ZFS_IOC_POOL_CHECKPOINT,
|
| 444 |
-
zfs_ioc_pool_checkpoint, zfs_secpolicy_config, POOL_NAME,
|
| 445 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 446 |
-
zfs_keys_pool_checkpoint, ARRAY_SIZE(zfs_keys_pool_checkpoint));
|
| 447 |
-
|
| 448 |
-
zfs_ioctl_register("zpool_discard_checkpoint",
|
| 449 |
-
ZFS_IOC_POOL_DISCARD_CHECKPOINT, zfs_ioc_pool_discard_checkpoint,
|
| 450 |
-
zfs_secpolicy_config, POOL_NAME,
|
| 451 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 452 |
-
zfs_keys_pool_discard_checkpoint,
|
| 453 |
-
ARRAY_SIZE(zfs_keys_pool_discard_checkpoint));
|
| 454 |
-
|
| 455 |
-
zfs_ioctl_register("initialize", ZFS_IOC_POOL_INITIALIZE,
|
| 456 |
-
zfs_ioc_pool_initialize, zfs_secpolicy_config, POOL_NAME,
|
| 457 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 458 |
-
zfs_keys_pool_initialize, ARRAY_SIZE(zfs_keys_pool_initialize));
|
| 459 |
-
|
| 460 |
-
zfs_ioctl_register("trim", ZFS_IOC_POOL_TRIM,
|
| 461 |
-
zfs_ioc_pool_trim, zfs_secpolicy_config, POOL_NAME,
|
| 462 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
|
| 463 |
-
zfs_keys_pool_trim, ARRAY_SIZE(zfs_keys_pool_trim));
|
| 464 |
-
|
| 465 |
-
zfs_ioctl_register("wait", ZFS_IOC_WAIT,
|
| 466 |
-
zfs_ioc_wait, zfs_secpolicy_none, POOL_NAME,
|
| 467 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_FALSE,
|
| 468 |
-
zfs_keys_pool_wait, ARRAY_SIZE(zfs_keys_pool_wait));
|
| 469 |
-
|
| 470 |
-
zfs_ioctl_register("wait_fs", ZFS_IOC_WAIT_FS,
|
| 471 |
-
zfs_ioc_wait_fs, zfs_secpolicy_none, DATASET_NAME,
|
| 472 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_FALSE,
|
| 473 |
-
zfs_keys_fs_wait, ARRAY_SIZE(zfs_keys_fs_wait));
|
| 474 |
-
|
| 475 |
-
zfs_ioctl_register("set_bootenv", ZFS_IOC_SET_BOOTENV,
|
| 476 |
-
zfs_ioc_set_bootenv, zfs_secpolicy_config, POOL_NAME,
|
| 477 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_TRUE,
|
| 478 |
-
zfs_keys_set_bootenv, ARRAY_SIZE(zfs_keys_set_bootenv));
|
| 479 |
-
|
| 480 |
-
zfs_ioctl_register("get_bootenv", ZFS_IOC_GET_BOOTENV,
|
| 481 |
-
zfs_ioc_get_bootenv, zfs_secpolicy_none, POOL_NAME,
|
| 482 |
-
POOL_CHECK_SUSPENDED, B_FALSE, B_TRUE,
|
| 483 |
-
zfs_keys_get_bootenv, ARRAY_SIZE(zfs_keys_get_bootenv));
|
| 484 |
-
|
| 485 |
-
zfs_ioctl_register("zpool_vdev_get_props", ZFS_IOC_VDEV_GET_PROPS,
|
| 486 |
-
zfs_ioc_vdev_get_props, zfs_secpolicy_read, POOL_NAME,
|
| 487 |
-
POOL_CHECK_NONE, B_FALSE, B_FALSE, zfs_keys_vdev_get_props,
|
| 488 |
-
ARRAY_SIZE(zfs_keys_vdev_get_props));
|
| 489 |
-
|
| 490 |
-
zfs_ioctl_register("zpool_vdev_set_props", ZFS_IOC_VDEV_SET_PROPS,
|
| 491 |
-
zfs_ioc_vdev_set_props, zfs_secpolicy_config, POOL_NAME,
|
| 492 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_FALSE,
|
| 493 |
-
zfs_keys_vdev_set_props, ARRAY_SIZE(zfs_keys_vdev_set_props));
|
| 494 |
-
|
| 495 |
-
zfs_ioctl_register("scrub", ZFS_IOC_POOL_SCRUB,
|
| 496 |
-
zfs_ioc_pool_scrub, zfs_secpolicy_config, POOL_NAME,
|
| 497 |
-
POOL_CHECK_NONE, B_TRUE, B_TRUE,
|
| 498 |
-
zfs_keys_pool_scrub, ARRAY_SIZE(zfs_keys_pool_scrub));
|
| 499 |
-
|
| 500 |
-
/* IOCTLS that use the legacy function signature */
|
| 501 |
-
|
| 502 |
-
zfs_ioctl_register_legacy(ZFS_IOC_POOL_FREEZE, zfs_ioc_pool_freeze,
|
| 503 |
-
zfs_secpolicy_config, NO_NAME, B_FALSE, POOL_CHECK_READONLY);
|
| 504 |
-
|
| 505 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_CREATE, zfs_ioc_pool_create,
|
| 506 |
-
zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE);
|
| 507 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_SCAN,
|
| 508 |
-
zfs_ioc_pool_scan);
|
| 509 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_UPGRADE,
|
| 510 |
-
zfs_ioc_pool_upgrade);
|
| 511 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_ADD,
|
| 512 |
-
zfs_ioc_vdev_add);
|
| 513 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_REMOVE,
|
| 514 |
-
zfs_ioc_vdev_remove);
|
| 515 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_SET_STATE,
|
| 516 |
-
zfs_ioc_vdev_set_state);
|
| 517 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_ATTACH,
|
| 518 |
-
zfs_ioc_vdev_attach);
|
| 519 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_DETACH,
|
| 520 |
-
zfs_ioc_vdev_detach);
|
| 521 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_SETPATH,
|
| 522 |
-
zfs_ioc_vdev_setpath);
|
| 523 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_SETFRU,
|
| 524 |
-
zfs_ioc_vdev_setfru);
|
| 525 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_SET_PROPS,
|
| 526 |
-
zfs_ioc_pool_set_props);
|
| 527 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_VDEV_SPLIT,
|
| 528 |
-
zfs_ioc_vdev_split);
|
| 529 |
-
zfs_ioctl_register_pool_modify(ZFS_IOC_POOL_REGUID,
|
| 530 |
-
zfs_ioc_pool_reguid);
|
| 531 |
-
|
| 532 |
-
zfs_ioctl_register_pool_meta(ZFS_IOC_POOL_CONFIGS,
|
| 533 |
-
zfs_ioc_pool_configs, zfs_secpolicy_none);
|
| 534 |
-
zfs_ioctl_register_pool_meta(ZFS_IOC_POOL_TRYIMPORT,
|
| 535 |
-
zfs_ioc_pool_tryimport, zfs_secpolicy_config);
|
| 536 |
-
zfs_ioctl_register_pool_meta(ZFS_IOC_INJECT_FAULT,
|
| 537 |
-
zfs_ioc_inject_fault, zfs_secpolicy_inject);
|
| 538 |
-
zfs_ioctl_register_pool_meta(ZFS_IOC_CLEAR_FAULT,
|
| 539 |
-
zfs_ioc_clear_fault, zfs_secpolicy_inject);
|
| 540 |
-
zfs_ioctl_register_pool_meta(ZFS_IOC_INJECT_LIST_NEXT,
|
| 541 |
-
zfs_ioc_inject_list_next, zfs_secpolicy_inject);
|
| 542 |
-
|
| 543 |
-
/*
|
| 544 |
-
* pool destroy, and export don't log the history as part of
|
| 545 |
-
* zfsdev_ioctl, but rather zfs_ioc_pool_export
|
| 546 |
-
* does the logging of those commands.
|
| 547 |
-
*/
|
| 548 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_DESTROY, zfs_ioc_pool_destroy,
|
| 549 |
-
zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED);
|
| 550 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_EXPORT, zfs_ioc_pool_export,
|
| 551 |
-
zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED);
|
| 552 |
-
|
| 553 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_STATS, zfs_ioc_pool_stats,
|
| 554 |
-
zfs_secpolicy_read, B_FALSE, POOL_CHECK_NONE);
|
| 555 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_GET_PROPS, zfs_ioc_pool_get_props,
|
| 556 |
-
zfs_secpolicy_read, B_FALSE, POOL_CHECK_NONE);
|
| 557 |
-
|
| 558 |
-
zfs_ioctl_register_pool(ZFS_IOC_ERROR_LOG, zfs_ioc_error_log,
|
| 559 |
-
zfs_secpolicy_inject, B_FALSE, POOL_CHECK_SUSPENDED);
|
| 560 |
-
zfs_ioctl_register_pool(ZFS_IOC_DSOBJ_TO_DSNAME,
|
| 561 |
-
zfs_ioc_dsobj_to_dsname,
|
| 562 |
-
zfs_secpolicy_diff, B_FALSE, POOL_CHECK_SUSPENDED);
|
| 563 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_GET_HISTORY,
|
| 564 |
-
zfs_ioc_pool_get_history,
|
| 565 |
-
zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED);
|
| 566 |
-
|
| 567 |
-
zfs_ioctl_register_pool(ZFS_IOC_POOL_IMPORT, zfs_ioc_pool_import,
|
| 568 |
-
zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE);
|
| 569 |
-
|
| 570 |
-
zfs_ioctl_register_pool(ZFS_IOC_CLEAR, zfs_ioc_clear,
|
| 571 |
-
zfs_secpolicy_config, B_TRUE, POOL_CHECK_READONLY);
|
| 572 |
-
|
| 573 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_SPACE_WRITTEN,
|
| 574 |
-
zfs_ioc_space_written);
|
| 575 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_OBJSET_RECVD_PROPS,
|
| 576 |
-
zfs_ioc_objset_recvd_props);
|
| 577 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_NEXT_OBJ,
|
| 578 |
-
zfs_ioc_next_obj);
|
| 579 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_GET_FSACL,
|
| 580 |
-
zfs_ioc_get_fsacl);
|
| 581 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_OBJSET_STATS,
|
| 582 |
-
zfs_ioc_objset_stats);
|
| 583 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_OBJSET_ZPLPROPS,
|
| 584 |
-
zfs_ioc_objset_zplprops);
|
| 585 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_DATASET_LIST_NEXT,
|
| 586 |
-
zfs_ioc_dataset_list_next);
|
| 587 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_SNAPSHOT_LIST_NEXT,
|
| 588 |
-
zfs_ioc_snapshot_list_next);
|
| 589 |
-
zfs_ioctl_register_dataset_read(ZFS_IOC_SEND_PROGRESS,
|
| 590 |
-
zfs_ioc_send_progress);
|
| 591 |
-
|
| 592 |
-
zfs_ioctl_register_dataset_read_secpolicy(ZFS_IOC_DIFF,
|
| 593 |
-
zfs_ioc_diff, zfs_secpolicy_diff);
|
| 594 |
-
zfs_ioctl_register_dataset_read_secpolicy(ZFS_IOC_OBJ_TO_STATS,
|
| 595 |
-
zfs_ioc_obj_to_stats, zfs_secpolicy_diff);
|
| 596 |
-
zfs_ioctl_register_dataset_read_secpolicy(ZFS_IOC_OBJ_TO_PATH,
|
| 597 |
-
zfs_ioc_obj_to_path, zfs_secpolicy_diff);
|
| 598 |
-
zfs_ioctl_register_dataset_read_secpolicy(ZFS_IOC_USERSPACE_ONE,
|
| 599 |
-
zfs_ioc_userspace_one, zfs_secpolicy_userspace_one);
|
| 600 |
-
zfs_ioctl_register_dataset_read_secpolicy(ZFS_IOC_USERSPACE_MANY,
|
| 601 |
-
zfs_ioc_userspace_many, zfs_secpolicy_userspace_many);
|
| 602 |
-
zfs_ioctl_register_dataset_read_secpolicy(ZFS_IOC_SEND,
|
| 603 |
-
zfs_ioc_send, zfs_secpolicy_send);
|
| 604 |
-
|
| 605 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_SET_PROP, zfs_ioc_set_prop,
|
| 606 |
-
zfs_secpolicy_none);
|
| 607 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_DESTROY, zfs_ioc_destroy,
|
| 608 |
-
zfs_secpolicy_destroy);
|
| 609 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_RENAME, zfs_ioc_rename,
|
| 610 |
-
zfs_secpolicy_rename);
|
| 611 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_RECV, zfs_ioc_recv,
|
| 612 |
-
zfs_secpolicy_recv);
|
| 613 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_PROMOTE, zfs_ioc_promote,
|
| 614 |
-
zfs_secpolicy_promote);
|
| 615 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_INHERIT_PROP,
|
| 616 |
-
zfs_ioc_inherit_prop, zfs_secpolicy_inherit_prop);
|
| 617 |
-
zfs_ioctl_register_dataset_modify(ZFS_IOC_SET_FSACL, zfs_ioc_set_fsacl,
|
| 618 |
-
zfs_secpolicy_set_fsacl);
|
| 619 |
-
|
| 620 |
-
zfs_ioctl_register_dataset_nolog(ZFS_IOC_SHARE, zfs_ioc_share,
|
| 621 |
-
zfs_secpolicy_share, POOL_CHECK_NONE);
|
| 622 |
-
zfs_ioctl_register_dataset_nolog(ZFS_IOC_SMB_ACL, zfs_ioc_smb_acl,
|
| 623 |
-
zfs_secpolicy_smb_acl, POOL_CHECK_NONE);
|
| 624 |
-
zfs_ioctl_register_dataset_nolog(ZFS_IOC_USERSPACE_UPGRADE,
|
| 625 |
-
zfs_ioc_userspace_upgrade, zfs_secpolicy_userspace_upgrade,
|
| 626 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY);
|
| 627 |
-
zfs_ioctl_register_dataset_nolog(ZFS_IOC_TMP_SNAPSHOT,
|
| 628 |
-
zfs_ioc_tmp_snapshot, zfs_secpolicy_tmp_snapshot,
|
| 629 |
-
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY);
|
| 630 |
-
|
| 631 |
-
zfs_ioctl_register_legacy(ZFS_IOC_EVENTS_NEXT, zfs_ioc_events_next,
|
| 632 |
-
zfs_secpolicy_config, NO_NAME, B_FALSE, POOL_CHECK_NONE);
|
| 633 |
-
zfs_ioctl_register_legacy(ZFS_IOC_EVENTS_CLEAR, zfs_ioc_events_clear,
|
| 634 |
-
zfs_secpolicy_config, NO_NAME, B_FALSE, POOL_CHECK_NONE);
|
| 635 |
-
zfs_ioctl_register_legacy(ZFS_IOC_EVENTS_SEEK, zfs_ioc_events_seek,
|
| 636 |
-
zfs_secpolicy_config, NO_NAME, B_FALSE, POOL_CHECK_NONE);
|
| 637 |
-
|
| 638 |
-
zfs_ioctl_init_os();
|
| 639 |
-
}
|
| 640 |
-
```
|
| 641 |
-
|
| 642 |
-
# Example 5
|
| 643 |
-
|
| 644 |
-
## Callsite
|
| 645 |
-
|
| 646 |
-
*/home/yuanting/work/icall-benchmarks/llm/redis-stable/src/unix.c:134:12*
|
| 647 |
-
|
| 648 |
-
fnptr: *connectionTypeTcp()->read*
|
| 649 |
-
|
| 650 |
-
targets: connTLSRead
|
| 651 |
-
|
| 652 |
-
## Related Code Snippets
|
| 653 |
-
|
| 654 |
-
```c
|
| 655 |
-
static int connUnixRead(connection *conn, void *buf, size_t buf_len) {
|
| 656 |
-
return connectionTypeTcp()->read(conn, buf, buf_len);
|
| 657 |
-
}
|
| 658 |
-
```
|
| 659 |
-
|
| 660 |
-
```c
|
| 661 |
-
ConnectionType *connectionByType(const char *typename) {
|
| 662 |
-
ConnectionType *ct;
|
| 663 |
-
|
| 664 |
-
for (int type = 0; type < CONN_TYPE_MAX; type++) {
|
| 665 |
-
ct = connTypes[type];
|
| 666 |
-
if (!ct)
|
| 667 |
-
break;
|
| 668 |
-
|
| 669 |
-
if (!strcasecmp(typename, ct->get_type(NULL)))
|
| 670 |
-
return ct;
|
| 671 |
-
}
|
| 672 |
-
|
| 673 |
-
serverLog(LL_WARNING, "Missing implement of connection type %s", typename);
|
| 674 |
-
|
| 675 |
-
return NULL;
|
| 676 |
-
}
|
| 677 |
-
```
|
| 678 |
-
|
| 679 |
-
```c
|
| 680 |
-
/* Cache TCP connection type, query it by string once */
|
| 681 |
-
ConnectionType *connectionTypeTcp(void) {
|
| 682 |
-
static ConnectionType *ct_tcp = NULL;
|
| 683 |
-
|
| 684 |
-
if (ct_tcp != NULL)
|
| 685 |
-
return ct_tcp;
|
| 686 |
-
|
| 687 |
-
ct_tcp = connectionByType(CONN_TYPE_SOCKET);
|
| 688 |
-
serverAssert(ct_tcp != NULL);
|
| 689 |
-
|
| 690 |
-
return ct_tcp;
|
| 691 |
-
}
|
| 692 |
-
```
|
| 693 |
-
|
| 694 |
-
```c
|
| 695 |
-
static ConnectionType *connTypes[CONN_TYPE_MAX];
|
| 696 |
-
|
| 697 |
-
int connTypeRegister(ConnectionType *ct) {
|
| 698 |
-
...
|
| 699 |
-
serverLog(LL_VERBOSE, "Connection type %s registered", typename);
|
| 700 |
-
connTypes[type] = ct;
|
| 701 |
-
...
|
| 702 |
-
return C_OK;
|
| 703 |
-
}
|
| 704 |
-
```
|
| 705 |
-
|
| 706 |
-
```c
|
| 707 |
-
int RedisRegisterConnectionTypeSocket(void)
|
| 708 |
-
{
|
| 709 |
-
return connTypeRegister(&CT_Socket);
|
| 710 |
-
}
|
| 711 |
-
```
|
| 712 |
-
|
| 713 |
-
```c
|
| 714 |
-
int RedisRegisterConnectionTypeTLS(void) {
|
| 715 |
-
return connTypeRegister(&CT_TLS);
|
| 716 |
-
}
|
| 717 |
-
```
|
| 718 |
-
|
| 719 |
-
```c
|
| 720 |
-
static ConnectionType CT_Socket = {
|
| 721 |
-
...
|
| 722 |
-
.read = connTLSRead,
|
| 723 |
-
.write = connTLSWrite,
|
| 724 |
-
.writev = connTLSWritev,
|
| 725 |
-
...
|
| 726 |
-
};
|
| 727 |
-
|
| 728 |
-
static ConnectionType CT_TLS = {
|
| 729 |
-
...
|
| 730 |
-
|
| 731 |
-
.read = connTLSRead,
|
| 732 |
-
.write = connTLSWrite,
|
| 733 |
-
.writev = connTLSWritev,
|
| 734 |
-
...
|
| 735 |
-
}
|
| 736 |
-
```
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
# Example 6
|
| 740 |
-
|
| 741 |
-
## Callsite
|
| 742 |
-
|
| 743 |
-
*/home/yuanting/work/icall-benchmarks/llm/redis-stable/deps/hiredis/read.c:323:23*
|
| 744 |
-
|
| 745 |
-
fnptr: *r->fn->createDouble*
|
| 746 |
-
|
| 747 |
-
targets: createDoubleObject
|
| 748 |
-
|
| 749 |
-
## Related Code Snippets
|
| 750 |
-
|
| 751 |
-
```c
|
| 752 |
-
static int processLineItem(redisReader *r) {
|
| 753 |
-
redisReadTask *cur = r->task[r->ridx];
|
| 754 |
-
void *obj;
|
| 755 |
-
char *p;
|
| 756 |
-
int len;
|
| 757 |
-
|
| 758 |
-
if ((p = readLine(r,&len)) != NULL) {
|
| 759 |
-
if (cur->type == REDIS_REPLY_INTEGER) {
|
| 760 |
-
...
|
| 761 |
-
} else if (cur->type == REDIS_REPLY_DOUBLE) {
|
| 762 |
-
...
|
| 763 |
-
|
| 764 |
-
if (r->fn && r->fn->createDouble) {
|
| 765 |
-
obj = r->fn->createDouble(cur,d,buf,len);
|
| 766 |
-
} else {
|
| 767 |
-
obj = (void*)REDIS_REPLY_DOUBLE;
|
| 768 |
-
}
|
| 769 |
-
} else if (cur->type == REDIS_REPLY_NIL) {
|
| 770 |
-
}
|
| 771 |
-
}
|
| 772 |
-
...
|
| 773 |
-
return REDIS_ERR;
|
| 774 |
-
}
|
| 775 |
-
```
|
| 776 |
-
|
| 777 |
-
```c
|
| 778 |
-
static int processItem(redisReader *r) {
|
| 779 |
-
redisReadTask *cur = r->task[r->ridx];
|
| 780 |
-
...
|
| 781 |
-
|
| 782 |
-
/* process typed item */
|
| 783 |
-
switch(cur->type) {
|
| 784 |
-
case REDIS_REPLY_ERROR:
|
| 785 |
-
case REDIS_REPLY_STATUS:
|
| 786 |
-
case REDIS_REPLY_INTEGER:
|
| 787 |
-
case REDIS_REPLY_DOUBLE:
|
| 788 |
-
case REDIS_REPLY_NIL:
|
| 789 |
-
case REDIS_REPLY_BOOL:
|
| 790 |
-
case REDIS_REPLY_BIGNUM:
|
| 791 |
-
return processLineItem(r);
|
| 792 |
-
case REDIS_REPLY_STRING:
|
| 793 |
-
case REDIS_REPLY_VERB:
|
| 794 |
-
return processBulkItem(r);
|
| 795 |
-
case REDIS_REPLY_ARRAY:
|
| 796 |
-
case REDIS_REPLY_MAP:
|
| 797 |
-
case REDIS_REPLY_SET:
|
| 798 |
-
case REDIS_REPLY_PUSH:
|
| 799 |
-
return processAggregateItem(r);
|
| 800 |
-
default:
|
| 801 |
-
assert(NULL);
|
| 802 |
-
return REDIS_ERR; /* Avoid warning. */
|
| 803 |
-
}
|
| 804 |
-
}
|
| 805 |
-
```
|
| 806 |
-
|
| 807 |
-
```c
|
| 808 |
-
int redisReaderGetReply(redisReader *r, void **reply) {
|
| 809 |
-
...
|
| 810 |
-
|
| 811 |
-
/* Process items in reply. */
|
| 812 |
-
while (r->ridx >= 0)
|
| 813 |
-
if (processItem(r) != REDIS_OK)
|
| 814 |
-
break;
|
| 815 |
-
|
| 816 |
-
...
|
| 817 |
-
return REDIS_OK;
|
| 818 |
-
}
|
| 819 |
-
```
|
| 820 |
-
|
| 821 |
-
```c
|
| 822 |
-
static void test_reply_reader(void) {
|
| 823 |
-
redisReader *reader;
|
| 824 |
-
void *reply, *root;
|
| 825 |
-
int ret;
|
| 826 |
-
int i;
|
| 827 |
-
|
| 828 |
-
test("Error handling in reply parser: ");
|
| 829 |
-
reader = redisReaderCreate();
|
| 830 |
-
redisReaderFeed(reader,(char*)"@foo\r\n",6);
|
| 831 |
-
ret = redisReaderGetReply(reader,NULL);
|
| 832 |
-
...
|
| 833 |
-
}
|
| 834 |
-
```
|
| 835 |
-
|
| 836 |
-
```c
|
| 837 |
-
redisReader *redisReaderCreate(void) {
|
| 838 |
-
return redisReaderCreateWithFunctions(&defaultFunctions);
|
| 839 |
-
}
|
| 840 |
-
```
|
| 841 |
-
|
| 842 |
-
```c
|
| 843 |
-
redisReader *redisReaderCreateWithFunctions(redisReplyObjectFunctions *fn) {
|
| 844 |
-
redisReader *r;
|
| 845 |
-
|
| 846 |
-
r = hi_calloc(1,sizeof(redisReader));
|
| 847 |
-
if (r == NULL)
|
| 848 |
-
return NULL;
|
| 849 |
-
|
| 850 |
-
r->buf = hi_sdsempty();
|
| 851 |
-
if (r->buf == NULL)
|
| 852 |
-
goto oom;
|
| 853 |
-
|
| 854 |
-
r->task = hi_calloc(REDIS_READER_STACK_SIZE, sizeof(*r->task));
|
| 855 |
-
if (r->task == NULL)
|
| 856 |
-
goto oom;
|
| 857 |
-
|
| 858 |
-
for (; r->tasks < REDIS_READER_STACK_SIZE; r->tasks++) {
|
| 859 |
-
r->task[r->tasks] = hi_calloc(1, sizeof(**r->task));
|
| 860 |
-
if (r->task[r->tasks] == NULL)
|
| 861 |
-
goto oom;
|
| 862 |
-
}
|
| 863 |
-
|
| 864 |
-
r->fn = fn;
|
| 865 |
-
r->maxbuf = REDIS_READER_MAX_BUF;
|
| 866 |
-
r->maxelements = REDIS_READER_MAX_ARRAY_ELEMENTS;
|
| 867 |
-
r->ridx = -1;
|
| 868 |
-
|
| 869 |
-
return r;
|
| 870 |
-
oom:
|
| 871 |
-
redisReaderFree(r);
|
| 872 |
-
return NULL;
|
| 873 |
-
}
|
| 874 |
-
```
|
| 875 |
-
|
| 876 |
-
```c
|
| 877 |
-
static redisReplyObjectFunctions defaultFunctions = {
|
| 878 |
-
createStringObject,
|
| 879 |
-
createArrayObject,
|
| 880 |
-
createIntegerObject,
|
| 881 |
-
createDoubleObject,
|
| 882 |
-
createNilObject,
|
| 883 |
-
createBoolObject,
|
| 884 |
-
freeReplyObject
|
| 885 |
-
};
|
| 886 |
-
```
|
| 887 |
-
|
| 888 |
-
# Example 7
|
| 889 |
-
|
| 890 |
-
## Callsite
|
| 891 |
-
|
| 892 |
-
*/home/yuanting/work/icall-benchmarks/llm/zfs-build/../zfs-2.2.2/module/os/linux/zfs/zfs_acl.c:1603:14*
|
| 893 |
-
|
| 894 |
-
fnptr: *aclp->z_ops->ace_size*
|
| 895 |
-
|
| 896 |
-
targets: zfs_ace_v0_size, zfs_ace_fuid_size
|
| 897 |
-
|
| 898 |
-
## Related Code Snippets
|
| 899 |
-
|
| 900 |
-
```c
|
| 901 |
-
static void
|
| 902 |
-
zfs_acl_chmod(boolean_t isdir, uint64_t mode, boolean_t split, boolean_t trim,
|
| 903 |
-
zfs_acl_t *aclp)
|
| 904 |
-
{
|
| 905 |
-
...
|
| 906 |
-
while ((acep = zfs_acl_next_ace(aclp, acep, &who, &access_mask,
|
| 907 |
-
&iflags, &type))) {
|
| 908 |
-
...
|
| 909 |
-
zfs_set_ace(aclp, zacep, access_mask, type, who, iflags);
|
| 910 |
-
ace_size = aclp->z_ops->ace_size(acep);
|
| 911 |
-
zacep = (void *)((uintptr_t)zacep + ace_size);
|
| 912 |
-
new_count++;
|
| 913 |
-
new_bytes += ace_size;
|
| 914 |
-
}
|
| 915 |
-
}
|
| 916 |
-
```
|
| 917 |
-
|
| 918 |
-
```c
|
| 919 |
-
int
|
| 920 |
-
zfs_acl_chmod_setattr(znode_t *zp, zfs_acl_t **aclp, uint64_t mode)
|
| 921 |
-
{
|
| 922 |
-
int error = 0;
|
| 923 |
-
|
| 924 |
-
mutex_enter(&zp->z_acl_lock);
|
| 925 |
-
mutex_enter(&zp->z_lock);
|
| 926 |
-
if (ZTOZSB(zp)->z_acl_mode == ZFS_ACL_DISCARD)
|
| 927 |
-
*aclp = zfs_acl_alloc(zfs_acl_version_zp(zp));
|
| 928 |
-
else
|
| 929 |
-
error = zfs_acl_node_read(zp, B_TRUE, aclp, B_TRUE);
|
| 930 |
-
|
| 931 |
-
if (error == 0) {
|
| 932 |
-
(*aclp)->z_hints = zp->z_pflags & V4_ACL_WIDE_FLAGS;
|
| 933 |
-
zfs_acl_chmod(S_ISDIR(ZTOI(zp)->i_mode), mode, B_TRUE,
|
| 934 |
-
(ZTOZSB(zp)->z_acl_mode == ZFS_ACL_GROUPMASK), *aclp);
|
| 935 |
-
}
|
| 936 |
-
mutex_exit(&zp->z_lock);
|
| 937 |
-
mutex_exit(&zp->z_acl_lock);
|
| 938 |
-
|
| 939 |
-
return (error);
|
| 940 |
-
}
|
| 941 |
-
```
|
| 942 |
-
|
| 943 |
-
```c
|
| 944 |
-
int
|
| 945 |
-
zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr,
|
| 946 |
-
vsecattr_t *vsecp, zfs_acl_ids_t *acl_ids, zidmap_t *mnt_ns)
|
| 947 |
-
{
|
| 948 |
-
...
|
| 949 |
-
|
| 950 |
-
memset(acl_ids, 0, sizeof (zfs_acl_ids_t));
|
| 951 |
-
acl_ids->z_mode = vap->va_mode;
|
| 952 |
-
|
| 953 |
-
...
|
| 954 |
-
|
| 955 |
-
if (acl_ids->z_aclp == NULL) {
|
| 956 |
-
...
|
| 957 |
-
if (!(flag & IS_ROOT_NODE) &&
|
| 958 |
-
(dzp->z_pflags & ZFS_INHERIT_ACE) &&
|
| 959 |
-
!(dzp->z_pflags & ZFS_XATTR)) {
|
| 960 |
-
...
|
| 961 |
-
acl_ids->z_aclp = zfs_acl_inherit(zfsvfs,
|
| 962 |
-
vap->va_mode, paclp, acl_ids->z_mode, &need_chmod);
|
| 963 |
-
inherited = B_TRUE;
|
| 964 |
-
} else {
|
| 965 |
-
acl_ids->z_aclp =
|
| 966 |
-
zfs_acl_alloc(zfs_acl_version_zp(dzp));
|
| 967 |
-
acl_ids->z_aclp->z_hints |= ZFS_ACL_TRIVIAL;
|
| 968 |
-
}
|
| 969 |
-
mutex_exit(&dzp->z_lock);
|
| 970 |
-
mutex_exit(&dzp->z_acl_lock);
|
| 971 |
-
|
| 972 |
-
if (need_chmod) {
|
| 973 |
-
if (S_ISDIR(vap->va_mode))
|
| 974 |
-
acl_ids->z_aclp->z_hints |=
|
| 975 |
-
ZFS_ACL_AUTO_INHERIT;
|
| 976 |
-
|
| 977 |
-
if (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK &&
|
| 978 |
-
zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH &&
|
| 979 |
-
zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH_X)
|
| 980 |
-
trim = B_TRUE;
|
| 981 |
-
zfs_acl_chmod(vap->va_mode, acl_ids->z_mode, B_FALSE,
|
| 982 |
-
trim, acl_ids->z_aclp);
|
| 983 |
-
}
|
| 984 |
-
}
|
| 985 |
-
|
| 986 |
-
if (inherited || vsecp) {
|
| 987 |
-
acl_ids->z_mode = zfs_mode_compute(acl_ids->z_mode,
|
| 988 |
-
acl_ids->z_aclp, &acl_ids->z_aclp->z_hints,
|
| 989 |
-
acl_ids->z_fuid, acl_ids->z_fgid);
|
| 990 |
-
if (ace_trivial_common(acl_ids->z_aclp, 0, zfs_ace_walk) == 0)
|
| 991 |
-
acl_ids->z_aclp->z_hints |= ZFS_ACL_TRIVIAL;
|
| 992 |
-
}
|
| 993 |
-
|
| 994 |
-
return (0);
|
| 995 |
-
}
|
| 996 |
-
```
|
| 997 |
-
|
| 998 |
-
```c
|
| 999 |
-
static zfs_acl_t *
|
| 1000 |
-
zfs_acl_inherit(zfsvfs_t *zfsvfs, umode_t va_mode, zfs_acl_t *paclp,
|
| 1001 |
-
uint64_t mode, boolean_t *need_chmod)
|
| 1002 |
-
{
|
| 1003 |
-
void *pacep = NULL;
|
| 1004 |
-
void *acep;
|
| 1005 |
-
...
|
| 1006 |
-
|
| 1007 |
-
aclp = zfs_acl_alloc(paclp->z_version);
|
| 1008 |
-
aclinherit = zfsvfs->z_acl_inherit;
|
| 1009 |
-
if (aclinherit == ZFS_ACL_DISCARD || S_ISLNK(va_mode))
|
| 1010 |
-
return (aclp);
|
| 1011 |
-
|
| 1012 |
-
while ((pacep = zfs_acl_next_ace(paclp, pacep, &who,
|
| 1013 |
-
&access_mask, &iflags, &type))) {
|
| 1014 |
-
...
|
| 1015 |
-
}
|
| 1016 |
-
|
| 1017 |
-
return (aclp);
|
| 1018 |
-
}
|
| 1019 |
-
```
|
| 1020 |
-
|
| 1021 |
-
```c
|
| 1022 |
-
zfs_acl_t *
|
| 1023 |
-
zfs_acl_alloc(int vers)
|
| 1024 |
-
{
|
| 1025 |
-
zfs_acl_t *aclp;
|
| 1026 |
-
|
| 1027 |
-
aclp = kmem_zalloc(sizeof (zfs_acl_t), KM_SLEEP);
|
| 1028 |
-
list_create(&aclp->z_acl, sizeof (zfs_acl_node_t),
|
| 1029 |
-
offsetof(zfs_acl_node_t, z_next));
|
| 1030 |
-
aclp->z_version = vers;
|
| 1031 |
-
if (vers == ZFS_ACL_VERSION_FUID)
|
| 1032 |
-
aclp->z_ops = &zfs_acl_fuid_ops;
|
| 1033 |
-
else
|
| 1034 |
-
aclp->z_ops = &zfs_acl_v0_ops;
|
| 1035 |
-
return (aclp);
|
| 1036 |
-
}
|
| 1037 |
-
```
|
| 1038 |
-
|
| 1039 |
-
```c
|
| 1040 |
-
static const acl_ops_t zfs_acl_v0_ops = {
|
| 1041 |
-
.ace_mask_get = zfs_ace_v0_get_mask,
|
| 1042 |
-
.ace_mask_set = zfs_ace_v0_set_mask,
|
| 1043 |
-
.ace_flags_get = zfs_ace_v0_get_flags,
|
| 1044 |
-
.ace_flags_set = zfs_ace_v0_set_flags,
|
| 1045 |
-
.ace_type_get = zfs_ace_v0_get_type,
|
| 1046 |
-
.ace_type_set = zfs_ace_v0_set_type,
|
| 1047 |
-
.ace_who_get = zfs_ace_v0_get_who,
|
| 1048 |
-
.ace_who_set = zfs_ace_v0_set_who,
|
| 1049 |
-
.ace_size = zfs_ace_v0_size,
|
| 1050 |
-
.ace_abstract_size = zfs_ace_v0_abstract_size,
|
| 1051 |
-
.ace_mask_off = zfs_ace_v0_mask_off,
|
| 1052 |
-
.ace_data = zfs_ace_v0_data
|
| 1053 |
-
};
|
| 1054 |
-
|
| 1055 |
-
static const acl_ops_t zfs_acl_fuid_ops = {
|
| 1056 |
-
.ace_mask_get = zfs_ace_fuid_get_mask,
|
| 1057 |
-
.ace_mask_set = zfs_ace_fuid_set_mask,
|
| 1058 |
-
.ace_flags_get = zfs_ace_fuid_get_flags,
|
| 1059 |
-
.ace_flags_set = zfs_ace_fuid_set_flags,
|
| 1060 |
-
.ace_type_get = zfs_ace_fuid_get_type,
|
| 1061 |
-
.ace_type_set = zfs_ace_fuid_set_type,
|
| 1062 |
-
.ace_who_get = zfs_ace_fuid_get_who,
|
| 1063 |
-
.ace_who_set = zfs_ace_fuid_set_who,
|
| 1064 |
-
.ace_size = zfs_ace_fuid_size,
|
| 1065 |
-
.ace_abstract_size = zfs_ace_fuid_abstract_size,
|
| 1066 |
-
.ace_mask_off = zfs_ace_fuid_mask_off,
|
| 1067 |
-
.ace_data = zfs_ace_fuid_data
|
| 1068 |
-
};
|
| 1069 |
-
```
|
| 1070 |
-
|
| 1071 |
-
# Example 8
|
| 1072 |
-
|
| 1073 |
-
## Callsite
|
| 1074 |
-
|
| 1075 |
-
*/home/yuanting/work/icall-benchmarks/llm/curl-build/lib/../../curl-8.5.0/lib/vtls/vtls.c:1308:10*
|
| 1076 |
-
|
| 1077 |
-
fnptr: *Curl_ssl->send_plain*
|
| 1078 |
-
|
| 1079 |
-
targets: multissl_send_plain
|
| 1080 |
-
|
| 1081 |
-
## Related Code Snippets
|
| 1082 |
-
|
| 1083 |
-
```c
|
| 1084 |
-
static ssize_t multissl_send_plain(struct Curl_cfilter *cf,
|
| 1085 |
-
struct Curl_easy *data,
|
| 1086 |
-
const void *mem, size_t len,
|
| 1087 |
-
CURLcode *code)
|
| 1088 |
-
{
|
| 1089 |
-
if(multissl_setup(NULL))
|
| 1090 |
-
return CURLE_FAILED_INIT;
|
| 1091 |
-
return Curl_ssl->send_plain(cf, data, mem, len, code);
|
| 1092 |
-
}
|
| 1093 |
-
```
|
| 1094 |
-
|
| 1095 |
-
```c
|
| 1096 |
-
static const struct Curl_ssl Curl_ssl_multi = {
|
| 1097 |
-
{ CURLSSLBACKEND_NONE, "multi" }, /* info */
|
| 1098 |
-
0, /* supports nothing */
|
| 1099 |
-
(size_t)-1, /* something insanely large to be on the safe side */
|
| 1100 |
-
|
| 1101 |
-
multissl_init, /* init */
|
| 1102 |
-
Curl_none_cleanup, /* cleanup */
|
| 1103 |
-
multissl_version, /* version */
|
| 1104 |
-
Curl_none_check_cxn, /* check_cxn */
|
| 1105 |
-
Curl_none_shutdown, /* shutdown */
|
| 1106 |
-
Curl_none_data_pending, /* data_pending */
|
| 1107 |
-
Curl_none_random, /* random */
|
| 1108 |
-
Curl_none_cert_status_request, /* cert_status_request */
|
| 1109 |
-
multissl_connect, /* connect */
|
| 1110 |
-
multissl_connect_nonblocking, /* connect_nonblocking */
|
| 1111 |
-
multissl_adjust_pollset, /* adjust_pollset */
|
| 1112 |
-
multissl_get_internals, /* get_internals */
|
| 1113 |
-
multissl_close, /* close_one */
|
| 1114 |
-
Curl_none_close_all, /* close_all */
|
| 1115 |
-
Curl_none_session_free, /* session_free */
|
| 1116 |
-
Curl_none_set_engine, /* set_engine */
|
| 1117 |
-
Curl_none_set_engine_default, /* set_engine_default */
|
| 1118 |
-
Curl_none_engines_list, /* engines_list */
|
| 1119 |
-
Curl_none_false_start, /* false_start */
|
| 1120 |
-
NULL, /* sha256sum */
|
| 1121 |
-
NULL, /* associate_connection */
|
| 1122 |
-
NULL, /* disassociate_connection */
|
| 1123 |
-
NULL, /* free_multi_ssl_backend_data */
|
| 1124 |
-
multissl_recv_plain, /* recv decrypted data */
|
| 1125 |
-
multissl_send_plain, /* send data to encrypt */
|
| 1126 |
-
};
|
| 1127 |
-
|
| 1128 |
-
const struct Curl_ssl *Curl_ssl =
|
| 1129 |
-
#if defined(CURL_WITH_MULTI_SSL)
|
| 1130 |
-
&Curl_ssl_multi;
|
| 1131 |
-
#elif defined(USE_WOLFSSL)
|
| 1132 |
-
&Curl_ssl_wolfssl;
|
| 1133 |
-
#elif defined(USE_SECTRANSP)
|
| 1134 |
-
&Curl_ssl_sectransp;
|
| 1135 |
-
#elif defined(USE_GNUTLS)
|
| 1136 |
-
&Curl_ssl_gnutls;
|
| 1137 |
-
#elif defined(USE_MBEDTLS)
|
| 1138 |
-
&Curl_ssl_mbedtls;
|
| 1139 |
-
#elif defined(USE_RUSTLS)
|
| 1140 |
-
&Curl_ssl_rustls;
|
| 1141 |
-
#elif defined(USE_OPENSSL)
|
| 1142 |
-
&Curl_ssl_openssl;
|
| 1143 |
-
#elif defined(USE_SCHANNEL)
|
| 1144 |
-
&Curl_ssl_schannel;
|
| 1145 |
-
#elif defined(USE_BEARSSL)
|
| 1146 |
-
&Curl_ssl_bearssl;
|
| 1147 |
-
#else
|
| 1148 |
-
#error "Missing struct Curl_ssl for selected SSL backend"
|
| 1149 |
-
#endif
|
| 1150 |
-
```
|
| 1151 |
-
|
| 1152 |
-
```c
|
| 1153 |
-
struct Curl_ssl {
|
| 1154 |
-
/*
|
| 1155 |
-
* This *must* be the first entry to allow returning the list of available
|
| 1156 |
-
* backends in curl_global_sslset().
|
| 1157 |
-
*/
|
| 1158 |
-
curl_ssl_backend info;
|
| 1159 |
-
unsigned int supports; /* bitfield, see above */
|
| 1160 |
-
size_t sizeof_ssl_backend_data;
|
| 1161 |
-
|
| 1162 |
-
int (*init)(void);
|
| 1163 |
-
void (*cleanup)(void);
|
| 1164 |
-
|
| 1165 |
-
size_t (*version)(char *buffer, size_t size);
|
| 1166 |
-
int (*check_cxn)(struct Curl_cfilter *cf, struct Curl_easy *data);
|
| 1167 |
-
int (*shut_down)(struct Curl_cfilter *cf,
|
| 1168 |
-
struct Curl_easy *data);
|
| 1169 |
-
bool (*data_pending)(struct Curl_cfilter *cf,
|
| 1170 |
-
const struct Curl_easy *data);
|
| 1171 |
-
|
| 1172 |
-
/* return 0 if a find random is filled in */
|
| 1173 |
-
CURLcode (*random)(struct Curl_easy *data, unsigned char *entropy,
|
| 1174 |
-
size_t length);
|
| 1175 |
-
bool (*cert_status_request)(void);
|
| 1176 |
-
|
| 1177 |
-
CURLcode (*connect_blocking)(struct Curl_cfilter *cf,
|
| 1178 |
-
struct Curl_easy *data);
|
| 1179 |
-
CURLcode (*connect_nonblocking)(struct Curl_cfilter *cf,
|
| 1180 |
-
struct Curl_easy *data,
|
| 1181 |
-
bool *done);
|
| 1182 |
-
|
| 1183 |
-
/* During handshake, adjust the pollset to include the socket
|
| 1184 |
-
* for POLLOUT or POLLIN as needed.
|
| 1185 |
-
* Mandatory. */
|
| 1186 |
-
void (*adjust_pollset)(struct Curl_cfilter *cf, struct Curl_easy *data,
|
| 1187 |
-
struct easy_pollset *ps);
|
| 1188 |
-
void *(*get_internals)(struct ssl_connect_data *connssl, CURLINFO info);
|
| 1189 |
-
void (*close)(struct Curl_cfilter *cf, struct Curl_easy *data);
|
| 1190 |
-
void (*close_all)(struct Curl_easy *data);
|
| 1191 |
-
void (*session_free)(void *ptr);
|
| 1192 |
-
|
| 1193 |
-
CURLcode (*set_engine)(struct Curl_easy *data, const char *engine);
|
| 1194 |
-
CURLcode (*set_engine_default)(struct Curl_easy *data);
|
| 1195 |
-
struct curl_slist *(*engines_list)(struct Curl_easy *data);
|
| 1196 |
-
|
| 1197 |
-
bool (*false_start)(void);
|
| 1198 |
-
CURLcode (*sha256sum)(const unsigned char *input, size_t inputlen,
|
| 1199 |
-
unsigned char *sha256sum, size_t sha256sumlen);
|
| 1200 |
-
|
| 1201 |
-
bool (*attach_data)(struct Curl_cfilter *cf, struct Curl_easy *data);
|
| 1202 |
-
void (*detach_data)(struct Curl_cfilter *cf, struct Curl_easy *data);
|
| 1203 |
-
|
| 1204 |
-
void (*free_multi_ssl_backend_data)(struct multi_ssl_backend_data *mbackend);
|
| 1205 |
-
|
| 1206 |
-
ssize_t (*recv_plain)(struct Curl_cfilter *cf, struct Curl_easy *data,
|
| 1207 |
-
char *buf, size_t len, CURLcode *code);
|
| 1208 |
-
ssize_t (*send_plain)(struct Curl_cfilter *cf, struct Curl_easy *data,
|
| 1209 |
-
const void *mem, size_t len, CURLcode *code);
|
| 1210 |
-
|
| 1211 |
-
};
|
| 1212 |
-
```
|
| 1213 |
-
|
| 1214 |
-
# Example 9
|
| 1215 |
-
|
| 1216 |
-
## Callsite
|
| 1217 |
-
|
| 1218 |
-
*/home/yuanting/work/icall-benchmarks/llm/gcc-clang-build/gcc/../../gcc-13.2.0/gcc/lto-streamer-in.cc:1176:14*
|
| 1219 |
-
|
| 1220 |
-
fnptr: *stream_read_tree*
|
| 1221 |
-
|
| 1222 |
-
targets: lto_input_tree
|
| 1223 |
-
|
| 1224 |
-
## Related Code Snippets
|
| 1225 |
-
|
| 1226 |
-
```c
|
| 1227 |
-
static void
|
| 1228 |
-
input_ssa_names (class lto_input_block *ib, class data_in *data_in,
|
| 1229 |
-
struct function *fn)
|
| 1230 |
-
{
|
| 1231 |
-
unsigned int i, size;
|
| 1232 |
-
|
| 1233 |
-
size = streamer_read_uhwi (ib);
|
| 1234 |
-
init_tree_ssa (fn, size);
|
| 1235 |
-
cfun->gimple_df->in_ssa_p = true;
|
| 1236 |
-
init_ssa_operands (fn);
|
| 1237 |
-
|
| 1238 |
-
i = streamer_read_uhwi (ib);
|
| 1239 |
-
while (i)
|
| 1240 |
-
{
|
| 1241 |
-
tree ssa_name, name;
|
| 1242 |
-
bool is_default_def;
|
| 1243 |
-
|
| 1244 |
-
/* Skip over the elements that had been freed. */
|
| 1245 |
-
while (SSANAMES (fn)->length () < i)
|
| 1246 |
-
SSANAMES (fn)->quick_push (NULL_TREE);
|
| 1247 |
-
|
| 1248 |
-
is_default_def = (streamer_read_uchar (ib) != 0);
|
| 1249 |
-
name = stream_read_tree (ib, data_in);
|
| 1250 |
-
ssa_name = make_ssa_name_fn (fn, name, NULL);
|
| 1251 |
-
|
| 1252 |
-
if (is_default_def)
|
| 1253 |
-
{
|
| 1254 |
-
set_ssa_default_def (cfun, SSA_NAME_VAR (ssa_name), ssa_name);
|
| 1255 |
-
SSA_NAME_DEF_STMT (ssa_name) = gimple_build_nop ();
|
| 1256 |
-
}
|
| 1257 |
-
|
| 1258 |
-
i = streamer_read_uhwi (ib);
|
| 1259 |
-
}
|
| 1260 |
-
}
|
| 1261 |
-
```
|
| 1262 |
-
|
| 1263 |
-
```c
|
| 1264 |
-
#define stream_read_tree(IB, DATA_IN) \
|
| 1265 |
-
streamer_hooks.read_tree (IB, DATA_IN)
|
| 1266 |
-
```
|
| 1267 |
-
|
| 1268 |
-
```c
|
| 1269 |
-
void
|
| 1270 |
-
lto_streamer_hooks_init (void)
|
| 1271 |
-
{
|
| 1272 |
-
streamer_hooks_init ();
|
| 1273 |
-
streamer_hooks.write_tree = lto_output_tree;
|
| 1274 |
-
streamer_hooks.read_tree = lto_input_tree;
|
| 1275 |
-
streamer_hooks.input_location = lto_input_location;
|
| 1276 |
-
streamer_hooks.output_location = lto_output_location;
|
| 1277 |
-
streamer_hooks.output_location_and_block = lto_output_location_and_block;
|
| 1278 |
-
}
|
| 1279 |
-
```
|
| 1280 |
-
|
| 1281 |
-
# Example 10
|
| 1282 |
-
|
| 1283 |
-
## Callsite
|
| 1284 |
-
|
| 1285 |
-
*/home/yuanting/work/icall-benchmarks/llm/openssh-build/../openssh-9.6p1/ssh-ecdsa-sk.c:79:7*
|
| 1286 |
-
|
| 1287 |
-
fnptr: *sshkey_ecdsa_funcs.equal*
|
| 1288 |
-
|
| 1289 |
-
targets: ssh_ecdsa_equal
|
| 1290 |
-
|
| 1291 |
-
## Related Code Snippets
|
| 1292 |
-
|
| 1293 |
-
```c
|
| 1294 |
-
static int
|
| 1295 |
-
ssh_ecdsa_sk_equal(const struct sshkey *a, const struct sshkey *b)
|
| 1296 |
-
{
|
| 1297 |
-
if (!sshkey_sk_fields_equal(a, b))
|
| 1298 |
-
return 0;
|
| 1299 |
-
if (!sshkey_ecdsa_funcs.equal(a, b))
|
| 1300 |
-
return 0;
|
| 1301 |
-
return 1;
|
| 1302 |
-
}
|
| 1303 |
-
```
|
| 1304 |
-
|
| 1305 |
-
```c
|
| 1306 |
-
/* NB. not static; used by ECDSA-SK */
|
| 1307 |
-
const struct sshkey_impl_funcs sshkey_ecdsa_funcs = {
|
| 1308 |
-
/* .size = */ ssh_ecdsa_size,
|
| 1309 |
-
/* .alloc = */ NULL,
|
| 1310 |
-
/* .cleanup = */ ssh_ecdsa_cleanup,
|
| 1311 |
-
/* .equal = */ ssh_ecdsa_equal,
|
| 1312 |
-
/* .ssh_serialize_public = */ ssh_ecdsa_serialize_public,
|
| 1313 |
-
/* .ssh_deserialize_public = */ ssh_ecdsa_deserialize_public,
|
| 1314 |
-
/* .ssh_serialize_private = */ ssh_ecdsa_serialize_private,
|
| 1315 |
-
/* .ssh_deserialize_private = */ ssh_ecdsa_deserialize_private,
|
| 1316 |
-
/* .generate = */ ssh_ecdsa_generate,
|
| 1317 |
-
/* .copy_public = */ ssh_ecdsa_copy_public,
|
| 1318 |
-
/* .sign = */ ssh_ecdsa_sign,
|
| 1319 |
-
/* .verify = */ ssh_ecdsa_verify,
|
| 1320 |
-
};
|
| 1321 |
-
```
|
| 1322 |
-
|
| 1323 |
-
```c
|
| 1324 |
-
struct sshkey_impl_funcs {
|
| 1325 |
-
u_int (*size)(const struct sshkey *); /* optional */
|
| 1326 |
-
int (*alloc)(struct sshkey *); /* optional */
|
| 1327 |
-
void (*cleanup)(struct sshkey *); /* optional */
|
| 1328 |
-
int (*equal)(const struct sshkey *, const struct sshkey *);
|
| 1329 |
-
int (*serialize_public)(const struct sshkey *, struct sshbuf *,
|
| 1330 |
-
enum sshkey_serialize_rep);
|
| 1331 |
-
int (*deserialize_public)(const char *, struct sshbuf *,
|
| 1332 |
-
struct sshkey *);
|
| 1333 |
-
int (*serialize_private)(const struct sshkey *, struct sshbuf *,
|
| 1334 |
-
enum sshkey_serialize_rep);
|
| 1335 |
-
int (*deserialize_private)(const char *, struct sshbuf *,
|
| 1336 |
-
struct sshkey *);
|
| 1337 |
-
int (*generate)(struct sshkey *, int); /* optional */
|
| 1338 |
-
int (*copy_public)(const struct sshkey *, struct sshkey *);
|
| 1339 |
-
int (*sign)(struct sshkey *, u_char **, size_t *,
|
| 1340 |
-
const u_char *, size_t, const char *,
|
| 1341 |
-
const char *, const char *, u_int); /* optional */
|
| 1342 |
-
int (*verify)(const struct sshkey *, const u_char *, size_t,
|
| 1343 |
-
const u_char *, size_t, const char *, u_int,
|
| 1344 |
-
struct sshkey_sig_details **);
|
| 1345 |
-
};
|
| 1346 |
-
```
|
| 1347 |
-
|
| 1348 |
-
# Example 11
|
| 1349 |
-
|
| 1350 |
-
## Callsite
|
| 1351 |
-
|
| 1352 |
-
*/home/yuanting/work/icall-benchmarks/llm/openssh-build/../openssh-9.6p1/ssh-ed25519-sk.c:64:11*
|
| 1353 |
-
|
| 1354 |
-
fnptr: *sshkey_ed25519_funcs.serialize_public*
|
| 1355 |
-
|
| 1356 |
-
targets: ssh_ed25519_serialize_public
|
| 1357 |
-
|
| 1358 |
-
## Related Code Snippets
|
| 1359 |
-
|
| 1360 |
-
```c
|
| 1361 |
-
static int
|
| 1362 |
-
ssh_ed25519_sk_serialize_public(const struct sshkey *key, struct sshbuf *b,
|
| 1363 |
-
enum sshkey_serialize_rep opts)
|
| 1364 |
-
{
|
| 1365 |
-
int r;
|
| 1366 |
-
|
| 1367 |
-
if ((r = sshkey_ed25519_funcs.serialize_public(key, b, opts)) != 0)
|
| 1368 |
-
return r;
|
| 1369 |
-
if ((r = sshkey_serialize_sk(key, b)) != 0)
|
| 1370 |
-
return r;
|
| 1371 |
-
|
| 1372 |
-
return 0;
|
| 1373 |
-
}
|
| 1374 |
-
```
|
| 1375 |
-
|
| 1376 |
-
```c
|
| 1377 |
-
/* NB. not static; used by ED25519-SK */
|
| 1378 |
-
const struct sshkey_impl_funcs sshkey_ed25519_funcs = {
|
| 1379 |
-
/* .size = */ NULL,
|
| 1380 |
-
/* .alloc = */ NULL,
|
| 1381 |
-
/* .cleanup = */ ssh_ed25519_cleanup,
|
| 1382 |
-
/* .equal = */ ssh_ed25519_equal,
|
| 1383 |
-
/* .ssh_serialize_public = */ ssh_ed25519_serialize_public,
|
| 1384 |
-
/* .ssh_deserialize_public = */ ssh_ed25519_deserialize_public,
|
| 1385 |
-
/* .ssh_serialize_private = */ ssh_ed25519_serialize_private,
|
| 1386 |
-
/* .ssh_deserialize_private = */ ssh_ed25519_deserialize_private,
|
| 1387 |
-
/* .generate = */ ssh_ed25519_generate,
|
| 1388 |
-
/* .copy_public = */ ssh_ed25519_copy_public,
|
| 1389 |
-
/* .sign = */ ssh_ed25519_sign,
|
| 1390 |
-
/* .verify = */ ssh_ed25519_verify,
|
| 1391 |
-
};
|
| 1392 |
-
```
|
| 1393 |
-
|
| 1394 |
-
```c
|
| 1395 |
-
struct sshkey_impl_funcs {
|
| 1396 |
-
u_int (*size)(const struct sshkey *); /* optional */
|
| 1397 |
-
int (*alloc)(struct sshkey *); /* optional */
|
| 1398 |
-
void (*cleanup)(struct sshkey *); /* optional */
|
| 1399 |
-
int (*equal)(const struct sshkey *, const struct sshkey *);
|
| 1400 |
-
int (*serialize_public)(const struct sshkey *, struct sshbuf *,
|
| 1401 |
-
enum sshkey_serialize_rep);
|
| 1402 |
-
int (*deserialize_public)(const char *, struct sshbuf *,
|
| 1403 |
-
struct sshkey *);
|
| 1404 |
-
int (*serialize_private)(const struct sshkey *, struct sshbuf *,
|
| 1405 |
-
enum sshkey_serialize_rep);
|
| 1406 |
-
int (*deserialize_private)(const char *, struct sshbuf *,
|
| 1407 |
-
struct sshkey *);
|
| 1408 |
-
int (*generate)(struct sshkey *, int); /* optional */
|
| 1409 |
-
int (*copy_public)(const struct sshkey *, struct sshkey *);
|
| 1410 |
-
int (*sign)(struct sshkey *, u_char **, size_t *,
|
| 1411 |
-
const u_char *, size_t, const char *,
|
| 1412 |
-
const char *, const char *, u_int); /* optional */
|
| 1413 |
-
int (*verify)(const struct sshkey *, const u_char *, size_t,
|
| 1414 |
-
const u_char *, size_t, const char *, u_int,
|
| 1415 |
-
struct sshkey_sig_details **);
|
| 1416 |
-
};
|
| 1417 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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