svn commit: r249195 - in head: cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/...
Martin Matuska
mm at FreeBSD.org
Sat Apr 6 10:39:41 UTC 2013
Author: mm
Date: Sat Apr 6 10:39:38 2013
New Revision: 249195
URL: http://svnweb.freebsd.org/changeset/base/249195
Log:
MFV r248217:
Merge change from vendor to reduce diff only.
ZFS dtrace probes are not supported on FreeBSD yet.
Illumos ZFS issues:
3598 want to dtrace when errors are generated in zfs
MFC after: 3 weeks
Added:
head/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d
- copied unchanged from r248217, vendor/illumos/dist/lib/libzpool/common/zfs.d
Modified:
head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
head/sys/cddl/compat/opensolaris/sys/sdt.h
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
head/cddl/contrib/opensolaris/ (props changed)
head/sys/cddl/contrib/opensolaris/ (props changed)
Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Sat Apr 6 10:34:02 2013 (r249194)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Sat Apr 6 10:39:38 2013 (r249195)
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
@@ -86,6 +87,9 @@ extern "C" {
#include <sys/sysevent/dev.h>
#include <machine/atomic.h>
#include <sys/debug.h>
+#ifdef illumos
+#include "zfs.h"
+#endif
#define ZFS_EXPORTS_PATH "/etc/zfs/exports"
@@ -133,28 +137,64 @@ extern int aok;
#ifdef DTRACE_PROBE
#undef DTRACE_PROBE
-#define DTRACE_PROBE(a) ((void)0)
#endif /* DTRACE_PROBE */
+#ifdef illumos
+#define DTRACE_PROBE(a) \
+ ZFS_PROBE0(#a)
+#endif
#ifdef DTRACE_PROBE1
#undef DTRACE_PROBE1
-#define DTRACE_PROBE1(a, b, c) ((void)0)
#endif /* DTRACE_PROBE1 */
+#ifdef illumos
+#define DTRACE_PROBE1(a, b, c) \
+ ZFS_PROBE1(#a, (unsigned long)c)
+#endif
#ifdef DTRACE_PROBE2
#undef DTRACE_PROBE2
-#define DTRACE_PROBE2(a, b, c, d, e) ((void)0)
#endif /* DTRACE_PROBE2 */
+#ifdef illumos
+#define DTRACE_PROBE2(a, b, c, d, e) \
+ ZFS_PROBE2(#a, (unsigned long)c, (unsigned long)e)
+#endif
#ifdef DTRACE_PROBE3
#undef DTRACE_PROBE3
-#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0)
#endif /* DTRACE_PROBE3 */
+#ifdef illumos
+#define DTRACE_PROBE3(a, b, c, d, e, f, g) \
+ ZFS_PROBE3(#a, (unsigned long)c, (unsigned long)e, (unsigned long)g)
+#endif
#ifdef DTRACE_PROBE4
#undef DTRACE_PROBE4
-#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
#endif /* DTRACE_PROBE4 */
+#ifdef illumos
+#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) \
+ ZFS_PROBE4(#a, (unsigned long)c, (unsigned long)e, (unsigned long)g, \
+ (unsigned long)i)
+#endif
+
+#ifdef illumos
+/*
+ * We use the comma operator so that this macro can be used without much
+ * additional code. For example, "return (EINVAL);" becomes
+ * "return (SET_ERROR(EINVAL));". Note that the argument will be evaluated
+ * twice, so it should not have side effects (e.g. something like:
+ * "return (SET_ERROR(log_error(EINVAL, info)));" would log the error twice).
+ */
+#define SET_ERROR(err) (ZFS_SET_ERROR(err), err)
+#else /* !illumos */
+
+#define DTRACE_PROBE(a) ((void)0)
+#define DTRACE_PROBE1(a, b, c) ((void)0)
+#define DTRACE_PROBE2(a, b, c, d, e) ((void)0)
+#define DTRACE_PROBE3(a, b, c, d, e, f, g) ((void)0)
+#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
+
+#define SET_ERROR(err) (err)
+#endif /* !illumos */
/*
* Threads
Copied: head/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d (from r248217, vendor/illumos/dist/lib/libzpool/common/zfs.d)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d Sat Apr 6 10:39:38 2013 (r249195, copy of r248217, vendor/illumos/dist/lib/libzpool/common/zfs.d)
@@ -0,0 +1,36 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ */
+
+provider zfs {
+ probe probe0(char *probename);
+ probe probe1(char *probename, unsigned long arg1);
+ probe probe2(char *probename, unsigned long arg1, unsigned long arg2);
+ probe probe3(char *probename, unsigned long arg1, unsigned long arg2,
+ unsigned long arg3);
+ probe probe4(char *probename, unsigned long arg1, unsigned long arg2,
+ unsigned long arg3, unsigned long arg4);
+
+ probe set__error(int err);
+};
+
+#pragma D attributes Evolving/Evolving/ISA provider zfs provider
+#pragma D attributes Private/Private/Unknown provider zfs module
+#pragma D attributes Private/Private/Unknown provider zfs function
+#pragma D attributes Evolving/Evolving/ISA provider zfs name
+#pragma D attributes Evolving/Evolving/ISA provider zfs args
Modified: head/sys/cddl/compat/opensolaris/sys/sdt.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/sdt.h Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/compat/opensolaris/sys/sdt.h Sat Apr 6 10:39:38 2013 (r249195)
@@ -41,6 +41,8 @@
#define DTRACE_PROBE1(name, type1, arg1)
#define DTRACE_PROBE2(name, type1, arg1, type2, arg2)
#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3)
-#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4)
+#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4)
+
+#define SET_ERROR(err) (err)
#endif /* _OPENSOLARIS_SYS_SDT_H_ */
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
/*
@@ -3738,14 +3738,14 @@ arc_memory_throttle(uint64_t reserve, ui
*/
if (curproc == pageproc) {
if (page_load > available_memory / 4)
- return (ERESTART);
+ return (SET_ERROR(ERESTART));
/* Note: reserve is inflated, so we deflate */
page_load += reserve / 8;
return (0);
} else if (page_load > 0 && arc_reclaim_needed()) {
/* memory is low, delay before restarting */
ARCSTAT_INCR(arcstat_memory_throttle_count, 1);
- return (EAGAIN);
+ return (SET_ERROR(EAGAIN));
}
page_load = 0;
@@ -3760,7 +3760,7 @@ arc_memory_throttle(uint64_t reserve, ui
if (inflight_data > available_memory / 4) {
ARCSTAT_INCR(arcstat_memory_throttle_count, 1);
- return (ERESTART);
+ return (SET_ERROR(ERESTART));
}
#endif
return (0);
@@ -3785,13 +3785,13 @@ arc_tempreserve_space(uint64_t reserve,
*/
if (spa_get_random(10000) == 0) {
dprintf("forcing random failure\n");
- return (ERESTART);
+ return (SET_ERROR(ERESTART));
}
#endif
if (reserve > arc_c/4 && !arc_no_grow)
arc_c = MIN(arc_c_max, reserve * 4);
if (reserve > arc_c)
- return (ENOMEM);
+ return (SET_ERROR(ENOMEM));
/*
* Don't count loaned bufs as in flight dirty data to prevent long
@@ -3824,7 +3824,7 @@ arc_tempreserve_space(uint64_t reserve,
arc_anon->arcs_lsize[ARC_BUFC_METADATA]>>10,
arc_anon->arcs_lsize[ARC_BUFC_DATA]>>10,
reserve>>10, arc_c>>10);
- return (ERESTART);
+ return (SET_ERROR(ERESTART));
}
atomic_add_64(&arc_tempreserve, reserve);
return (0);
@@ -4518,7 +4518,7 @@ l2arc_read_done(zio_t *zio)
if (zio->io_error != 0) {
ARCSTAT_BUMP(arcstat_l2_io_error);
} else {
- zio->io_error = EIO;
+ zio->io_error = SET_ERROR(EIO);
}
if (!equal)
ARCSTAT_BUMP(arcstat_l2_cksum_bad);
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -598,7 +598,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio
ASSERT(!refcount_is_zero(&db->db_holds));
if (db->db_state == DB_NOFILL)
- return (EIO);
+ return (SET_ERROR(EIO));
DB_DNODE_ENTER(db);
dn = DB_DNODE(db);
@@ -655,7 +655,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio
cv_wait(&db->db_changed, &db->db_mtx);
}
if (db->db_state == DB_UNCACHED)
- err = EIO;
+ err = SET_ERROR(EIO);
}
mutex_exit(&db->db_mtx);
}
@@ -1593,7 +1593,7 @@ dbuf_findbp(dnode_t *dn, int level, uint
if (level >= nlevels ||
(blkid > (dn->dn_phys->dn_maxblkid >> (level * epbs)))) {
/* the buffer has no parent yet */
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
} else if (level < nlevels-1) {
/* this block is referenced from an indirect block */
int err = dbuf_hold_impl(dn, level+1,
@@ -1844,7 +1844,7 @@ top:
err = dbuf_findbp(dn, level, blkid, fail_sparse, &parent, &bp);
if (fail_sparse) {
if (err == 0 && bp && BP_IS_HOLE(bp))
- err = ENOENT;
+ err = SET_ERROR(ENOENT);
if (err) {
if (parent)
dbuf_rele(parent, NULL);
@@ -1941,7 +1941,7 @@ dbuf_spill_set_blksz(dmu_buf_t *db_fake,
dnode_t *dn;
if (db->db_blkid != DMU_SPILL_BLKID)
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
if (blksz == 0)
blksz = SPA_MINBLOCKSIZE;
if (blksz > SPA_MAXBLOCKSIZE)
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -174,7 +174,7 @@ ddt_object_lookup(ddt_t *ddt, enum ddt_t
ddt_entry_t *dde)
{
if (!ddt_object_exists(ddt, type, class))
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
return (ddt_ops[type]->ddt_op_lookup(ddt->ddt_os,
ddt->ddt_object[type][class], dde));
@@ -235,7 +235,7 @@ ddt_object_info(ddt_t *ddt, enum ddt_typ
dmu_object_info_t *doi)
{
if (!ddt_object_exists(ddt, type, class))
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
return (dmu_object_info(ddt->ddt_os, ddt->ddt_object[type][class],
doi));
@@ -1157,5 +1157,5 @@ ddt_walk(spa_t *spa, ddt_bookmark_t *ddb
ddb->ddb_type = 0;
} while (++ddb->ddb_class < DDT_CLASSES);
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
}
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#include <sys/dmu.h>
@@ -146,7 +146,7 @@ dmu_buf_hold(objset_t *os, uint64_t obje
db = dbuf_hold(dn, blkid, tag);
rw_exit(&dn->dn_struct_rwlock);
if (db == NULL) {
- err = EIO;
+ err = SET_ERROR(EIO);
} else {
err = dbuf_read(db, NULL, db_flags);
if (err) {
@@ -177,9 +177,9 @@ dmu_set_bonus(dmu_buf_t *db_fake, int ne
dn = DB_DNODE(db);
if (dn->dn_bonus != db) {
- error = EINVAL;
+ error = SET_ERROR(EINVAL);
} else if (newsize < 0 || newsize > db_fake->db_size) {
- error = EINVAL;
+ error = SET_ERROR(EINVAL);
} else {
dnode_setbonuslen(dn, newsize, tx);
error = 0;
@@ -200,9 +200,9 @@ dmu_set_bonustype(dmu_buf_t *db_fake, dm
dn = DB_DNODE(db);
if (!DMU_OT_IS_VALID(type)) {
- error = EINVAL;
+ error = SET_ERROR(EINVAL);
} else if (dn->dn_bonus != db) {
- error = EINVAL;
+ error = SET_ERROR(EINVAL);
} else {
dnode_setbonus_type(dn, type, tx);
error = 0;
@@ -329,12 +329,12 @@ dmu_spill_hold_existing(dmu_buf_t *bonus
dn = DB_DNODE(db);
if (spa_version(dn->dn_objset->os_spa) < SPA_VERSION_SA) {
- err = EINVAL;
+ err = SET_ERROR(EINVAL);
} else {
rw_enter(&dn->dn_struct_rwlock, RW_READER);
if (!dn->dn_have_spill) {
- err = ENOENT;
+ err = SET_ERROR(ENOENT);
} else {
err = dmu_spill_hold_by_dnode(dn,
DB_RF_HAVESTRUCT | DB_RF_CANFAIL, tag, dbp);
@@ -400,7 +400,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
(longlong_t)dn->dn_object, dn->dn_datablksz,
(longlong_t)offset, (longlong_t)length);
rw_exit(&dn->dn_struct_rwlock);
- return (EIO);
+ return (SET_ERROR(EIO));
}
nblks = 1;
}
@@ -417,7 +417,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
rw_exit(&dn->dn_struct_rwlock);
dmu_buf_rele_array(dbp, nblks, tag);
zio_nowait(zio);
- return (EIO);
+ return (SET_ERROR(EIO));
}
/* initiate async i/o */
if (read)
@@ -449,7 +449,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn,
db->db_state == DB_FILL)
cv_wait(&db->db_changed, &db->db_mtx);
if (db->db_state == DB_UNCACHED)
- err = EIO;
+ err = SET_ERROR(EIO);
mutex_exit(&db->db_mtx);
if (err) {
dmu_buf_rele_array(dbp, nblks, tag);
@@ -1363,7 +1363,8 @@ dmu_sync_late_arrival(zio_t *pio, objset
dmu_tx_hold_space(tx, zgd->zgd_db->db_size);
if (dmu_tx_assign(tx, TXG_WAIT) != 0) {
dmu_tx_abort(tx);
- return (EIO); /* Make zl_get_data do txg_waited_synced() */
+ /* Make zl_get_data do txg_waited_synced() */
+ return (SET_ERROR(EIO));
}
dsa = kmem_alloc(sizeof (dmu_sync_arg_t), KM_SLEEP);
@@ -1448,7 +1449,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s
* This txg has already synced. There's nothing to do.
*/
mutex_exit(&db->db_mtx);
- return (EEXIST);
+ return (SET_ERROR(EEXIST));
}
if (txg <= spa_syncing_txg(os->os_spa)) {
@@ -1470,7 +1471,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s
* There's no need to log writes to freed blocks, so we're done.
*/
mutex_exit(&db->db_mtx);
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
}
ASSERT(dr->dr_next == NULL || dr->dr_next->dr_txg < txg);
@@ -1499,7 +1500,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s
* have been dirtied since, or we would have cleared the state.
*/
mutex_exit(&db->db_mtx);
- return (EALREADY);
+ return (SET_ERROR(EALREADY));
}
ASSERT(dr->dt.dl.dr_override_state == DR_NOT_OVERRIDDEN);
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#include <sys/dmu.h>
@@ -136,7 +136,7 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons
int err = 0;
if (issig(JUSTLOOKING) && issig(FORREAL))
- return (EINTR);
+ return (SET_ERROR(EINTR));
if (zb->zb_object != DMU_META_DNODE_OBJECT)
return (0);
@@ -159,7 +159,7 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
&aflags, zb) != 0)
- return (EIO);
+ return (SET_ERROR(EIO));
blk = abuf->b_data;
for (i = 0; i < blksz >> DNODE_SHIFT; i++) {
@@ -195,7 +195,7 @@ dmu_diff(const char *tosnap_name, const
if (strchr(tosnap_name, '@') == NULL ||
strchr(fromsnap_name, '@') == NULL)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
error = dsl_pool_hold(tosnap_name, FTAG, &dp);
if (error != 0)
@@ -218,7 +218,7 @@ dmu_diff(const char *tosnap_name, const
dsl_dataset_rele(fromsnap, FTAG);
dsl_dataset_rele(tosnap, FTAG);
dsl_pool_rele(dp, FTAG);
- return (EXDEV);
+ return (SET_ERROR(EXDEV));
}
fromtxg = fromsnap->ds_phys->ds_creation_txg;
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#include <sys/dmu.h>
@@ -90,7 +91,7 @@ dmu_object_claim(objset_t *os, uint64_t
int err;
if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx))
- return (EBADF);
+ return (SET_ERROR(EBADF));
err = dnode_hold_impl(os, object, DNODE_MUST_BE_FREE, FTAG, &dn);
if (err)
@@ -112,7 +113,7 @@ dmu_object_reclaim(objset_t *os, uint64_
int err;
if (object == DMU_META_DNODE_OBJECT)
- return (EBADF);
+ return (SET_ERROR(EBADF));
err = dnode_hold_impl(os, object, DNODE_MUST_BE_ALLOCATED,
FTAG, &dn);
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -285,7 +285,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat
kmem_free(os, sizeof (objset_t));
/* convert checksum errors into IO errors */
if (err == ECKSUM)
- err = EIO;
+ err = SET_ERROR(EIO);
return (err);
}
@@ -498,10 +498,10 @@ dmu_objset_own(const char *name, dmu_obj
dsl_dataset_disown(ds, tag);
} else if (type != DMU_OST_ANY && type != (*osp)->os_phys->os_type) {
dsl_dataset_disown(ds, tag);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
} else if (!readonly && dsl_dataset_is_snapshot(ds)) {
dsl_dataset_disown(ds, tag);
- return (EROFS);
+ return (SET_ERROR(EROFS));
}
return (err);
}
@@ -714,14 +714,14 @@ dmu_objset_create_check(void *arg, dmu_t
int error;
if (strchr(doca->doca_name, '@') != NULL)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
error = dsl_dir_hold(dp, doca->doca_name, FTAG, &pdd, &tail);
if (error != 0)
return (error);
if (tail == NULL) {
dsl_dir_rele(pdd, FTAG);
- return (EEXIST);
+ return (SET_ERROR(EEXIST));
}
dsl_dir_rele(pdd, FTAG);
@@ -795,19 +795,19 @@ dmu_objset_clone_check(void *arg, dmu_tx
dsl_pool_t *dp = dmu_tx_pool(tx);
if (strchr(doca->doca_clone, '@') != NULL)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
error = dsl_dir_hold(dp, doca->doca_clone, FTAG, &pdd, &tail);
if (error != 0)
return (error);
if (tail == NULL) {
dsl_dir_rele(pdd, FTAG);
- return (EEXIST);
+ return (SET_ERROR(EEXIST));
}
/* You can't clone across pools. */
if (pdd->dd_pool != dp) {
dsl_dir_rele(pdd, FTAG);
- return (EXDEV);
+ return (SET_ERROR(EXDEV));
}
dsl_dir_rele(pdd, FTAG);
@@ -818,13 +818,13 @@ dmu_objset_clone_check(void *arg, dmu_tx
/* You can't clone across pools. */
if (origin->ds_dir->dd_pool != dp) {
dsl_dataset_rele(origin, FTAG);
- return (EXDEV);
+ return (SET_ERROR(EXDEV));
}
/* You can only clone snapshots, not the head datasets. */
if (!dsl_dataset_is_snapshot(origin)) {
dsl_dataset_rele(origin, FTAG);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
dsl_dataset_rele(origin, FTAG);
@@ -1302,9 +1302,9 @@ dmu_objset_userspace_upgrade(objset_t *o
if (dmu_objset_userspace_present(os))
return (0);
if (!dmu_objset_userused_enabled(os))
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
if (dmu_objset_is_snapshot(os))
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
/*
* We simply need to mark every object dirty, so that it will be
@@ -1320,7 +1320,7 @@ dmu_objset_userspace_upgrade(objset_t *o
int objerr;
if (issig(JUSTLOOKING) && issig(FORREAL))
- return (EINTR);
+ return (SET_ERROR(EINTR));
objerr = dmu_bonus_hold(os, obj, FTAG, &db);
if (objerr != 0)
@@ -1396,7 +1396,7 @@ dmu_snapshot_realname(objset_t *os, char
uint64_t ignored;
if (ds->ds_phys->ds_snapnames_zapobj == 0)
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
return (zap_lookup_norm(ds->ds_dir->dd_pool->dp_meta_objset,
ds->ds_phys->ds_snapnames_zapobj, name, 8, 1, &ignored, MT_FIRST,
@@ -1414,7 +1414,7 @@ dmu_snapshot_list_next(objset_t *os, int
ASSERT(dsl_pool_config_held(dmu_objset_pool(os)));
if (ds->ds_phys->ds_snapnames_zapobj == 0)
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
zap_cursor_init_serialized(&cursor,
ds->ds_dir->dd_pool->dp_meta_objset,
@@ -1422,12 +1422,12 @@ dmu_snapshot_list_next(objset_t *os, int
if (zap_cursor_retrieve(&cursor, &attr) != 0) {
zap_cursor_fini(&cursor);
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
}
if (strlen(attr.za_name) + 1 > namelen) {
zap_cursor_fini(&cursor);
- return (ENAMETOOLONG);
+ return (SET_ERROR(ENAMETOOLONG));
}
(void) strcpy(name, attr.za_name);
@@ -1453,7 +1453,7 @@ dmu_dir_list_next(objset_t *os, int name
/* there is no next dir on a snapshot! */
if (os->os_dsl_dataset->ds_object !=
dd->dd_phys->dd_head_dataset_obj)
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
zap_cursor_init_serialized(&cursor,
dd->dd_pool->dp_meta_objset,
@@ -1461,12 +1461,12 @@ dmu_dir_list_next(objset_t *os, int name
if (zap_cursor_retrieve(&cursor, &attr) != 0) {
zap_cursor_fini(&cursor);
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
}
if (strlen(attr.za_name) + 1 > namelen) {
zap_cursor_fini(&cursor);
- return (ENAMETOOLONG);
+ return (SET_ERROR(ENAMETOOLONG));
}
(void) strcpy(name, attr.za_name);
@@ -1733,9 +1733,9 @@ dmu_fsname(const char *snapname, char *b
{
char *atp = strchr(snapname, '@');
if (atp == NULL)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
if (atp - snapname >= MAXNAMELEN)
- return (ENAMETOOLONG);
+ return (SET_ERROR(ENAMETOOLONG));
(void) strlcpy(buf, snapname, atp - snapname + 1);
return (0);
}
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Apr 6 10:34:02 2013 (r249194)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sat Apr 6 10:39:38 2013 (r249195)
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
* Copyright (c) 2012, Martin Matuska <mm at FreeBSD.org>. All rights reserved.
*/
@@ -110,7 +110,7 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o
dsp->dsa_pending_op != PENDING_FREE) {
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
@@ -134,7 +134,7 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o
/* not a continuation. Push out pending record */
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
}
@@ -148,7 +148,7 @@ dump_free(dmu_sendarg_t *dsp, uint64_t o
if (length == -1ULL) {
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
} else {
dsp->dsa_pending_op = PENDING_FREE;
}
@@ -172,7 +172,7 @@ dump_data(dmu_sendarg_t *dsp, dmu_object
if (dsp->dsa_pending_op != PENDING_NONE) {
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
/* write a DATA record */
@@ -192,9 +192,9 @@ dump_data(dmu_sendarg_t *dsp, dmu_object
drrw->drr_key.ddk_cksum = bp->blk_cksum;
if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
if (dump_bytes(dsp, data, blksz) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
return (0);
}
@@ -206,7 +206,7 @@ dump_spill(dmu_sendarg_t *dsp, uint64_t
if (dsp->dsa_pending_op != PENDING_NONE) {
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
@@ -218,9 +218,9 @@ dump_spill(dmu_sendarg_t *dsp, uint64_t
drrs->drr_toguid = dsp->dsa_toguid;
if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)))
- return (EINTR);
+ return (SET_ERROR(EINTR));
if (dump_bytes(dsp, data, blksz))
- return (EINTR);
+ return (SET_ERROR(EINTR));
return (0);
}
@@ -240,7 +240,7 @@ dump_freeobjects(dmu_sendarg_t *dsp, uin
dsp->dsa_pending_op != PENDING_FREEOBJECTS) {
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
if (dsp->dsa_pending_op == PENDING_FREEOBJECTS) {
@@ -255,7 +255,7 @@ dump_freeobjects(dmu_sendarg_t *dsp, uin
/* can't be aggregated. Push out pending record */
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
}
@@ -283,7 +283,7 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t
if (dsp->dsa_pending_op != PENDING_NONE) {
if (dump_bytes(dsp, dsp->dsa_drr,
sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
dsp->dsa_pending_op = PENDING_NONE;
}
@@ -300,17 +300,17 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t
drro->drr_toguid = dsp->dsa_toguid;
if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
if (dump_bytes(dsp, DN_BONUS(dnp), P2ROUNDUP(dnp->dn_bonuslen, 8)) != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
/* free anything past the end of the file */
if (dump_free(dsp, object, (dnp->dn_maxblkid + 1) *
(dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT), -1ULL))
- return (EINTR);
+ return (SET_ERROR(EINTR));
if (dsp->dsa_err != 0)
- return (EINTR);
+ return (SET_ERROR(EINTR));
return (0);
}
@@ -328,7 +328,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
int err = 0;
if (issig(JUSTLOOKING) && issig(FORREAL))
- return (EINTR);
+ return (SET_ERROR(EINTR));
if (zb->zb_object != DMU_META_DNODE_OBJECT &&
DMU_OBJECT_IS_SPECIAL(zb->zb_object)) {
@@ -352,7 +352,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
&aflags, zb) != 0)
- return (EIO);
+ return (SET_ERROR(EIO));
blk = abuf->b_data;
for (i = 0; i < blksz >> DNODE_SHIFT; i++) {
@@ -371,7 +371,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
if (arc_read(NULL, spa, bp, arc_getbuf_func, &abuf,
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL,
&aflags, zb) != 0)
- return (EIO);
+ return (SET_ERROR(EIO));
err = dump_spill(dsp, zb->zb_object, blksz, abuf->b_data);
(void) arc_buf_remove_ref(abuf, &abuf);
@@ -393,7 +393,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co
ptr++)
*ptr = 0x2f5baddb10c;
} else {
- return (EIO);
+ return (SET_ERROR(EIO));
}
}
@@ -427,7 +427,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp,
dsl_dataset_rele(fromds, tag);
dsl_dataset_rele(ds, tag);
dsl_pool_rele(dp, tag);
- return (EXDEV);
+ return (SET_ERROR(EXDEV));
}
err = dmu_objset_from_ds(ds, &os);
@@ -454,7 +454,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp,
dsl_dataset_rele(fromds, tag);
dsl_dataset_rele(ds, tag);
dsl_pool_rele(dp, tag);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
if (version >= ZPL_VERSION_SA) {
DMU_SET_FEATUREFLAGS(
@@ -513,7 +513,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp,
if (dsp->dsa_pending_op != PENDING_NONE)
if (dump_bytes(dsp, drr, sizeof (dmu_replay_record_t)) != 0)
- err = EINTR;
+ err = SET_ERROR(EINTR);
if (err != 0) {
if (err == EINTR && dsp->dsa_err != 0)
@@ -594,9 +594,9 @@ dmu_send(const char *tosnap, const char
int err;
if (strchr(tosnap, '@') == NULL)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
if (fromsnap != NULL && strchr(fromsnap, '@') == NULL)
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
err = dsl_pool_hold(tosnap, FTAG, &dp);
if (err != 0)
@@ -630,14 +630,14 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl
/* tosnap must be a snapshot */
if (!dsl_dataset_is_snapshot(ds))
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
/*
* fromsnap must be an earlier snapshot from the same fs as tosnap,
* or the origin's fs.
*/
if (fromds != NULL && !dsl_dataset_is_before(ds, fromds))
- return (EXDEV);
+ return (SET_ERROR(EXDEV));
/* Get uncompressed size estimate of changed data. */
if (fromds == NULL) {
@@ -696,7 +696,7 @@ recv_begin_check_existing_impl(dmu_recv_
/* must not have any changes since most recent snapshot */
if (!drba->drba_cookie->drc_force &&
dsl_dataset_modified_since_lastsnap(ds))
- return (ETXTBSY);
+ return (SET_ERROR(ETXTBSY));
/* temporary clone name must not exist */
error = zap_lookup(dp->dp_meta_objset,
@@ -715,7 +715,7 @@ recv_begin_check_existing_impl(dmu_recv_
if (fromguid != 0) {
/* if incremental, most recent snapshot must match fromguid */
if (ds->ds_prev == NULL)
- return (ENODEV);
+ return (SET_ERROR(ENODEV));
/*
* most recent snapshot must match fromguid, or there are no
@@ -729,10 +729,10 @@ recv_begin_check_existing_impl(dmu_recv_
error = dsl_dataset_hold_obj(dp, obj, FTAG,
&snap);
if (error != 0)
- return (ENODEV);
+ return (SET_ERROR(ENODEV));
if (snap->ds_phys->ds_creation_txg < birth) {
dsl_dataset_rele(snap, FTAG);
- return (ENODEV);
+ return (SET_ERROR(ENODEV));
}
if (snap->ds_phys->ds_guid == fromguid) {
dsl_dataset_rele(snap, FTAG);
@@ -742,12 +742,12 @@ recv_begin_check_existing_impl(dmu_recv_
dsl_dataset_rele(snap, FTAG);
}
if (obj == 0)
- return (ENODEV);
+ return (SET_ERROR(ENODEV));
}
} else {
/* if full, most recent snapshot must be $ORIGIN */
if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL)
- return (ENODEV);
+ return (SET_ERROR(ENODEV));
}
return (0);
@@ -773,13 +773,13 @@ dmu_recv_begin_check(void *arg, dmu_tx_t
DMU_COMPOUNDSTREAM ||
drrb->drr_type >= DMU_OST_NUMTYPES ||
((flags & DRR_FLAG_CLONE) && drba->drba_origin == NULL))
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
/* Verify pool version supports SA if SA_SPILL feature set */
if ((DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
DMU_BACKUP_FEATURE_SA_SPILL) &&
spa_version(dp->dp_spa) < SPA_VERSION_SA) {
- return (ENOTSUP);
+ return (SET_ERROR(ENOTSUP));
}
error = dsl_dataset_hold(dp, tofs, FTAG, &ds);
@@ -789,7 +789,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t
/* Can't recv a clone into an existing fs */
if (flags & DRR_FLAG_CLONE) {
dsl_dataset_rele(ds, FTAG);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
error = recv_begin_check_existing_impl(drba, ds, fromguid);
@@ -803,7 +803,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t
* target fs, so fail the recv.
*/
if (fromguid != 0 && !(flags & DRR_FLAG_CLONE))
- return (ENOENT);
+ return (SET_ERROR(ENOENT));
/* Open the parent of tofs */
ASSERT3U(strlen(tofs), <, MAXNAMELEN);
@@ -823,12 +823,12 @@ dmu_recv_begin_check(void *arg, dmu_tx_t
if (!dsl_dataset_is_snapshot(origin)) {
dsl_dataset_rele(origin, FTAG);
dsl_dataset_rele(ds, FTAG);
- return (EINVAL);
+ return (SET_ERROR(EINVAL));
}
if (origin->ds_phys->ds_guid != fromguid) {
dsl_dataset_rele(origin, FTAG);
dsl_dataset_rele(ds, FTAG);
- return (ENODEV);
+ return (SET_ERROR(ENODEV));
}
dsl_dataset_rele(origin, FTAG);
}
@@ -919,7 +919,7 @@ dmu_recv_begin(char *tofs, char *tosnap,
if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC))
drc->drc_byteswap = B_TRUE;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list