Deleted Added
full compact
zio.h (236884) zio.h (240868)
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

--- 17 unchanged lines hidden (view full) ---

26
27#ifndef _ZIO_H
28#define _ZIO_H
29
30#include <sys/zfs_context.h>
31#include <sys/spa.h>
32#include <sys/txg.h>
33#include <sys/avl.h>
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

--- 17 unchanged lines hidden (view full) ---

26
27#ifndef _ZIO_H
28#define _ZIO_H
29
30#include <sys/zfs_context.h>
31#include <sys/spa.h>
32#include <sys/txg.h>
33#include <sys/avl.h>
34#include <sys/kstat.h>
34#include <sys/fs/zfs.h>
35#include <sys/zio_impl.h>
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/*

--- 86 unchanged lines hidden (view full) ---

128#define ZIO_PRIORITY_CACHE_FILL (zio_priority_table[4])
129#define ZIO_PRIORITY_AGG (zio_priority_table[5])
130#define ZIO_PRIORITY_FREE (zio_priority_table[6])
131#define ZIO_PRIORITY_ASYNC_WRITE (zio_priority_table[7])
132#define ZIO_PRIORITY_ASYNC_READ (zio_priority_table[8])
133#define ZIO_PRIORITY_RESILVER (zio_priority_table[9])
134#define ZIO_PRIORITY_SCRUB (zio_priority_table[10])
135#define ZIO_PRIORITY_DDT_PREFETCH (zio_priority_table[11])
35#include <sys/fs/zfs.h>
36#include <sys/zio_impl.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/*

--- 86 unchanged lines hidden (view full) ---

129#define ZIO_PRIORITY_CACHE_FILL (zio_priority_table[4])
130#define ZIO_PRIORITY_AGG (zio_priority_table[5])
131#define ZIO_PRIORITY_FREE (zio_priority_table[6])
132#define ZIO_PRIORITY_ASYNC_WRITE (zio_priority_table[7])
133#define ZIO_PRIORITY_ASYNC_READ (zio_priority_table[8])
134#define ZIO_PRIORITY_RESILVER (zio_priority_table[9])
135#define ZIO_PRIORITY_SCRUB (zio_priority_table[10])
136#define ZIO_PRIORITY_DDT_PREFETCH (zio_priority_table[11])
136#define ZIO_PRIORITY_TABLE_SIZE 12
137#define ZIO_PRIORITY_TRIM (zio_priority_table[12])
138#define ZIO_PRIORITY_TABLE_SIZE 13
137
138#define ZIO_PIPELINE_CONTINUE 0x100
139#define ZIO_PIPELINE_STOP 0x101
140
141enum zio_flag {
142 /*
143 * Flags inherited by gang, ddt, and vdev children,
144 * and that must be equal for two zios to aggregate

--- 210 unchanged lines hidden (view full) ---

355
356typedef struct zio_link {
357 zio_t *zl_parent;
358 zio_t *zl_child;
359 list_node_t zl_parent_node;
360 list_node_t zl_child_node;
361} zio_link_t;
362
139
140#define ZIO_PIPELINE_CONTINUE 0x100
141#define ZIO_PIPELINE_STOP 0x101
142
143enum zio_flag {
144 /*
145 * Flags inherited by gang, ddt, and vdev children,
146 * and that must be equal for two zios to aggregate

--- 210 unchanged lines hidden (view full) ---

357
358typedef struct zio_link {
359 zio_t *zl_parent;
360 zio_t *zl_child;
361 list_node_t zl_parent_node;
362 list_node_t zl_child_node;
363} zio_link_t;
364
365/*
366 * Used for TRIM kstat.
367 */
368typedef struct zio_trim_stats {
369 /*
370 * Number of bytes successfully TRIMmed.
371 */
372 kstat_named_t zio_trim_bytes;
373
374 /*
375 * Number of successful TRIM requests.
376 */
377 kstat_named_t zio_trim_success;
378
379 /*
380 * Number of TRIM requests that failed because TRIM is not
381 * supported.
382 */
383 kstat_named_t zio_trim_unsupported;
384
385 /*
386 * Number of TRIM requests that failed for other reasons.
387 */
388 kstat_named_t zio_trim_failed;
389} zio_trim_stats_t;
390
391extern zio_trim_stats_t zio_trim_stats;
392
393#define ZIO_TRIM_STAT_INCR(stat, val) \
394 atomic_add_64(&zio_trim_stats.stat.value.ui64, (val));
395#define ZIO_TRIM_STAT_BUMP(stat) \
396 ZIO_TRIM_STAT_INCR(stat, 1);
397
363struct zio {
364 /* Core information about this I/O */
365 zbookmark_t io_bookmark;
366 zio_prop_t io_prop;
367 zio_type_t io_type;
368 enum zio_child io_child_type;
369 int io_cmd;
370 uint8_t io_priority;

--- 57 unchanged lines hidden (view full) ---

428 /* FMA state */
429 zio_cksum_report_t *io_cksum_report;
430 uint64_t io_ena;
431
432#ifdef _KERNEL
433 /* FreeBSD only. */
434 struct ostask io_task;
435#endif
398struct zio {
399 /* Core information about this I/O */
400 zbookmark_t io_bookmark;
401 zio_prop_t io_prop;
402 zio_type_t io_type;
403 enum zio_child io_child_type;
404 int io_cmd;
405 uint8_t io_priority;

--- 57 unchanged lines hidden (view full) ---

463 /* FMA state */
464 zio_cksum_report_t *io_cksum_report;
465 uint64_t io_ena;
466
467#ifdef _KERNEL
468 /* FreeBSD only. */
469 struct ostask io_task;
470#endif
471 avl_node_t io_trim_node;
472 list_node_t io_trim_link;
436};
437
438extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd,
439 zio_done_func_t *done, void *priv, enum zio_flag flags);
440
441extern zio_t *zio_root(spa_t *spa,
442 zio_done_func_t *done, void *priv, enum zio_flag flags);
443

