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 --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 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 * Copyright (c) 2011 by Delphix. All rights reserved. |
24 */ 25 26#include <sys/bpobj.h> 27#include <sys/zfs_context.h> 28#include <sys/refcount.h> |
29#include <sys/dsl_pool.h> |
30 31uint64_t 32bpobj_alloc(objset_t *os, int blocksize, dmu_tx_t *tx) 33{ 34 int size; 35 36 if (spa_version(dmu_objset_spa(os)) < SPA_VERSION_BPOBJ_ACCOUNT) 37 size = BPOBJ_SIZE_V0; --- 399 unchanged lines hidden (view full) --- 437 438/* ARGSUSED */ 439static int 440space_range_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx) 441{ 442 struct space_range_arg *sra = arg; 443 444 if (bp->blk_birth > sra->mintxg && bp->blk_birth <= sra->maxtxg) { |
445 if (dsl_pool_sync_context(spa_get_dsl(sra->spa))) 446 sra->used += bp_get_dsize_sync(sra->spa, bp); 447 else 448 sra->used += bp_get_dsize(sra->spa, bp); |
449 sra->comp += BP_GET_PSIZE(bp); 450 sra->uncomp += BP_GET_UCSIZE(bp); 451 } 452 return (0); 453} 454 455int 456bpobj_space(bpobj_t *bpo, uint64_t *usedp, uint64_t *compp, uint64_t *uncompp) --- 44 unchanged lines hidden --- |