Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int
- nvs_operation(nvstream_t *nvs, nvlist_t *nvl, size_t *buflen)
- {
- int err;
- if (nvl->nvl_priv == 0)
- return (EFAULT);
- /*
- * Perform the operation, starting with header, then each nvpair
- */
- if ((err = nvs->nvs_ops->nvs_nvlist(nvs, nvl, buflen)) != 0)
- return (err);
- switch (nvs->nvs_op) {
- case NVS_OP_ENCODE:
- err = nvs_encode_pairs(nvs, nvl);
- break;
- case NVS_OP_DECODE:
- err = nvs_decode_pairs(nvs, nvl);
- break;
- case NVS_OP_GETSIZE:
- err = nvs_getsize_pairs(nvs, nvl, buflen);
- break;
- default:
- err = EINVAL;
- }
- return (err);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement