diff options
Diffstat (limited to 'usr/src/uts/common/fs/zfs/sys')
| -rw-r--r-- | usr/src/uts/common/fs/zfs/sys/metaslab.h | 5 | ||||
| -rw-r--r-- | usr/src/uts/common/fs/zfs/sys/spa.h | 2 | ||||
| -rw-r--r-- | usr/src/uts/common/fs/zfs/sys/zil.h | 15 | ||||
| -rw-r--r-- | usr/src/uts/common/fs/zfs/sys/zil_impl.h | 13 | ||||
| -rw-r--r-- | usr/src/uts/common/fs/zfs/sys/zio.h | 9 |
5 files changed, 28 insertions, 16 deletions
diff --git a/usr/src/uts/common/fs/zfs/sys/metaslab.h b/usr/src/uts/common/fs/zfs/sys/metaslab.h index c72b5ddf16..3811e636f3 100644 --- a/usr/src/uts/common/fs/zfs/sys/metaslab.h +++ b/usr/src/uts/common/fs/zfs/sys/metaslab.h @@ -49,8 +49,9 @@ extern void metaslab_sync_done(metaslab_t *msp, uint64_t txg); extern int metaslab_alloc(spa_t *spa, uint64_t psize, blkptr_t *bp, int ncopies, uint64_t txg, blkptr_t *hintbp); -extern void metaslab_free(spa_t *spa, dva_t *dva, uint64_t txg, boolean_t now); -extern int metaslab_claim(spa_t *spa, dva_t *dva, uint64_t txg); +extern void metaslab_free(spa_t *spa, const blkptr_t *bp, uint64_t txg, + boolean_t now); +extern int metaslab_claim(spa_t *spa, const blkptr_t *bp, uint64_t txg); extern metaslab_class_t *metaslab_class_create(void); extern void metaslab_class_destroy(metaslab_class_t *mc); diff --git a/usr/src/uts/common/fs/zfs/sys/spa.h b/usr/src/uts/common/fs/zfs/sys/spa.h index 265d19f63a..a51cfd524f 100644 --- a/usr/src/uts/common/fs/zfs/sys/spa.h +++ b/usr/src/uts/common/fs/zfs/sys/spa.h @@ -407,7 +407,7 @@ extern boolean_t spa_guid_exists(uint64_t pool_guid, uint64_t device_guid); extern char *spa_strdup(const char *); extern void spa_strfree(char *); extern uint64_t spa_get_random(uint64_t range); -extern void sprintf_blkptr(char *buf, int len, blkptr_t *bp); +extern void sprintf_blkptr(char *buf, int len, const blkptr_t *bp); extern void spa_freeze(spa_t *spa); extern void spa_upgrade(spa_t *spa); extern void spa_evict_all(void); diff --git a/usr/src/uts/common/fs/zfs/sys/zil.h b/usr/src/uts/common/fs/zfs/sys/zil.h index 81ccb6beef..040c096f3f 100644 --- a/usr/src/uts/common/fs/zfs/sys/zil.h +++ b/usr/src/uts/common/fs/zfs/sys/zil.h @@ -57,7 +57,8 @@ typedef struct zil_header { uint64_t zh_claim_txg; /* txg in which log blocks were claimed */ uint64_t zh_replay_seq; /* highest replayed sequence number */ blkptr_t zh_log; /* log chain */ - uint64_t zit_pad[6]; + uint64_t zh_claim_seq; /* highest claimed sequence number */ + uint64_t zh_pad[5]; } zil_header_t; /* @@ -80,6 +81,14 @@ typedef struct zil_trailer { #define ZIL_BLK_DATA_SZ(lwb) ((lwb)->lwb_sz - sizeof (zil_trailer_t)) /* + * The words of a log block checksum. + */ +#define ZIL_ZC_GUID_0 0 +#define ZIL_ZC_GUID_1 1 +#define ZIL_ZC_OBJSET 2 +#define ZIL_ZC_SEQ 3 + +/* * Intent log transaction types and record structures */ #define TX_CREATE 1 /* Create file */ @@ -208,7 +217,7 @@ typedef void zil_parse_lr_func_t(zilog_t *zilog, lr_t *lr, void *arg, typedef int zil_replay_func_t(); typedef int zil_get_data_t(void *arg, lr_write_t *lr, char *dbuf); -extern void zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func, +extern uint64_t zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func, zil_parse_lr_func_t *parse_lr_func, void *arg, uint64_t txg); extern void zil_init(void); @@ -222,7 +231,7 @@ extern void zil_close(zilog_t *zilog); extern void zil_replay(objset_t *os, void *arg, uint64_t *txgp, zil_replay_func_t *replay_func[TX_MAX_TYPE], void (*rm_wait)(void *)); -extern void zil_destroy(zilog_t *zilog); +extern void zil_destroy(zilog_t *zilog, boolean_t keep_first); extern itx_t *zil_itx_create(int txtype, size_t lrsize); extern uint64_t zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx); diff --git a/usr/src/uts/common/fs/zfs/sys/zil_impl.h b/usr/src/uts/common/fs/zfs/sys/zil_impl.h index 53951b809c..f36bd94352 100644 --- a/usr/src/uts/common/fs/zfs/sys/zil_impl.h +++ b/usr/src/uts/common/fs/zfs/sys/zil_impl.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -75,7 +74,7 @@ struct zilog { kmutex_t zl_lock; /* protects most zilog_t fields */ struct dsl_pool *zl_dmu_pool; /* DSL pool */ spa_t *zl_spa; /* handle for read/write log */ - zil_header_t *zl_header; /* log header buffer */ + const zil_header_t *zl_header; /* log header buffer */ objset_t *zl_os; /* object set we're logging */ zil_get_data_t *zl_get_data; /* callback to get object content */ uint64_t zl_itx_seq; /* itx sequence number */ @@ -85,6 +84,9 @@ struct zilog { uint32_t zl_suspend; /* log suspend count */ kcondvar_t zl_cv_write; /* for waiting to write to log */ kcondvar_t zl_cv_seq; /* for committing a sequence */ + kcondvar_t zl_cv_suspend; /* log suspend completion */ + uint8_t zl_suspending; /* log is currently suspending */ + uint8_t zl_keep_first; /* keep first log block in destroy */ uint8_t zl_stop_replay; /* don't replay any further */ uint8_t zl_stop_sync; /* for debugging */ uint8_t zl_writer; /* boolean: write setup in progress */ @@ -97,7 +99,6 @@ struct zilog { list_t zl_vdev_list; /* list of [vdev, seq] pairs */ taskq_t *zl_clean_taskq; /* runs lwb and itx clean tasks */ avl_tree_t zl_dva_tree; /* track DVAs during log parse */ - kmutex_t zl_destroy_lock; /* serializes zil_destroy() calls */ }; typedef struct zil_dva_node { diff --git a/usr/src/uts/common/fs/zfs/sys/zio.h b/usr/src/uts/common/fs/zfs/sys/zio.h index 66c9a910ca..b4958ee3fd 100644 --- a/usr/src/uts/common/fs/zfs/sys/zio.h +++ b/usr/src/uts/common/fs/zfs/sys/zio.h @@ -125,7 +125,8 @@ enum zio_compress { #define ZIO_FLAG_RESILVER 0x01000 #define ZIO_FLAG_SCRUB 0x02000 -#define ZIO_FLAG_SUBBLOCK 0x04000 +#define ZIO_FLAG_SCRUB_THREAD 0x04000 +#define ZIO_FLAG_SUBBLOCK 0x08000 #define ZIO_FLAG_NOBOOKMARK 0x10000 @@ -137,7 +138,8 @@ enum zio_compress { ZIO_FLAG_IO_REPAIR | \ ZIO_FLAG_SPECULATIVE | \ ZIO_FLAG_RESILVER | \ - ZIO_FLAG_SCRUB) + ZIO_FLAG_SCRUB | \ + ZIO_FLAG_SCRUB_THREAD) #define ZIO_FLAG_VDEV_INHERIT \ (ZIO_FLAG_GANG_INHERIT | \ @@ -282,8 +284,7 @@ extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, zio_done_func_t *done, void *private, int priority, int flags); -extern int zio_alloc_blk(spa_t *spa, int checksum, uint64_t size, - blkptr_t *bp, uint64_t txg); +extern int zio_alloc_blk(spa_t *spa, uint64_t size, blkptr_t *bp, uint64_t txg); extern void zio_free_blk(spa_t *spa, blkptr_t *bp, uint64_t txg); extern int zio_wait(zio_t *zio); |
