diff options
author | mm <mm@FreeBSD.org> | 2013-04-06 10:39:38 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-04-06 10:39:38 +0000 |
commit | 696d961cbd8bcba286545fef03c51a896b56d229 (patch) | |
tree | 557b6db8b3be2ff65382b43d2ae9edd99d502a44 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c | |
parent | f25063da0770fd0a9b4ed6ffdd6687e7de116255 (diff) | |
parent | 70e6431e93f13270d6907ce23de3c7da99803278 (diff) | |
download | FreeBSD-src-696d961cbd8bcba286545fef03c51a896b56d229.zip FreeBSD-src-696d961cbd8bcba286545fef03c51a896b56d229.tar.gz |
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
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c index 85f9e5b..9aefdd9 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c @@ -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/zfs_context.h> @@ -1036,12 +1036,12 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, dn = (object == DMU_USERUSED_OBJECT) ? DMU_USERUSED_DNODE(os) : DMU_GROUPUSED_DNODE(os); if (dn == NULL) - return (ENOENT); + return (SET_ERROR(ENOENT)); type = dn->dn_type; if ((flag & DNODE_MUST_BE_ALLOCATED) && type == DMU_OT_NONE) - return (ENOENT); + return (SET_ERROR(ENOENT)); if ((flag & DNODE_MUST_BE_FREE) && type != DMU_OT_NONE) - return (EEXIST); + return (SET_ERROR(EEXIST)); DNODE_VERIFY(dn); (void) refcount_add(&dn->dn_holds, tag); *dnp = dn; @@ -1049,7 +1049,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, } if (object == 0 || object >= DN_MAX_OBJECT) - return (EINVAL); + return (SET_ERROR(EINVAL)); mdn = DMU_META_DNODE(os); ASSERT(mdn->dn_object == DMU_META_DNODE_OBJECT); @@ -1067,7 +1067,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, if (drop_struct_lock) rw_exit(&mdn->dn_struct_rwlock); if (db == NULL) - return (EIO); + return (SET_ERROR(EIO)); err = dbuf_read(db, NULL, DB_RF_CANFAIL); if (err) { dbuf_rele(db, FTAG); @@ -1375,7 +1375,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx) fail: rw_exit(&dn->dn_struct_rwlock); - return (ENOTSUP); + return (SET_ERROR(ENOTSUP)); } /* read-holding callers must not rely on the lock being continuously held */ @@ -1861,7 +1861,7 @@ dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, * at the pointer to this block in its parent, and its * going to be unallocated, so we will skip over it. */ - return (ESRCH); + return (SET_ERROR(ESRCH)); } error = dbuf_read(db, NULL, DB_RF_CANFAIL | DB_RF_HAVESTRUCT); if (error) { @@ -1877,7 +1877,7 @@ dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, * This can only happen when we are searching up the tree * and these conditions mean that we need to keep climbing. */ - error = ESRCH; + error = SET_ERROR(ESRCH); } else if (lvl == 0) { dnode_phys_t *dnp = data; span = DNODE_SHIFT; @@ -1890,7 +1890,7 @@ dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, *offset += (1ULL << span) * inc; } if (i < 0 || i == blkfill) - error = ESRCH; + error = SET_ERROR(ESRCH); } else { blkptr_t *bp = data; uint64_t start = *offset; @@ -1922,7 +1922,7 @@ dnode_next_offset_level(dnode_t *dn, int flags, uint64_t *offset, *offset = start; } if (i < 0 || i >= epb) - error = ESRCH; + error = SET_ERROR(ESRCH); } if (db) @@ -1966,7 +1966,7 @@ dnode_next_offset(dnode_t *dn, int flags, uint64_t *offset, rw_enter(&dn->dn_struct_rwlock, RW_READER); if (dn->dn_phys->dn_nlevels == 0) { - error = ESRCH; + error = SET_ERROR(ESRCH); goto out; } @@ -1975,7 +1975,7 @@ dnode_next_offset(dnode_t *dn, int flags, uint64_t *offset, if (flags & DNODE_FIND_HOLE) *offset = dn->dn_datablksz; } else { - error = ESRCH; + error = SET_ERROR(ESRCH); } goto out; } @@ -1996,7 +1996,7 @@ dnode_next_offset(dnode_t *dn, int flags, uint64_t *offset, if (error == 0 && (flags & DNODE_FIND_BACKWARDS ? initial_offset < *offset : initial_offset > *offset)) - error = ESRCH; + error = SET_ERROR(ESRCH); out: if (!(flags & DNODE_FIND_HAVELOCK)) rw_exit(&dn->dn_struct_rwlock); |