From 76052e446ca1d24dde809c0c55039170bf6bd0ff Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 11 Mar 2009 14:39:10 -0700 Subject: [PATCH] Revert 'linux-have-xdr' topic branch patch. This is not needed anymore since a proper XDR implementation was added to the SPL as of version spl-0.4.3. --- lib/libzfs/libzfs_sendrecv.c | 5 ----- module/nvpair/include/sys/nvpair.h | 2 -- module/nvpair/nvpair.c | 8 -------- module/zfs/spa.c | 10 +++------- module/zfs/spa_config.c | 9 +++------ module/zfs/spa_history.c | 8 -------- module/zfs/vdev_label.c | 8 -------- module/zfs/zfs_fuid.c | 8 ++------ 8 files changed, 8 insertions(+), 50 deletions(-) diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 98a38b5624..9598133bf1 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -729,13 +729,8 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap, if (err) return (err); VERIFY(0 == nvlist_add_nvlist(hdrnv, "fss", fss)); -#if defined(HAVE_XDR) err = nvlist_pack(hdrnv, &packbuf, &buflen, NV_ENCODE_XDR, 0); -#else - err = nvlist_pack(hdrnv, &packbuf, &buflen, - NV_ENCODE_NATIVE, 0); -#endif /* HAVE_XDR */ nvlist_free(hdrnv); if (err) { fsavl_destroy(fsavl); diff --git a/module/nvpair/include/sys/nvpair.h b/module/nvpair/include/sys/nvpair.h index 8928fa2bbb..14a45956f6 100644 --- a/module/nvpair/include/sys/nvpair.h +++ b/module/nvpair/include/sys/nvpair.h @@ -100,9 +100,7 @@ typedef struct nvlist { /* nvlist pack encoding */ #define NV_ENCODE_NATIVE 0 -#if defined(HAVE_XDR) #define NV_ENCODE_XDR 1 -#endif /* nvlist persistent unique name flags, stored in nvl_nvflags */ #define NV_UNIQUE_NAME 0x1 diff --git a/module/nvpair/nvpair.c b/module/nvpair/nvpair.c index a19764285e..a52b7dd7d2 100644 --- a/module/nvpair/nvpair.c +++ b/module/nvpair/nvpair.c @@ -33,9 +33,7 @@ #include #include #include -#ifdef HAVE_XDR #include -#endif /* HAVE_XDR */ #if defined(_KERNEL) && !defined(_BOOT) #include @@ -2193,9 +2191,7 @@ nvs_embedded_nvl_array(nvstream_t *nvs, nvpair_t *nvp, size_t *size) } static int nvs_native(nvstream_t *, nvlist_t *, char *, size_t *); -#if defined(HAVE_XDR) static int nvs_xdr(nvstream_t *, nvlist_t *, char *, size_t *); -#endif /* HAVE_XDR */ /* * Common routine for nvlist operations: @@ -2272,11 +2268,9 @@ nvlist_common(nvlist_t *nvl, char *buf, size_t *buflen, int encoding, return (ENOTSUP); err = nvs_native(&nvs, nvl, buf, buflen); break; -#if defined(HAVE_XDR) case NV_ENCODE_XDR: err = nvs_xdr(&nvs, nvl, buf, buflen); break; -#endif /* HAVE_XDR */ default: err = ENOTSUP; break; @@ -2764,7 +2758,6 @@ nvs_native(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen) return (err); } -#if defined(HAVE_XDR) /* * XDR encoding functions * @@ -3251,7 +3244,6 @@ nvs_xdr(nvstream_t *nvs, nvlist_t *nvl, char *buf, size_t *buflen) return (err); } -#endif /* HAVE_XDR */ #if defined(_KERNEL) && defined(HAVE_SPL) static int __init nvpair_init(void) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index b9270dd65f..ff380562e3 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -3764,14 +3764,9 @@ spa_sync_nvlist(spa_t *spa, uint64_t obj, nvlist_t *nv, dmu_tx_t *tx) char *packed = NULL; size_t bufsize; size_t nvsize = 0; - int nv_encode = NV_ENCODE_NATIVE; dmu_buf_t *db; -#if defined(HAVE_XDR) - nv_encode = NV_ENCODE_XDR; -#endif - - VERIFY(nvlist_size(nv, &nvsize, nv_encode) == 0); + VERIFY(nvlist_size(nv, &nvsize, NV_ENCODE_XDR) == 0); /* * Write full (SPA_CONFIG_BLOCKSIZE) blocks of configuration @@ -3781,7 +3776,8 @@ spa_sync_nvlist(spa_t *spa, uint64_t obj, nvlist_t *nv, dmu_tx_t *tx) bufsize = P2ROUNDUP(nvsize, SPA_CONFIG_BLOCKSIZE); packed = kmem_alloc(bufsize, KM_SLEEP); - VERIFY(nvlist_pack(nv, &packed, &nvsize, nv_encode, KM_SLEEP) == 0); + VERIFY(nvlist_pack(nv, &packed, &nvsize, NV_ENCODE_XDR, + KM_SLEEP) == 0); bzero(packed + nvsize, bufsize - nvsize); dmu_write(spa->spa_meta_objset, obj, 0, bufsize, packed, tx); diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index ea03d25f14..c2f2067d45 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -153,7 +153,6 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) char *buf; vnode_t *vp; int oflags = FWRITE | FTRUNC | FCREAT | FOFFMAX; - int nv_encode = NV_ENCODE_NATIVE; char *temp; /* @@ -167,15 +166,13 @@ spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) /* * Pack the configuration into a buffer. */ -#if defined(HAVE_XDR) - nv_encode = NV_ENCODE_XDR; -#endif - VERIFY(nvlist_size(nvl, &buflen, nv_encode) == 0); + VERIFY(nvlist_size(nvl, &buflen, NV_ENCODE_XDR) == 0); buf = kmem_alloc(buflen, KM_SLEEP); temp = kmem_zalloc(MAXPATHLEN, KM_SLEEP); - VERIFY(nvlist_pack(nvl, &buf, &buflen, nv_encode, KM_SLEEP) == 0); + VERIFY(nvlist_pack(nvl, &buf, &buflen, NV_ENCODE_XDR, + KM_SLEEP) == 0); /* * Write the configuration to disk. We need to do the traditional diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c index 7552b8a9f7..d650a73724 100644 --- a/module/zfs/spa_history.c +++ b/module/zfs/spa_history.c @@ -258,19 +258,11 @@ spa_history_log_sync(void *arg1, void *arg2, cred_t *cr, dmu_tx_t *tx) history_str) == 0); } -#if defined(HAVE_XDR) VERIFY(nvlist_size(nvrecord, &reclen, NV_ENCODE_XDR) == 0); record_packed = kmem_alloc(reclen, KM_SLEEP); VERIFY(nvlist_pack(nvrecord, &record_packed, &reclen, NV_ENCODE_XDR, KM_SLEEP) == 0); -#else - VERIFY(nvlist_size(nvrecord, &reclen, NV_ENCODE_NATIVE) == 0); - record_packed = kmem_alloc(reclen, KM_SLEEP); - - VERIFY(nvlist_pack(nvrecord, &record_packed, &reclen, - NV_ENCODE_NATIVE, KM_SLEEP) == 0); -#endif mutex_enter(&spa->spa_history_lock); if (hap->ha_log_type == LOG_CMD_POOL_CREATE) diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c index a6f8963304..4d4c8ba952 100644 --- a/module/zfs/vdev_label.c +++ b/module/zfs/vdev_label.c @@ -625,11 +625,7 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_labeltype_t reason) buf = vp->vp_nvlist; buflen = sizeof (vp->vp_nvlist); -#ifdef HAVE_XDR error = nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP); -#else - error = nvlist_pack(label, &buf, &buflen, NV_ENCODE_NATIVE, KM_SLEEP); -#endif if (error != 0) { nvlist_free(label); zio_buf_free(vp, sizeof (vdev_phys_t)); @@ -942,11 +938,7 @@ vdev_label_sync(zio_t *zio, vdev_t *vd, int l, uint64_t txg, int flags) buf = vp->vp_nvlist; buflen = sizeof (vp->vp_nvlist); -#ifdef HAVE_XDR if (nvlist_pack(label, &buf, &buflen, NV_ENCODE_XDR, KM_SLEEP) == 0) { -#else - if (nvlist_pack(label, &buf, &buflen, NV_ENCODE_NATIVE, KM_SLEEP) == 0) { -#endif for (; l < VDEV_LABELS; l += 2) { vdev_label_write(zio, vd, l, vp, offsetof(vdev_label_t, vl_vdev_phys), diff --git a/module/zfs/zfs_fuid.c b/module/zfs/zfs_fuid.c index 4762eb9332..ce2bc93030 100644 --- a/module/zfs/zfs_fuid.c +++ b/module/zfs/zfs_fuid.c @@ -274,7 +274,6 @@ retry: char *packed; dmu_buf_t *db; int i = 0; - int nv_encode = NV_ENCODE_NATIVE; if (rw == RW_READER && !rw_tryupgrade(&zfsvfs->z_fuid_lock)) { rw_exit(&zfsvfs->z_fuid_lock); @@ -312,13 +311,10 @@ retry: for (i = 0; i != retidx; i++) nvlist_free(fuids[i]); kmem_free(fuids, retidx * sizeof (void *)); -#ifdef HAVE_XDR - nv_encode = NV_ENCODE_XDR; -#endif - VERIFY(nvlist_size(nvp, &nvsize, nv_encode) == 0); + VERIFY(nvlist_size(nvp, &nvsize, NV_ENCODE_XDR) == 0); packed = kmem_alloc(nvsize, KM_SLEEP); VERIFY(nvlist_pack(nvp, &packed, &nvsize, - nv_encode, KM_SLEEP) == 0); + NV_ENCODE_XDR, KM_SLEEP) == 0); nvlist_free(nvp); zfsvfs->z_fuid_size = nvsize; dmu_write(zfsvfs->z_os, zfsvfs->z_fuid_obj, 0,