Skip to content

Commit 5dbd68a

Browse files
ahrensbehlendorf
authored andcommitted
Illumos 4914 - zfs on-disk bookmark structure should be named *_phys_t
4914 zfs on-disk bookmark structure should be named *_phys_t Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com> Approved by: Robert Mustacchi <rm@joyent.com> References: https://www.illumos.org/issues/4914 illumos/illumos-gate@7802d7b Porting notes: There were a number of zfsonlinux-specific uses of zbookmark_t which needed to be updated. This should reduce the likelihood of further problems like issue #2094 from occurring. Ported by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2558
1 parent 1fa8f79 commit 5dbd68a

27 files changed

+137
-132
lines changed

cmd/zdb/zdb.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/*
2323
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24-
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
24+
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
2525
*/
2626

2727
#include <stdio.h>
@@ -1019,7 +1019,8 @@ dump_dnode(objset_t *os, uint64_t object, void *data, size_t size)
10191019
}
10201020

10211021
static uint64_t
1022-
blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb)
1022+
blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp,
1023+
const zbookmark_phys_t *zb)
10231024
{
10241025
if (dnp == NULL) {
10251026
ASSERT(zb->zb_level < 0);
@@ -1083,7 +1084,7 @@ snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp)
10831084
}
10841085

10851086
static void
1086-
print_indirect(blkptr_t *bp, const zbookmark_t *zb,
1087+
print_indirect(blkptr_t *bp, const zbookmark_phys_t *zb,
10871088
const dnode_phys_t *dnp)
10881089
{
10891090
char blkbuf[BP_SPRINTF_LEN];
@@ -1112,7 +1113,7 @@ print_indirect(blkptr_t *bp, const zbookmark_t *zb,
11121113

11131114
static int
11141115
visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
1115-
blkptr_t *bp, const zbookmark_t *zb)
1116+
blkptr_t *bp, const zbookmark_phys_t *zb)
11161117
{
11171118
int err = 0;
11181119

@@ -1138,7 +1139,7 @@ visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
11381139
/* recursively visit blocks below this */
11391140
cbp = buf->b_data;
11401141
for (i = 0; i < epb; i++, cbp++) {
1141-
zbookmark_t czb;
1142+
zbookmark_phys_t czb;
11421143

11431144
SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
11441145
zb->zb_level - 1,
@@ -1162,7 +1163,7 @@ dump_indirect(dnode_t *dn)
11621163
{
11631164
dnode_phys_t *dnp = dn->dn_phys;
11641165
int j;
1165-
zbookmark_t czb;
1166+
zbookmark_phys_t czb;
11661167

11671168
(void) printf("Indirect blocks:\n");
11681169

@@ -2261,7 +2262,7 @@ zdb_blkptr_done(zio_t *zio)
22612262
blkptr_t *bp = zio->io_bp;
22622263
int ioerr = zio->io_error;
22632264
zdb_cb_t *zcb = zio->io_private;
2264-
zbookmark_t *zb = &zio->io_bookmark;
2265+
zbookmark_phys_t *zb = &zio->io_bookmark;
22652266

22662267
zio_data_buf_free(zio->io_data, zio->io_size);
22672268

@@ -2295,7 +2296,7 @@ zdb_blkptr_done(zio_t *zio)
22952296

22962297
static int
22972298
zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
2298-
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
2299+
const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
22992300
{
23002301
zdb_cb_t *zcb = arg;
23012302
dmu_object_type_t type;
@@ -2753,7 +2754,7 @@ typedef struct zdb_ddt_entry {
27532754
/* ARGSUSED */
27542755
static int
27552756
zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
2756-
const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
2757+
const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
27572758
{
27582759
avl_tree_t *t = arg;
27592760
avl_index_t where;

cmd/zdb/zdb_il.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
/*
28-
* Copyright (c) 2013 by Delphix. All rights reserved.
28+
* Copyright (c) 2013, 2014 by Delphix. All rights reserved.
2929
*/
3030

3131
/*
@@ -123,7 +123,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
123123
{
124124
char *data, *dlimit;
125125
blkptr_t *bp = &lr->lr_blkptr;
126-
zbookmark_t zb;
126+
zbookmark_phys_t zb;
127127
char buf[SPA_MAXBLOCKSIZE];
128128
int verbose = MAX(dump_opt['d'], dump_opt['i']);
129129
int error;

include/sys/arc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
/*
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2013 by Delphix. All rights reserved.
23+
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
2424
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
2525
*/
2626

@@ -147,12 +147,12 @@ int arc_referenced(arc_buf_t *buf);
147147

148148
int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
149149
arc_done_func_t *done, void *private, zio_priority_t priority, int flags,
150-
uint32_t *arc_flags, const zbookmark_t *zb);
150+
uint32_t *arc_flags, const zbookmark_phys_t *zb);
151151
zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
152152
blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress,
153153
const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone,
154154
arc_done_func_t *done, void *private, zio_priority_t priority,
155-
int zio_flags, const zbookmark_t *zb);
155+
int zio_flags, const zbookmark_phys_t *zb);
156156

157157
arc_prune_t *arc_add_prune_callback(arc_prune_func_t *func, void *private);
158158
void arc_remove_prune_callback(arc_prune_t *p);

include/sys/bptree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* CDDL HEADER END
2020
*/
2121
/*
22-
* Copyright (c) 2013 by Delphix. All rights reserved.
22+
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
2323
*/
2424

2525
#ifndef _SYS_BPTREE_H
@@ -43,7 +43,7 @@ typedef struct bptree_phys {
4343
typedef struct bptree_entry_phys {
4444
blkptr_t be_bp;
4545
uint64_t be_birth_txg; /* only delete blocks born after this txg */
46-
zbookmark_t be_zb; /* holds traversal resume point if needed */
46+
zbookmark_phys_t be_zb; /* holds traversal resume point if needed */
4747
} bptree_entry_phys_t;
4848

4949
typedef int bptree_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx);

include/sys/dmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct dsl_pool;
6262
struct dnode;
6363
struct drr_begin;
6464
struct drr_end;
65-
struct zbookmark;
65+
struct zbookmark_phys;
6666
struct spa;
6767
struct nvlist;
6868
struct arc_buf;

include/sys/dmu_traverse.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
/*
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2012 by Delphix. All rights reserved.
23+
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
2424
*/
2525

2626
#ifndef _SYS_DMU_TRAVERSE_H
@@ -40,7 +40,7 @@ struct zilog;
4040
struct arc_buf;
4141

4242
typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
43-
const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg);
43+
const zbookmark_phys_t *zb, const struct dnode_phys *dnp, void *arg);
4444

4545
#define TRAVERSE_PRE (1<<0)
4646
#define TRAVERSE_POST (1<<1)
@@ -55,7 +55,7 @@ typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
5555
int traverse_dataset(struct dsl_dataset *ds,
5656
uint64_t txg_start, int flags, blkptr_cb_t func, void *arg);
5757
int traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr,
58-
uint64_t txg_start, zbookmark_t *resume, int flags,
58+
uint64_t txg_start, zbookmark_phys_t *resume, int flags,
5959
blkptr_cb_t func, void *arg);
6060
int traverse_pool(spa_t *spa,
6161
uint64_t txg_start, int flags, blkptr_cb_t func, void *arg);

