Deleted Added
full compact
txg.c (260763) txg.c (269418)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Portions Copyright 2011 Martin Matuska <mm@FreeBSD.org>
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Portions Copyright 2011 Martin Matuska <mm@FreeBSD.org>
24 * Copyright (c) 2013 by Delphix. All rights reserved.
24 * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
25 */
26
27#include <sys/zfs_context.h>
28#include <sys/txg_impl.h>
29#include <sys/dmu_impl.h>
30#include <sys/dmu_tx.h>
31#include <sys/dsl_pool.h>
32#include <sys/dsl_scan.h>

--- 689 unchanged lines hidden (view full) ---

722
723boolean_t
724txg_list_empty(txg_list_t *tl, uint64_t txg)
725{
726 return (tl->tl_head[txg & TXG_MASK] == NULL);
727}
728
729/*
25 */
26
27#include <sys/zfs_context.h>
28#include <sys/txg_impl.h>
29#include <sys/dmu_impl.h>
30#include <sys/dmu_tx.h>
31#include <sys/dsl_pool.h>
32#include <sys/dsl_scan.h>

--- 689 unchanged lines hidden (view full) ---

722
723boolean_t
724txg_list_empty(txg_list_t *tl, uint64_t txg)
725{
726 return (tl->tl_head[txg & TXG_MASK] == NULL);
727}
728
729/*
730 * Returns true if all txg lists are empty.
731 *
732 * Warning: this is inherently racy (an item could be added immediately after this
733 * function returns). We don't bother with the lock because it wouldn't change the
734 * semantics.
735 */
736boolean_t
737txg_all_lists_empty(txg_list_t *tl)
738{
739 for (int i = 0; i < TXG_SIZE; i++) {
740 if (!txg_list_empty(tl, i)) {
741 return (B_FALSE);
742 }
743 }
744 return (B_TRUE);
745}
746
747/*
730 * Add an entry to the list (unless it's already on the list).
731 * Returns B_TRUE if it was actually added.
732 */
733boolean_t
734txg_list_add(txg_list_t *tl, void *p, uint64_t txg)
735{
736 int t = txg & TXG_MASK;
737 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset);

--- 122 unchanged lines hidden ---
748 * Add an entry to the list (unless it's already on the list).
749 * Returns B_TRUE if it was actually added.
750 */
751boolean_t
752txg_list_add(txg_list_t *tl, void *p, uint64_t txg)
753{
754 int t = txg & TXG_MASK;
755 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset);

--- 122 unchanged lines hidden ---