usr/src/uts/common/fs/zfs/sys/dmu_objset.h
changeset 3547 e396e0a440b1
parent 2885 c0259887ebbc
child 3835 063f0749804a
equal deleted inserted replaced
3546:82a941a9c116 3547:e396e0a440b1
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    17  * information: Portions Copyright [yyyy] [name of copyright owner]
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 /*
    21 /*
    22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
    22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
    23  * Use is subject to license terms.
    23  * Use is subject to license terms.
    24  */
    24  */
    25 
    25 
    26 #ifndef	_SYS_DMU_OBJSET_H
    26 #ifndef	_SYS_DMU_OBJSET_H
    27 #define	_SYS_DMU_OBJSET_H
    27 #define	_SYS_DMU_OBJSET_H
    28 
    28 
    29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
    29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
    30 
    30 
    31 #include <sys/spa.h>
    31 #include <sys/spa.h>
       
    32 #include <sys/arc.h>
    32 #include <sys/txg.h>
    33 #include <sys/txg.h>
    33 #include <sys/zfs_context.h>
    34 #include <sys/zfs_context.h>
    34 #include <sys/dnode.h>
    35 #include <sys/dnode.h>
    35 #include <sys/zio.h>
    36 #include <sys/zio.h>
    36 #include <sys/zil.h>
    37 #include <sys/zil.h>
    58 
    59 
    59 typedef struct objset_impl {
    60 typedef struct objset_impl {
    60 	/* Immutable: */
    61 	/* Immutable: */
    61 	struct dsl_dataset *os_dsl_dataset;
    62 	struct dsl_dataset *os_dsl_dataset;
    62 	spa_t *os_spa;
    63 	spa_t *os_spa;
       
    64 	arc_buf_t *os_phys_buf;
    63 	objset_phys_t *os_phys;
    65 	objset_phys_t *os_phys;
    64 	dnode_t *os_meta_dnode;
    66 	dnode_t *os_meta_dnode;
    65 	zilog_t *os_zil;
    67 	zilog_t *os_zil;
    66 	objset_t os;
    68 	objset_t os;
    67 	uint8_t os_checksum;	/* can change, under dsl_dir's locks */
    69 	uint8_t os_checksum;	/* can change, under dsl_dir's locks */
    69 	uint8_t os_md_checksum;
    71 	uint8_t os_md_checksum;
    70 	uint8_t os_md_compress;
    72 	uint8_t os_md_compress;
    71 
    73 
    72 	/* no lock needed: */
    74 	/* no lock needed: */
    73 	struct dmu_tx *os_synctx; /* XXX sketchy */
    75 	struct dmu_tx *os_synctx; /* XXX sketchy */
    74 	blkptr_t os_rootbp;
    76 	blkptr_t *os_rootbp;
    75 
    77 
    76 	/* Protected by os_obj_lock */
    78 	/* Protected by os_obj_lock */
    77 	kmutex_t os_obj_lock;
    79 	kmutex_t os_obj_lock;
    78 	uint64_t os_obj_next;
    80 	uint64_t os_obj_next;
    79 
    81 
   106     int flags);
   108     int flags);
   107 void dmu_objset_byteswap(void *buf, size_t size);
   109 void dmu_objset_byteswap(void *buf, size_t size);
   108 int dmu_objset_evict_dbufs(objset_t *os, int try);
   110 int dmu_objset_evict_dbufs(objset_t *os, int try);
   109 
   111 
   110 /* called from dsl */
   112 /* called from dsl */
   111 void dmu_objset_sync(objset_impl_t *os, dmu_tx_t *tx);
   113 void dmu_objset_sync(objset_impl_t *os, zio_t *zio, dmu_tx_t *tx);
   112 objset_impl_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds,
   114 objset_impl_t *dmu_objset_create_impl(spa_t *spa, struct dsl_dataset *ds,
   113     dmu_objset_type_t type, dmu_tx_t *tx);
   115     blkptr_t *bp, dmu_objset_type_t type, dmu_tx_t *tx);
   114 int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp,
   116 int dmu_objset_open_impl(spa_t *spa, struct dsl_dataset *ds, blkptr_t *bp,
   115     objset_impl_t **osip);
   117     objset_impl_t **osip);
   116 void dmu_objset_evict(struct dsl_dataset *ds, void *arg);
   118 void dmu_objset_evict(struct dsl_dataset *ds, void *arg);
   117 
   119 
   118 #ifdef	__cplusplus
   120 #ifdef	__cplusplus