/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
*/
#include <sys/zfs_context.h>
#include <sys/refcount.h>
#include <sys/dsl_pool.h>
#include <sys/zfeature.h>
/*
* Return an empty bpobj, preferably the empty dummy one (dp_empty_bpobj).
*/
{
dp->dp_empty_bpobj =
}
return (dp->dp_empty_bpobj);
} else {
}
}
void
{
dp->dp_empty_bpobj = 0;
}
}
{
int size;
else
size = sizeof (bpobj_phys_t);
}
void
{
int64_t i;
int epb;
goto out;
if (dbuf)
}
}
if (dbuf) {
}
out:
bpobj_close(&bpo);
}
int
{
int err;
if (err)
return (err);
if (err)
return (err);
return (0);
}
void
{
/* Lame workaround for closing a bpobj that was never opened. */
if (bpo->bpo_object == 0)
return;
bpo->bpo_object = 0;
}
static boolean_t
{
}
static int
{
int epb;
int64_t i;
int err = 0;
if (free)
if (dbuf)
if (err)
break;
}
if (err)
break;
if (free) {
if (bpo->bpo_havecomp) {
}
}
}
if (dbuf) {
}
if (free) {
}
goto out;
if (err) {
return (err);
}
if (dbuf)
if (err)
break;
}
if (err)
break;
if (free) {
if (err != 0) {
break;
}
}
if (free) {
}
if (err)
break;
if (free) {
if (err)
break;
}
}
if (dbuf) {
}
if (free) {
}
out:
/* If there are no entries, there should be no bytes. */
if (!bpobj_hasentries(bpo)) {
}
return (err);
}
/*
* Iterate and remove the entries. If func returns nonzero, iteration
* will stop and that entry will not be removed.
*/
int
{
}
/*
* Iterate the entries. If func returns nonzero, iteration will stop.
*/
int
{
}
void
{
return;
}
if (!bpobj_hasentries(&subbpo)) {
/* No point in having an empty subobj. */
return;
}
DMU_OT_NONE, 0, tx);
}
/*
* If subobj has only one block of subobjs, then move subobj's
* subobjs to bpo's subobj list directly. This reduces
* recursion in bpobj_iterate due to nested subobjs.
*/
if (subsubobjs != 0) {
/*
* Make sure that we are not asking dmu_write()
* to write more data than we have in our buffer.
*/
subsubobjs, tx));
}
}
}
void
{
int blkoff;
if (BP_IS_EMBEDDED(bp)) {
/*
* The bpobj will compress better without the payload.
*
* Note that we store EMBEDDED bp's because they have an
* uncompressed size, which must be accounted for. An
* alternative would be to add their size to bpo_uncomp
* without storing the bp, but that would create additional
* complications: bpo_uncomp would be inconsistent with the
* set of BP's stored, and bpobj_iterate() wouldn't visit
* all the space accounted for in the bpobj.
*/
} else if (!BP_GET_DEDUP(bp)) {
/* The bpobj will compress better without the checksum */
}
/* We never need the fill count. */
if (bpo->bpo_cached_dbuf)
}
if (bpo->bpo_havecomp) {
}
}
struct space_range_arg {
};
/* ARGSUSED */
static int
{
else
}
return (0);
}
int
{
if (bpo->bpo_havecomp) {
return (0);
} else {
}
}
/*
* Return the amount of space in the bpobj which is:
* mintxg < blk_birth <= maxtxg
*/
int
{
int err;
/*
* As an optimization, if they want the whole txg range, just
* get bpo_bytes rather than iterating over the bps.
*/
return (err);
}