Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: stable/9/sys/boot/zfs/zfsimpl.c 242241 2012-10-28 16:10:03Z avg $");
---
> __FBSDID("$FreeBSD: stable/9/sys/boot/zfs/zfsimpl.c 243674 2012-11-29 14:05:04Z mm $");
51a52,58
> /*
> * List of ZFS features supported for read
> */
> static const char *features_for_read[] = {
> NULL
> };
>
202a210,260
> static int
> nvlist_check_features_for_read(const unsigned char *nvlist)
> {
> const unsigned char *p, *pair;
> int junk;
> int encoded_size, decoded_size;
> int rc;
>
> rc = 0;
>
> p = nvlist;
> xdr_int(&p, &junk);
> xdr_int(&p, &junk);
>
> pair = p;
> xdr_int(&p, &encoded_size);
> xdr_int(&p, &decoded_size);
> while (encoded_size && decoded_size) {
> int namelen, pairtype;
> const char *pairname;
> int i, found;
>
> found = 0;
>
> xdr_int(&p, &namelen);
> pairname = (const char*) p;
> p += roundup(namelen, 4);
> xdr_int(&p, &pairtype);
>
> for (i = 0; features_for_read[i] != NULL; i++) {
> if (!memcmp(pairname, features_for_read[i], namelen)) {
> found = 1;
> break;
> }
> }
>
> if (!found) {
> printf("ZFS: unsupported feature: %s\n", pairname);
> rc = EIO;
> }
>
> p = pair + encoded_size;
>
> pair = p;
> xdr_int(&p, &encoded_size);
> xdr_int(&p, &decoded_size);
> }
>
> return (rc);
> }
>
829a888
> const unsigned char *features;
864c923
< if (val > SPA_VERSION) {
---
> if (!SPA_VERSION_IS_SUPPORTED(val)) {
869a929
> /* Check ZFS features for read */
870a931,936
> ZPOOL_CONFIG_FEATURES_FOR_READ,
> DATA_TYPE_NVLIST, 0, &features) == 0
> && nvlist_check_features_for_read(features) != 0)
> return (EIO);
>
> if (nvlist_find(nvlist,