Permalink
Browse files

Import new Opensolaris sources for zfs/dtrace.

Opensolaris mercurial changeset: 11751:58c0c8f4305f
  • Loading branch information...
1 parent 97f42cd commit 22da5b8340ab5ca21e32606cddd5fb4c80adadc9 haad committed Feb 27, 2010
Showing with 36,368 additions and 15,021 deletions.
  1. +1,240 −726 external/cddl/osnet/dist/cmd/zdb/zdb.c
  2. +84 −63 external/cddl/osnet/dist/cmd/zdb/zdb_il.c
  3. +67 −13 external/cddl/osnet/dist/cmd/zfs/zfs_iter.c
  4. +4 −2 external/cddl/osnet/dist/cmd/zfs/zfs_iter.h
  5. +482 −514 external/cddl/osnet/dist/cmd/zfs/zfs_main.c
  6. +680 −319 external/cddl/osnet/dist/cmd/zpool/zpool_main.c
  7. +1 −19 external/cddl/osnet/dist/cmd/zpool/zpool_util.c
  8. +3 −2 external/cddl/osnet/dist/cmd/zpool/zpool_util.h
  9. +81 −12 external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c
  10. +3,639 −1,548 external/cddl/osnet/dist/cmd/ztest/ztest.c
  11. +2 −5 external/cddl/osnet/dist/common/avl/avl.c
  12. +49 −3 external/cddl/osnet/dist/common/nvpair/nvpair.c
  13. +43 −3 external/cddl/osnet/dist/common/zfs/zfs_comutil.c
  14. +3 −4 external/cddl/osnet/dist/common/zfs/zfs_comutil.h
  15. +7 −4 external/cddl/osnet/dist/common/zfs/zfs_deleg.c
  16. +7 −3 external/cddl/osnet/dist/common/zfs/zfs_deleg.h
  17. +246 −0 external/cddl/osnet/dist/common/zfs/zfs_fletcher.c
  18. +53 −0 external/cddl/osnet/dist/common/zfs/zfs_fletcher.h
  19. +2 −20 external/cddl/osnet/dist/common/zfs/zfs_namecheck.c
  20. +1 −4 external/cddl/osnet/dist/common/zfs/zfs_namecheck.h
  21. +89 −8 external/cddl/osnet/dist/common/zfs/zfs_prop.c
  22. +3 −3 external/cddl/osnet/dist/common/zfs/zfs_prop.h
  23. +17 −5 external/cddl/osnet/dist/common/zfs/zpool_prop.c
  24. +26 −7 external/cddl/osnet/dist/common/zfs/zprop_common.c
  25. +8 −7 external/cddl/osnet/dist/lib/libdtrace/common/drti.c
  26. +2 −4 external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c
  27. +3 −4 external/cddl/osnet/dist/lib/libdtrace/common/dt_error.c
  28. +4 −13 external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h
  29. +11 −5 external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c
  30. +2 −2 external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c
  31. +20 −5 external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c
  32. +13 −12 external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c
  33. +4 −3 external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c
  34. +13 −37 external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c
  35. +152 −3 external/cddl/osnet/dist/lib/libnvpair/libnvpair.c
  36. +2 −3 external/cddl/osnet/dist/lib/libnvpair/libnvpair.h
  37. +1 −3 external/cddl/osnet/dist/lib/libshare/common/libshare.h
  38. +166 −45 external/cddl/osnet/dist/lib/libzfs/common/libzfs.h
  39. +50 −38 external/cddl/osnet/dist/lib/libzfs/common/libzfs_changelist.c
  40. +16 −6 external/cddl/osnet/dist/lib/libzfs/common/libzfs_config.c
  41. +1,411 −1,467 external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c
  42. +452 −0 external/cddl/osnet/dist/lib/libzfs/common/libzfs_fru.c
  43. +1 −10 external/cddl/osnet/dist/lib/libzfs/common/libzfs_graph.c
  44. +24 −5 external/cddl/osnet/dist/lib/libzfs/common/libzfs_impl.h
  45. +441 −74 external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c
  46. +45 −55 external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c
  47. +961 −336 external/cddl/osnet/dist/lib/libzfs/common/libzfs_pool.c
  48. +751 −121 external/cddl/osnet/dist/lib/libzfs/common/libzfs_sendrecv.c
  49. +79 −1 external/cddl/osnet/dist/lib/libzfs/common/libzfs_status.c
  50. +70 −20 external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c
  51. +28 −3 external/cddl/osnet/dist/lib/libzpool/common/taskq.c
  52. +26 −6 external/cddl/osnet/dist/tools/ctf/cvt/ctf.c
  53. +4 −5 external/cddl/osnet/dist/tools/ctf/cvt/tdata.c
  54. +59 −21 external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
  55. +8 −6 external/cddl/osnet/dist/uts/common/dtrace/fasttrap.c
  56. +3 −2 external/cddl/osnet/dist/uts/common/dtrace/lockstat.c
  57. +3 −2 external/cddl/osnet/dist/uts/common/dtrace/profile.c
  58. +235 −3 external/cddl/osnet/dist/uts/common/dtrace/sdt_subr.c
  59. +4 −3 external/cddl/osnet/dist/uts/common/dtrace/systrace.c
  60. +518 −362 external/cddl/osnet/dist/uts/common/fs/zfs/arc.c
  61. +32 −12 external/cddl/osnet/dist/uts/common/fs/zfs/bplist.c
  62. +330 −256 external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c
  63. +1,064 −0 external/cddl/osnet/dist/uts/common/fs/zfs/ddt.c
  64. +150 −0 external/cddl/osnet/dist/uts/common/fs/zfs/ddt_zap.c
  65. +503 −202 external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c
  66. +50 −19 external/cddl/osnet/dist/uts/common/fs/zfs/dmu_object.c
  67. +629 −384 external/cddl/osnet/dist/uts/common/fs/zfs/dmu_objset.c
  68. +562 −310 external/cddl/osnet/dist/uts/common/fs/zfs/dmu_send.c
  69. +123 −76 external/cddl/osnet/dist/uts/common/fs/zfs/dmu_traverse.c
  70. +196 −58 external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c
  71. +89 −16 external/cddl/osnet/dist/uts/common/fs/zfs/dmu_zfetch.c
  72. +85 −70 external/cddl/osnet/dist/uts/common/fs/zfs/dnode.c
  73. +47 −22 external/cddl/osnet/dist/uts/common/fs/zfs/dnode_sync.c
  74. +1,074 −414 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c
  75. +14 −8 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_deleg.c
  76. +152 −78 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dir.c
  77. +222 −38 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_pool.c
  78. +713 −157 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_prop.c
  79. +319 −133 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_scrub.c
  80. +4 −4 external/cddl/osnet/dist/uts/common/fs/zfs/dsl_synctask.c
  81. +13 −17 external/cddl/osnet/dist/uts/common/fs/zfs/lzjb.c
  82. +692 −137 external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c
  83. +27 −12 external/cddl/osnet/dist/uts/common/fs/zfs/rrwlock.c
  84. +20 −99 external/cddl/osnet/dist/uts/common/fs/zfs/sha256.c
  85. +2,261 −961 external/cddl/osnet/dist/uts/common/fs/zfs/spa.c
  86. +93 −28 external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c
  87. +6 −9 external/cddl/osnet/dist/uts/common/fs/zfs/spa_errlog.c
  88. +56 −14 external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c
  89. +254 −116 external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c
  90. +172 −62 external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c
  91. +25 −22 external/cddl/osnet/dist/uts/common/fs/zfs/sys/arc.h
  92. +10 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/bplist.h
  93. +7 −4 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dbuf.h
  94. +240 −0 external/cddl/osnet/dist/uts/common/fs/zfs/sys/ddt.h
  95. +118 −42 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h
  96. +36 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_impl.h
  97. +53 −30 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_objset.h
  98. +8 −5 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_traverse.h
  99. +11 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_tx.h
  100. +4 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_zfetch.h
  101. +14 −11 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dnode.h
  102. +51 −28 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_dataset.h
  103. +7 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_deleg.h
  104. +8 −4 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_dir.h
  105. +23 −7 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_pool.h
  106. +45 −7 external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_prop.h
  107. +16 −6 external/cddl/osnet/dist/uts/common/fs/zfs/sys/metaslab.h
  108. +12 −4 external/cddl/osnet/dist/uts/common/fs/zfs/sys/metaslab_impl.h
  109. +193 −57 external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa.h
  110. +1 −4 external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_boot.h
  111. +57 −21 external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h
  112. +23 −6 external/cddl/osnet/dist/uts/common/fs/zfs/sys/space_map.h
  113. +5 −5 external/cddl/osnet/dist/uts/common/fs/zfs/sys/txg.h
  114. +4 −2 external/cddl/osnet/dist/uts/common/fs/zfs/sys/txg_impl.h
  115. +3 −7 external/cddl/osnet/dist/uts/common/fs/zfs/sys/uberblock.h
  116. +1 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/uberblock_impl.h
  117. +30 −11 external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev.h
  118. +32 −23 external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev_impl.h
  119. +41 −7 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zap.h
  120. +17 −10 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zap_impl.h
  121. +17 −17 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zap_leaf.h
  122. +20 −10 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_acl.h
  123. +3 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h
  124. +2 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_ctldir.h
  125. +3 −5 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_dir.h
  126. +18 −12 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_fuid.h
  127. +110 −10 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_ioctl.h
  128. +21 −7 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h
  129. +9 −3 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h
  130. +86 −40 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zil.h
  131. +25 −12 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zil_impl.h
  132. +243 −108 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio.h
  133. +14 −11 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio_checksum.h
  134. +9 −7 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio_compress.h
  135. +107 −75 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio_impl.h
  136. +3 −5 external/cddl/osnet/dist/uts/common/fs/zfs/sys/zvol.h
  137. +105 −34 external/cddl/osnet/dist/uts/common/fs/zfs/txg.c
  138. +983 −342 external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c
  139. +17 −26 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_cache.c
  140. +49 −28 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c
  141. +17 −4 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_file.c
  142. +140 −38 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_label.c
  143. +34 −35 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_mirror.c
  144. +14 −3 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_missing.c
  145. +154 −56 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_queue.c
  146. +1,242 −307 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_raidz.c
  147. +7 −11 external/cddl/osnet/dist/uts/common/fs/zfs/vdev_root.c
  148. +148 −23 external/cddl/osnet/dist/uts/common/fs/zfs/zap.c
  149. +94 −67 external/cddl/osnet/dist/uts/common/fs/zfs/zap_leaf.c
  150. +439 −85 external/cddl/osnet/dist/uts/common/fs/zfs/zap_micro.c
  151. +410 −218 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_acl.c
  152. +28 −5 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_byteswap.c
  153. +200 −24 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
  154. +51 −44 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_dir.c
  155. +528 −27 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_fm.c
  156. +145 −99 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_fuid.c
  157. +2,057 −616 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c
  158. +39 −47 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c
  159. +73 −47 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c
  160. +3 −3 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c
  161. +666 −117 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
  162. +946 −541 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
  163. +180 −141 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c
  164. +623 −614 external/cddl/osnet/dist/uts/common/fs/zfs/zil.c
  165. +1,059 −409 external/cddl/osnet/dist/uts/common/fs/zfs/zio.c
  166. +103 −35 external/cddl/osnet/dist/uts/common/fs/zfs/zio_checksum.c
  167. +41 −57 external/cddl/osnet/dist/uts/common/fs/zfs/zio_compress.c
  168. +149 −12 external/cddl/osnet/dist/uts/common/fs/zfs/zio_inject.c
  169. +86 −0 external/cddl/osnet/dist/uts/common/fs/zfs/zle.c
  170. +434 −337 external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c
  171. +50 −1 external/cddl/osnet/dist/uts/common/rpc/xdr.c
  172. +8 −6 external/cddl/osnet/dist/uts/common/rpc/xdr.h
  173. +5 −3 external/cddl/osnet/dist/uts/common/sys/acl.h
  174. +4 −3 external/cddl/osnet/dist/uts/common/sys/attr.h
  175. +2 −4 external/cddl/osnet/dist/uts/common/sys/avl.h
  176. +4 −5 external/cddl/osnet/dist/uts/common/sys/byteorder.h
  177. +5 −7 external/cddl/osnet/dist/uts/common/sys/callb.h
  178. +2 −15 external/cddl/osnet/dist/uts/common/sys/cpupart.h
  179. +104 −6 external/cddl/osnet/dist/uts/common/sys/cpuvar.h
  180. +10 −3 external/cddl/osnet/dist/uts/common/sys/cred.h
  181. +28 −12 external/cddl/osnet/dist/uts/common/sys/debug.h
  182. +2 −2 external/cddl/osnet/dist/uts/common/sys/dklabel.h
  183. +19 −6 external/cddl/osnet/dist/uts/common/sys/dtrace.h
  184. +15 −3 external/cddl/osnet/dist/uts/common/sys/fm/fs/zfs.h
  185. +16 −6 external/cddl/osnet/dist/uts/common/sys/fm/protocol.h
  186. +199 −35 external/cddl/osnet/dist/uts/common/sys/fs/zfs.h
  187. +17 −11 external/cddl/osnet/dist/uts/common/sys/mnttab.h
  188. +4 −3 external/cddl/osnet/dist/uts/common/sys/nvpair.h
  189. +7 −4 external/cddl/osnet/dist/uts/common/sys/priv.h
  190. +150 −0 external/cddl/osnet/dist/uts/common/sys/processor.h
  191. +98 −3 external/cddl/osnet/dist/uts/common/sys/sdt.h
  192. +89 −34 external/cddl/osnet/dist/uts/common/sys/sysevent.h
  193. +30 −2 external/cddl/osnet/dist/uts/common/sys/sysevent/eventdefs.h
  194. +10 −8 external/cddl/osnet/dist/uts/common/sys/systeminfo.h
  195. +13 −6 external/cddl/osnet/dist/uts/common/sys/taskq.h
  196. +28 −12 external/cddl/osnet/dist/uts/common/sys/taskq_impl.h
  197. +27 −7 external/cddl/osnet/dist/uts/common/sys/tsol/label.h
  198. +2 −2 external/cddl/osnet/dist/uts/common/sys/vtoc.h

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -19,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Print intent log header and statistics.
*/
@@ -42,12 +40,14 @@
extern uint8_t dump_opt[256];
+static char prefix[4] = "\t\t\t";
+
static void
print_log_bp(const blkptr_t *bp, const char *prefix)
{
char blkbuf[BP_SPRINTF_LEN];
- sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, bp);
+ sprintf_blkptr(blkbuf, bp);
(void) printf("%s%s\n", prefix, blkbuf);
}
@@ -56,19 +56,29 @@ static void
zil_prt_rec_create(zilog_t *zilog, int txtype, lr_create_t *lr)
{
time_t crtime = lr->lr_crtime[0];
- char *name = (char *)(lr + 1);
- char *link = name + strlen(name) + 1;
+ char *name, *link;
+ lr_attr_t *lrattr;
- if (txtype == TX_SYMLINK)
- (void) printf("\t\t\t%s -> %s\n", name, link);
- else
- (void) printf("\t\t\t%s\n", name);
+ name = (char *)(lr + 1);
- (void) printf("\t\t\t%s", ctime(&crtime));
- (void) printf("\t\t\tdoid %llu, foid %llu, mode %llo\n",
+ if (lr->lr_common.lrc_txtype == TX_CREATE_ATTR ||
+ lr->lr_common.lrc_txtype == TX_MKDIR_ATTR) {
+ lrattr = (lr_attr_t *)(lr + 1);
+ name += ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
+ }
+
+ if (txtype == TX_SYMLINK) {
+ link = name + strlen(name) + 1;
+ (void) printf("%s%s -> %s\n", prefix, name, link);
+ } else if (txtype != TX_MKXATTR) {
+ (void) printf("%s%s\n", prefix, name);
+ }
+
+ (void) printf("%s%s", prefix, ctime(&crtime));
+ (void) printf("%sdoid %llu, foid %llu, mode %llo\n", prefix,
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_foid,
(longlong_t)lr->lr_mode);
- (void) printf("\t\t\tuid %llu, gid %llu, gen %llu, rdev 0x%llx\n",
+ (void) printf("%suid %llu, gid %llu, gen %llu, rdev 0x%llx\n", prefix,
(u_longlong_t)lr->lr_uid, (u_longlong_t)lr->lr_gid,
(u_longlong_t)lr->lr_gen, (u_longlong_t)lr->lr_rdev);
}
@@ -77,15 +87,15 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, lr_create_t *lr)
static void
zil_prt_rec_remove(zilog_t *zilog, int txtype, lr_remove_t *lr)
{
- (void) printf("\t\t\tdoid %llu, name %s\n",
+ (void) printf("%sdoid %llu, name %s\n", prefix,
(u_longlong_t)lr->lr_doid, (char *)(lr + 1));
}
/* ARGSUSED */
static void
zil_prt_rec_link(zilog_t *zilog, int txtype, lr_link_t *lr)
{
- (void) printf("\t\t\tdoid %llu, link_obj %llu, name %s\n",
+ (void) printf("%sdoid %llu, link_obj %llu, name %s\n", prefix,
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
(char *)(lr + 1));
}
@@ -97,9 +107,9 @@ zil_prt_rec_rename(zilog_t *zilog, int txtype, lr_rename_t *lr)
char *snm = (char *)(lr + 1);
char *tnm = snm + strlen(snm) + 1;
- (void) printf("\t\t\tsdoid %llu, tdoid %llu\n",
+ (void) printf("%ssdoid %llu, tdoid %llu\n", prefix,
(u_longlong_t)lr->lr_sdoid, (u_longlong_t)lr->lr_tdoid);
- (void) printf("\t\t\tsrc %s tgt %s\n", snm, tnm);
+ (void) printf("%ssrc %s tgt %s\n", prefix, snm, tnm);
}
/* ARGSUSED */
@@ -108,51 +118,56 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
{
char *data, *dlimit;
blkptr_t *bp = &lr->lr_blkptr;
+ zbookmark_t zb;
char buf[SPA_MAXBLOCKSIZE];
int verbose = MAX(dump_opt['d'], dump_opt['i']);
int error;
- (void) printf("\t\t\tfoid %llu, offset 0x%llx,"
- " length 0x%llx, blkoff 0x%llx\n",
- (u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset,
- (u_longlong_t)lr->lr_length, (u_longlong_t)lr->lr_blkoff);
+ (void) printf("%sfoid %llu, offset %llx, length %llx\n", prefix,
+ (u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_offset,
+ (u_longlong_t)lr->lr_length);
- if (verbose < 5)
+ if (txtype == TX_WRITE2 || verbose < 5)
return;
if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
- (void) printf("\t\t\thas blkptr, %s\n",
+ (void) printf("%shas blkptr, %s\n", prefix,
bp->blk_birth >= spa_first_txg(zilog->zl_spa) ?
"will claim" : "won't claim");
- print_log_bp(bp, "\t\t\t");
+ print_log_bp(bp, prefix);
+
+ if (BP_IS_HOLE(bp)) {
+ (void) printf("\t\t\tLSIZE 0x%llx\n",
+ (u_longlong_t)BP_GET_LSIZE(bp));
+ }
if (bp->blk_birth == 0) {
bzero(buf, sizeof (buf));
- } else {
- zbookmark_t zb;
-
- ASSERT3U(bp->blk_cksum.zc_word[ZIL_ZC_OBJSET], ==,
- dmu_objset_id(zilog->zl_os));
-
- zb.zb_objset = bp->blk_cksum.zc_word[ZIL_ZC_OBJSET];
- zb.zb_object = 0;
- zb.zb_level = -1;
- zb.zb_blkid = bp->blk_cksum.zc_word[ZIL_ZC_SEQ];
-
- error = zio_wait(zio_read(NULL, zilog->zl_spa,
- bp, buf, BP_GET_LSIZE(bp), NULL, NULL,
- ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &zb));
- if (error)
- return;
+ (void) printf("%s<hole>\n", prefix);
+ return;
}
- data = buf + lr->lr_blkoff;
+ if (bp->blk_birth < zilog->zl_header->zh_claim_txg) {
+ (void) printf("%s<block already committed>\n", prefix);
+ return;
+ }
+
+ SET_BOOKMARK(&zb, dmu_objset_id(zilog->zl_os),
+ lr->lr_foid, ZB_ZIL_LEVEL,
+ lr->lr_offset / BP_GET_LSIZE(bp));
+
+ error = zio_wait(zio_read(NULL, zilog->zl_spa,
+ bp, buf, BP_GET_LSIZE(bp), NULL, NULL,
+ ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &zb));
+ if (error)
+ return;
+ data = buf;
} else {
data = (char *)(lr + 1);
}
dlimit = data + MIN(lr->lr_length,
(verbose < 6 ? 20 : SPA_MAXBLOCKSIZE));
- (void) printf("\t\t\t");
+ (void) printf("%s", prefix);
while (data < dlimit) {
if (isprint(*data))
(void) printf("%c ", *data);
@@ -167,7 +182,7 @@ zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
static void
zil_prt_rec_truncate(zilog_t *zilog, int txtype, lr_truncate_t *lr)
{
- (void) printf("\t\t\tfoid %llu, offset 0x%llx, length 0x%llx\n",
+ (void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", prefix,
(u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset,
(u_longlong_t)lr->lr_length);
}
@@ -179,38 +194,38 @@ zil_prt_rec_setattr(zilog_t *zilog, int txtype, lr_setattr_t *lr)
time_t atime = (time_t)lr->lr_atime[0];
time_t mtime = (time_t)lr->lr_mtime[0];
- (void) printf("\t\t\tfoid %llu, mask 0x%llx\n",
+ (void) printf("%sfoid %llu, mask 0x%llx\n", prefix,
(u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_mask);
if (lr->lr_mask & AT_MODE) {
- (void) printf("\t\t\tAT_MODE %llo\n",
+ (void) printf("%sAT_MODE %llo\n", prefix,
(longlong_t)lr->lr_mode);
}
if (lr->lr_mask & AT_UID) {
- (void) printf("\t\t\tAT_UID %llu\n",
+ (void) printf("%sAT_UID %llu\n", prefix,
(u_longlong_t)lr->lr_uid);
}
if (lr->lr_mask & AT_GID) {
- (void) printf("\t\t\tAT_GID %llu\n",
+ (void) printf("%sAT_GID %llu\n", prefix,
(u_longlong_t)lr->lr_gid);
}
if (lr->lr_mask & AT_SIZE) {
- (void) printf("\t\t\tAT_SIZE %llu\n",
+ (void) printf("%sAT_SIZE %llu\n", prefix,
(u_longlong_t)lr->lr_size);
}
if (lr->lr_mask & AT_ATIME) {
- (void) printf("\t\t\tAT_ATIME %llu.%09llu %s",
+ (void) printf("%sAT_ATIME %llu.%09llu %s", prefix,
(u_longlong_t)lr->lr_atime[0],
(u_longlong_t)lr->lr_atime[1],
ctime(&atime));
}
if (lr->lr_mask & AT_MTIME) {
- (void) printf("\t\t\tAT_MTIME %llu.%09llu %s",
+ (void) printf("%sAT_MTIME %llu.%09llu %s", prefix,
(u_longlong_t)lr->lr_mtime[0],
(u_longlong_t)lr->lr_mtime[1],
ctime(&mtime));
@@ -221,7 +236,7 @@ zil_prt_rec_setattr(zilog_t *zilog, int txtype, lr_setattr_t *lr)
static void
zil_prt_rec_acl(zilog_t *zilog, int txtype, lr_acl_t *lr)
{
- (void) printf("\t\t\tfoid %llu, aclcnt %llu\n",
+ (void) printf("%sfoid %llu, aclcnt %llu\n", prefix,
(u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_aclcnt);
}
@@ -253,10 +268,11 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = {
{ zil_prt_rec_create, "TX_MKDIR_ACL " },
{ zil_prt_rec_create, "TX_MKDIR_ATTR " },
{ zil_prt_rec_create, "TX_MKDIR_ACL_ATTR " },
+ { zil_prt_rec_write, "TX_WRITE2 " },
};
/* ARGSUSED */
-static void
+static int
print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg)
{
int txtype;
@@ -280,23 +296,24 @@ print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg)
zil_rec_info[txtype].zri_count++;
zil_rec_info[0].zri_count++;
+
+ return (0);
}
/* ARGSUSED */
-static void
+static int
print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
{
- char blkbuf[BP_SPRINTF_LEN];
+ char blkbuf[BP_SPRINTF_LEN + 10];
int verbose = MAX(dump_opt['d'], dump_opt['i']);
char *claim;
if (verbose <= 3)
- return;
+ return (0);
if (verbose >= 5) {
(void) strcpy(blkbuf, ", ");
- sprintf_blkptr(blkbuf + strlen(blkbuf),
- BP_SPRINTF_LEN - strlen(blkbuf), bp);
+ sprintf_blkptr(blkbuf + strlen(blkbuf), bp);
} else {
blkbuf[0] = '\0';
}
@@ -310,6 +327,8 @@ print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
(void) printf("\tBlock seqno %llu, %s%s\n",
(u_longlong_t)bp->blk_cksum.zc_word[ZIL_ZC_SEQ], claim, blkbuf);
+
+ return (0);
}
static void
@@ -342,14 +361,16 @@ dump_intent_log(zilog_t *zilog)
int verbose = MAX(dump_opt['d'], dump_opt['i']);
int i;
- if (zh->zh_log.blk_birth == 0 || verbose < 2)
+ if (zh->zh_log.blk_birth == 0 || verbose < 1)
return;
- (void) printf("\n ZIL header: claim_txg %llu, seq %llu\n",
- (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_replay_seq);
-
- if (verbose >= 4)
- print_log_bp(&zh->zh_log, "\n\tfirst block: ");
+ (void) printf("\n ZIL header: claim_txg %llu, "
+ "claim_blk_seq %llu, claim_lr_seq %llu",
+ (u_longlong_t)zh->zh_claim_txg,
+ (u_longlong_t)zh->zh_claim_blk_seq,
+ (u_longlong_t)zh->zh_claim_lr_seq);
+ (void) printf(" replay_seq %llu, flags 0x%llx\n",
+ (u_longlong_t)zh->zh_replay_seq, (u_longlong_t)zh->zh_flags);
for (i = 0; i < TX_MAX_TYPE; i++)
zil_rec_info[i].zri_count = 0;
Oops, something went wrong.

0 comments on commit 22da5b8

Please sign in to comment.