dmu.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
  5. */
  6. /*
  7. * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
  8. * Use is subject to license terms.
  9. */
  10. #ifndef _SYS_DMU_H
  11. #define _SYS_DMU_H
  12. /*
  13. * This file describes the interface that the DMU provides for its
  14. * consumers.
  15. *
  16. * The DMU also interacts with the SPA. That interface is described in
  17. * dmu_spa.h.
  18. */
  19. typedef enum dmu_object_type {
  20. DMU_OT_NONE,
  21. /* general: */
  22. DMU_OT_OBJECT_DIRECTORY, /* ZAP */
  23. DMU_OT_OBJECT_ARRAY, /* UINT64 */
  24. DMU_OT_PACKED_NVLIST, /* UINT8 (XDR by nvlist_pack/unpack) */
  25. DMU_OT_PACKED_NVLIST_SIZE, /* UINT64 */
  26. DMU_OT_BPLIST, /* UINT64 */
  27. DMU_OT_BPLIST_HDR, /* UINT64 */
  28. /* spa: */
  29. DMU_OT_SPACE_MAP_HEADER, /* UINT64 */
  30. DMU_OT_SPACE_MAP, /* UINT64 */
  31. /* zil: */
  32. DMU_OT_INTENT_LOG, /* UINT64 */
  33. /* dmu: */
  34. DMU_OT_DNODE, /* DNODE */
  35. DMU_OT_OBJSET, /* OBJSET */
  36. /* dsl: */
  37. DMU_OT_DSL_DIR, /* UINT64 */
  38. DMU_OT_DSL_DIR_CHILD_MAP, /* ZAP */
  39. DMU_OT_DSL_DS_SNAP_MAP, /* ZAP */
  40. DMU_OT_DSL_PROPS, /* ZAP */
  41. DMU_OT_DSL_DATASET, /* UINT64 */
  42. /* zpl: */
  43. DMU_OT_ZNODE, /* ZNODE */
  44. DMU_OT_OLDACL, /* OLD ACL */
  45. DMU_OT_PLAIN_FILE_CONTENTS, /* UINT8 */
  46. DMU_OT_DIRECTORY_CONTENTS, /* ZAP */
  47. DMU_OT_MASTER_NODE, /* ZAP */
  48. DMU_OT_UNLINKED_SET, /* ZAP */
  49. /* zvol: */
  50. DMU_OT_ZVOL, /* UINT8 */
  51. DMU_OT_ZVOL_PROP, /* ZAP */
  52. /* other; for testing only! */
  53. DMU_OT_PLAIN_OTHER, /* UINT8 */
  54. DMU_OT_UINT64_OTHER, /* UINT64 */
  55. DMU_OT_ZAP_OTHER, /* ZAP */
  56. /* new object types: */
  57. DMU_OT_ERROR_LOG, /* ZAP */
  58. DMU_OT_SPA_HISTORY, /* UINT8 */
  59. DMU_OT_SPA_HISTORY_OFFSETS, /* spa_his_phys_t */
  60. DMU_OT_POOL_PROPS, /* ZAP */
  61. DMU_OT_DSL_PERMS, /* ZAP */
  62. DMU_OT_ACL, /* ACL */
  63. DMU_OT_SYSACL, /* SYSACL */
  64. DMU_OT_FUID, /* FUID table (Packed NVLIST UINT8) */
  65. DMU_OT_FUID_SIZE, /* FUID table size UINT64 */
  66. DMU_OT_NEXT_CLONES, /* ZAP */
  67. DMU_OT_SCRUB_QUEUE, /* ZAP */
  68. DMU_OT_USERGROUP_USED, /* ZAP */
  69. DMU_OT_USERGROUP_QUOTA, /* ZAP */
  70. DMU_OT_USERREFS, /* ZAP */
  71. DMU_OT_DDT_ZAP, /* ZAP */
  72. DMU_OT_DDT_STATS, /* ZAP */
  73. DMU_OT_SA, /* System attr */
  74. DMU_OT_SA_MASTER_NODE, /* ZAP */
  75. DMU_OT_SA_ATTR_REGISTRATION, /* ZAP */
  76. DMU_OT_SA_ATTR_LAYOUTS, /* ZAP */
  77. DMU_OT_NUMTYPES
  78. } dmu_object_type_t;
  79. typedef enum dmu_objset_type {
  80. DMU_OST_NONE,
  81. DMU_OST_META,
  82. DMU_OST_ZFS,
  83. DMU_OST_ZVOL,
  84. DMU_OST_OTHER, /* For testing only! */
  85. DMU_OST_ANY, /* Be careful! */
  86. DMU_OST_NUMTYPES
  87. } dmu_objset_type_t;
  88. /*
  89. * The names of zap entries in the DIRECTORY_OBJECT of the MOS.
  90. */
  91. #define DMU_POOL_DIRECTORY_OBJECT 1
  92. #define DMU_POOL_CONFIG "config"
  93. #define DMU_POOL_ROOT_DATASET "root_dataset"
  94. #define DMU_POOL_SYNC_BPLIST "sync_bplist"
  95. #define DMU_POOL_ERRLOG_SCRUB "errlog_scrub"
  96. #define DMU_POOL_ERRLOG_LAST "errlog_last"
  97. #define DMU_POOL_SPARES "spares"
  98. #define DMU_POOL_DEFLATE "deflate"
  99. #define DMU_POOL_HISTORY "history"
  100. #define DMU_POOL_PROPS "pool_props"
  101. #define DMU_POOL_L2CACHE "l2cache"
  102. #endif /* _SYS_DMU_H */