dbuf.h revision e57a022b8f718889ffa92adbde47a8f08abcdb25
837N/A * The contents of this file are subject to the terms of the 561N/A * Common Development and Distribution License (the "License"). 561N/A * You may not use this file except in compliance with the License. 561N/A * See the License for the specific language governing permissions 561N/A * and limitations under the License. 561N/A * When distributing Covered Code, include this CDDL HEADER in each 561N/A * If applicable, add the following below this CDDL HEADER, with the 561N/A * fields enclosed by brackets "[]" replaced with your own identifying 561N/A * information: Portions Copyright [yyyy] [name of copyright owner] 561N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 561N/A * Copyright (c) 2012, 2014 by Delphix. All rights reserved. 561N/A * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. 561N/A * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * define flags for dbuf_read * The simplified state transition diagram for dbufs looks like: * (alloc)-->UNCACHED CACHED-->EVICTING-->(free) * +--------> NOFILL -------+ * DB_SEARCH is an invalid state for a dbuf. It is used by dbuf_free_range * to find all dbufs in a range of a dnode and must be less than any other * dbuf_states_t (see comment on dn_dbufs in dnode.h). * level = 0 means the user data * level = 1 means the single indirect block /* link on our parents dirty list */ /* transaction group this data will sync in */ /* zio of outstanding write IO */ /* pointer back to our dbuf */ /* pointer to next dirty record */ /* pointer to parent dirty record */ /* How much space was changed to dsl_pool_dirty_space() for this? */ /* protect access to list */ /* Our list of dirty children */ * dr_data is set when we dirty the buffer * so that we can retain the pointer even if it * gets COW'd in a subsequent transaction group. * The following members are immutable, with the exception of * db.db_data, which is protected by db_mtx. /* the publicly visible structure */ /* the objset we belong to */ * handle to safely access the dnode we belong to (NULL when evicted) * our parent buffer; if the dnode points to us directly, * db_parent == db_dnode_handle->dnh_dnode->dn_dbuf * only accessed by sync thread ??? * May change from NULL to non-NULL under the protection of db_mtx * (see dbuf_check_blkptr()) * link for hash table of all dmu_buf_impl_t's * Pointer to the blkptr_t which points to us. May be NULL if we * don't have one yet. (NULL when evicted) * Our indirection level. Data buffers have db_level==0. * Indirect buffers which point to data buffers have * db_level==1. etc. Buffers which contain dnodes have * db_level==0, since the dnodes are stored in a file. /* db_mtx protects the members below */ * Current state of the buffer * Refcount accessed by dmu_buf_{hold,rele}. * If nonzero, the buffer can't be destroyed. /* buffer holding our data */ /* pointer to most recent dirty record for this buffer */ * Our link on the owner dnodes's dn_dbufs list. * Protected by its dn_dbufs_mtx. /* Data which is unique to data (leaf) blocks: */ /* User callback information. */ /* Note: the dbuf hash table is exposed only for the mdb module */ * There should be a ## between the string literal and fmt, to make it * clear that we're joining two strings together, but gcc does not * support that preprocessor token. "obj=%s lvl=%u blkid=%lld " fmt, \