include/sys/dsl_scan.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
/*
2222
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2013 by Delphix. All rights reserved.
23+
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
2424
*/
2525

2626
#ifndef _SYS_DSL_SCAN_H
@@ -62,7 +62,7 @@ typedef struct dsl_scan_phys {
6262
uint64_t scn_errors; /* scan I/O error count */
6363
uint64_t scn_ddt_class_max;
6464
ddt_bookmark_t scn_ddt_bookmark;
65-
zbookmark_t scn_bookmark;
65+
zbookmark_phys_t scn_bookmark;
6666
uint64_t scn_flags; /* dsl_scan_flags_t */
6767
} dsl_scan_phys_t;
6868

include/sys/spa.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
/*
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2013 by Delphix. All rights reserved.
23+
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
2424
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
2525
*/
2626

@@ -51,7 +51,7 @@ typedef struct zilog zilog_t;
5151
typedef struct spa_aux_vdev spa_aux_vdev_t;
5252
typedef struct ddt ddt_t;
5353
typedef struct ddt_entry ddt_entry_t;
54-
typedef struct zbookmark zbookmark_t;
54+
typedef struct zbookmark_phys zbookmark_phys_t;
5555

5656
struct dsl_pool;
5757
struct dsl_dataset;
@@ -720,7 +720,7 @@ typedef enum txg_state {
720720

721721
extern void spa_stats_init(spa_t *spa);
722722
extern void spa_stats_destroy(spa_t *spa);
723-
extern void spa_read_history_add(spa_t *spa, const zbookmark_t *zb,
723+
extern void spa_read_history_add(spa_t *spa, const zbookmark_phys_t *zb,
724724
uint32_t aflags);
725725
extern void spa_txg_history_add(spa_t *spa, uint64_t txg, hrtime_t birth_time);
726726
extern int spa_txg_history_set(spa_t *spa, uint64_t txg,
@@ -842,7 +842,7 @@ extern void spa_history_log_internal_dd(dsl_dir_t *dd, const char *operation,
842842
dmu_tx_t *tx, const char *fmt, ...);
843843

844844
/* error handling */
845-
struct zbookmark;
845+
struct zbookmark_phys;
846846
extern void spa_log_error(spa_t *spa, zio_t *zio);
847847
extern void zfs_ereport_post(const char *class, spa_t *spa, vdev_t *vd,
848848
zio_t *zio, uint64_t stateoroffset, uint64_t length);

include/sys/spa_impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
/*
2222
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2013 by Delphix. All rights reserved.
23+
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
2424
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
2525
*/
2626

@@ -46,9 +46,9 @@ extern "C" {
4646
#endif
4747

4848
typedef struct spa_error_entry {
49-
zbookmark_t se_bookmark;
50-
char *se_name;
51-
avl_node_t se_avl;
49+
zbookmark_phys_t se_bookmark;
50+
char *se_name;
51+
avl_node_t se_avl;
5252
} spa_error_entry_t;
5353

5454
typedef struct spa_history_phys {

include/sys/zio.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/*
2323
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2424
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25-
* Copyright (c) 2013 by Delphix. All rights reserved.
25+
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
2626
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
2727
*/
2828

@@ -263,11 +263,11 @@ extern const char *zio_type_name[ZIO_TYPES];
263263
* Note: this structure is called a bookmark because its original purpose
264264
* was to remember where to resume a pool-wide traverse.
265265
*
266-
* Note: this structure is passed between userland and the kernel.
267-
* Therefore it must not change size or alignment between 32/64 bit
268-
* compilation options.
266+
* Note: this structure is passed between userland and the kernel, and is
267+
* stored on disk (by virtue of being incorporated into other on-disk
268+
* structures, e.g. dsl_scan_phys_t).
269269
*/
270-
struct zbookmark {
270+
struct zbookmark_phys {
271271
uint64_t zb_objset;
272272
uint64_t zb_object;
273273
int64_t zb_level;
@@ -383,7 +383,7 @@ typedef struct zio_link {
383383

384384
struct zio {
385385
/* Core information about this I/O */
386-
zbookmark_t io_bookmark;
386+
zbookmark_phys_t io_bookmark;
387387
zio_prop_t io_prop;
388388
zio_type_t io_type;
389389
enum zio_child io_child_type;
@@ -464,17 +464,17 @@ extern zio_t *zio_root(spa_t *spa,
464464

465465
extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data,
466466
uint64_t size, zio_done_func_t *done, void *private,
467-
zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb);
467+
zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb);
468468

469469
extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
470470
void *data, uint64_t size, const zio_prop_t *zp,
471471
zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done,
472472
void *private,
473-
zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb);
473+
zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb);
474474

475475
extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
476476
void *data, uint64_t size, zio_done_func_t *done, void *private,
477-
zio_priority_t priority, enum zio_flag flags, zbookmark_t *zb);
477+
zio_priority_t priority, enum zio_flag flags, zbookmark_phys_t *zb);
478478

479479
extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies,
480480
boolean_t nopwrite);
@@ -595,9 +595,9 @@ extern void zfs_ereport_post_checksum(spa_t *spa, vdev_t *vd,
595595
/* Called from spa_sync(), but primarily an injection handler */
596596
extern void spa_handle_ignored_writes(spa_t *spa);
597597

598-
/* zbookmark functions */
598+
/* zbookmark_phys functions */
599599
boolean_t zbookmark_is_before(const struct dnode_phys *dnp,
600-
const zbookmark_t *zb1, const zbookmark_t *zb2);
600+
const zbookmark_phys_t *zb1, const zbookmark_phys_t *zb2);
601601

602602
#ifdef __cplusplus
603603
}

0 commit comments

Comments
 (0)