usr/src/uts/common/fs/zfs/sys/arc.h
changeset 3290 256464cbb73c
parent 3093 71525e4187d5
child 3547 e396e0a440b1
equal deleted inserted replaced
3289:95e8ec05aa83 3290:256464cbb73c
    52 	void			*b_data;
    52 	void			*b_data;
    53 	arc_evict_func_t	*b_efunc;
    53 	arc_evict_func_t	*b_efunc;
    54 	void			*b_private;
    54 	void			*b_private;
    55 };
    55 };
    56 
    56 
       
    57 typedef enum arc_buf_contents {
       
    58 	ARC_BUFC_UNDEF,				/* buffer contents undefined */
       
    59 	ARC_BUFC_DATA,				/* buffer contains data */
       
    60 	ARC_BUFC_METADATA			/* buffer contains metadata */
       
    61 } arc_buf_contents_t;
    57 /*
    62 /*
    58  * These are the flags we pass into calls to the arc
    63  * These are the flags we pass into calls to the arc
    59  */
    64  */
    60 #define	ARC_WAIT	(1 << 1)	/* perform I/O synchronously */
    65 #define	ARC_WAIT	(1 << 1)	/* perform I/O synchronously */
    61 #define	ARC_NOWAIT	(1 << 2)	/* perform I/O asynchronously */
    66 #define	ARC_NOWAIT	(1 << 2)	/* perform I/O asynchronously */
    62 #define	ARC_PREFETCH	(1 << 3)	/* I/O is a prefetch */
    67 #define	ARC_PREFETCH	(1 << 3)	/* I/O is a prefetch */
    63 #define	ARC_CACHED	(1 << 4)	/* I/O was already in cache */
    68 #define	ARC_CACHED	(1 << 4)	/* I/O was already in cache */
    64 
    69 
    65 arc_buf_t *arc_buf_alloc(spa_t *spa, int size, void *tag);
    70 arc_buf_t *arc_buf_alloc(spa_t *spa, int size, void *tag,
       
    71     arc_buf_contents_t type);
    66 void arc_buf_add_ref(arc_buf_t *buf, void *tag);
    72 void arc_buf_add_ref(arc_buf_t *buf, void *tag);
    67 int arc_buf_remove_ref(arc_buf_t *buf, void *tag);
    73 int arc_buf_remove_ref(arc_buf_t *buf, void *tag);
    68 int arc_buf_size(arc_buf_t *buf);
    74 int arc_buf_size(arc_buf_t *buf);
    69 void arc_release(arc_buf_t *buf, void *tag);
    75 void arc_release(arc_buf_t *buf, void *tag);
    70 int arc_released(arc_buf_t *buf);
    76 int arc_released(arc_buf_t *buf);