--- 14 unchanged lines hidden (view full) ---

458
459extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp);
460
461extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
462 const blkptr_t *bp,
463 zio_done_func_t *done, void *priv, enum zio_flag flags);
464
465extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
473};
474
475extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd,
476 zio_done_func_t *done, void *priv, enum zio_flag flags);
477
478extern zio_t *zio_root(spa_t *spa,
479 zio_done_func_t *done, void *priv, enum zio_flag flags);
480

--- 14 unchanged lines hidden (view full) ---

495
496extern void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp);
497
498extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
499 const blkptr_t *bp,
500 zio_done_func_t *done, void *priv, enum zio_flag flags);
501
502extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
466 zio_done_func_t *done, void *priv, int priority,
467 enum zio_flag flags);
503 uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv,
504 int priority, enum zio_flag flags);
468
469extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
470 uint64_t size, void *data, int checksum,
471 zio_done_func_t *done, void *priv, int priority, enum zio_flag flags,
472 boolean_t labels);
473
474extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
475 uint64_t size, void *data, int checksum,
476 zio_done_func_t *done, void *priv, int priority, enum zio_flag flags,
477 boolean_t labels);
478
479extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg,
505
506extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
507 uint64_t size, void *data, int checksum,
508 zio_done_func_t *done, void *priv, int priority, enum zio_flag flags,
509 boolean_t labels);
510
511extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
512 uint64_t size, void *data, int checksum,
513 zio_done_func_t *done, void *priv, int priority, enum zio_flag flags,
514 boolean_t labels);
515
516extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg,
480 const blkptr_t *bp, enum zio_flag flags);
517 const blkptr_t *bp, uint64_t size, enum zio_flag flags);
481
482extern int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp,
483 blkptr_t *old_bp, uint64_t size, boolean_t use_slog);
484extern void zio_free_zil(spa_t *spa, uint64_t txg, blkptr_t *bp);
485extern void zio_flush(zio_t *zio, vdev_t *vd);
518
519extern int zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp,
520 blkptr_t *old_bp, uint64_t size, boolean_t use_slog);
521extern void zio_free_zil(spa_t *spa, uint64_t txg, blkptr_t *bp);
522extern void zio_flush(zio_t *zio, vdev_t *vd);
523extern zio_t *zio_trim(zio_t *zio, spa_t *spa, vdev_t *vd, uint64_t offset,
524 uint64_t size);
486extern void zio_shrink(zio_t *zio, uint64_t size);
487
488extern int zio_wait(zio_t *zio);
489extern void zio_nowait(zio_t *zio);
490extern void zio_execute(zio_t *zio);
491extern void zio_interrupt(zio_t *zio);
492
493extern zio_t *zio_walk_parents(zio_t *cio);

--- 87 unchanged lines hidden ---
525extern void zio_shrink(zio_t *zio, uint64_t size);
526
527extern int zio_wait(zio_t *zio);
528extern void zio_nowait(zio_t *zio);
529extern void zio_execute(zio_t *zio);
530extern void zio_interrupt(zio_t *zio);
531
532extern zio_t *zio_walk_parents(zio_t *cio);

--- 87 unchanged lines hidden ---