diff options
author | mm <mm@FreeBSD.org> | 2013-03-05 08:09:53 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-03-05 08:09:53 +0000 |
commit | 99f883783c89d10b9d02e77393eb9d0a307f3ca0 (patch) | |
tree | 669ea5740806cbf29b6e064275d3f5a62478bd47 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c | |
parent | 712512f2cc075f7890eaf59c6aa392f330857ff9 (diff) | |
parent | d5063724619a16bd1592c39395c787e97be18693 (diff) | |
download | FreeBSD-src-99f883783c89d10b9d02e77393eb9d0a307f3ca0.zip FreeBSD-src-99f883783c89d10b9d02e77393eb9d0a307f3ca0.tar.gz |
WiP merge of libzfs_core (MFV r238590, r238592)
not yet working, ioctl handling needs to be changed
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c index b4a3798..e248128 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include <sys/dmu.h> @@ -85,17 +86,17 @@ top: /* Do a preliminary error check. */ dstg->dstg_err = 0; +#ifdef ZFS_DEBUG + /* + * Only check half the time, otherwise, the sync-context + * check will almost never fail. + */ + if (spa_get_random(2) == 0) + goto skip; +#endif rw_enter(&dstg->dstg_pool->dp_config_rwlock, RW_READER); for (dst = list_head(&dstg->dstg_tasks); dst; dst = list_next(&dstg->dstg_tasks, dst)) { -#ifdef ZFS_DEBUG - /* - * Only check half the time, otherwise, the sync-context - * check will almost never fail. - */ - if (spa_get_random(2) == 0) - continue; -#endif dst->dst_err = dst->dst_checkfunc(dst->dst_arg1, dst->dst_arg2, tx); if (dst->dst_err) @@ -107,6 +108,7 @@ top: dmu_tx_commit(tx); return (dstg->dstg_err); } +skip: /* * We don't generally have many sync tasks, so pay the price of |