dmu.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. /*
  20. * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
  21. * Use is subject to license terms.
  22. */
  23. #ifndef _SYS_DMU_H
  24. #define _SYS_DMU_H
  25. /*
  26. * This file describes the interface that the DMU provides for its
  27. * consumers.
  28. *
  29. * The DMU also interacts with the SPA. That interface is described in
  30. * dmu_spa.h.
  31. */
  32. typedef enum dmu_object_type {
  33. DMU_OT_NONE,
  34. /* general: */
  35. DMU_OT_OBJECT_DIRECTORY, /* ZAP */
  36. DMU_OT_OBJECT_ARRAY, /* UINT64 */
  37. DMU_OT_PACKED_NVLIST, /* UINT8 (XDR by nvlist_pack/unpack) */
  38. DMU_OT_PACKED_NVLIST_SIZE, /* UINT64 */
  39. DMU_OT_BPLIST, /* UINT64 */
  40. DMU_OT_BPLIST_HDR, /* UINT64 */
  41. /* spa: */
  42. DMU_OT_SPACE_MAP_HEADER, /* UINT64 */
  43. DMU_OT_SPACE_MAP, /* UINT64 */
  44. /* zil: */
  45. DMU_OT_INTENT_LOG, /* UINT64 */
  46. /* dmu: */
  47. DMU_OT_DNODE, /* DNODE */
  48. DMU_OT_OBJSET, /* OBJSET */
  49. /* dsl: */
  50. DMU_OT_DSL_DIR, /* UINT64 */
  51. DMU_OT_DSL_DIR_CHILD_MAP, /* ZAP */
  52. DMU_OT_DSL_DS_SNAP_MAP, /* ZAP */
  53. DMU_OT_DSL_PROPS, /* ZAP */
  54. DMU_OT_DSL_DATASET, /* UINT64 */
  55. /* zpl: */
  56. DMU_OT_ZNODE, /* ZNODE */
  57. DMU_OT_OLDACL, /* OLD ACL */
  58. DMU_OT_PLAIN_FILE_CONTENTS, /* UINT8 */
  59. DMU_OT_DIRECTORY_CONTENTS, /* ZAP */
  60. DMU_OT_MASTER_NODE, /* ZAP */
  61. DMU_OT_UNLINKED_SET, /* ZAP */
  62. /* zvol: */
  63. DMU_OT_ZVOL, /* UINT8 */
  64. DMU_OT_ZVOL_PROP, /* ZAP */
  65. /* other; for testing only! */
  66. DMU_OT_PLAIN_OTHER, /* UINT8 */
  67. DMU_OT_UINT64_OTHER, /* UINT64 */
  68. DMU_OT_ZAP_OTHER, /* ZAP */
  69. /* new object types: */
  70. DMU_OT_ERROR_LOG, /* ZAP */
  71. DMU_OT_SPA_HISTORY, /* UINT8 */
  72. DMU_OT_SPA_HISTORY_OFFSETS, /* spa_his_phys_t */
  73. DMU_OT_POOL_PROPS, /* ZAP */
  74. DMU_OT_DSL_PERMS, /* ZAP */
  75. DMU_OT_ACL, /* ACL */
  76. DMU_OT_SYSACL, /* SYSACL */
  77. DMU_OT_FUID, /* FUID table (Packed NVLIST UINT8) */
  78. DMU_OT_FUID_SIZE, /* FUID table size UINT64 */
  79. DMU_OT_NEXT_CLONES, /* ZAP */
  80. DMU_OT_SCRUB_QUEUE, /* ZAP */
  81. DMU_OT_USERGROUP_USED, /* ZAP */
  82. DMU_OT_USERGROUP_QUOTA, /* ZAP */
  83. DMU_OT_USERREFS, /* ZAP */
  84. DMU_OT_DDT_ZAP, /* ZAP */
  85. DMU_OT_DDT_STATS, /* ZAP */
  86. DMU_OT_SA, /* System attr */
  87. DMU_OT_SA_MASTER_NODE, /* ZAP */
  88. DMU_OT_SA_ATTR_REGISTRATION, /* ZAP */
  89. DMU_OT_SA_ATTR_LAYOUTS, /* ZAP */
  90. DMU_OT_NUMTYPES
  91. } dmu_object_type_t;
  92. typedef enum dmu_objset_type {
  93. DMU_OST_NONE,
  94. DMU_OST_META,
  95. DMU_OST_ZFS,
  96. DMU_OST_ZVOL,
  97. DMU_OST_OTHER, /* For testing only! */
  98. DMU_OST_ANY, /* Be careful! */
  99. DMU_OST_NUMTYPES
  100. } dmu_objset_type_t;
  101. /*
  102. * The names of zap entries in the DIRECTORY_OBJECT of the MOS.
  103. */
  104. #define DMU_POOL_DIRECTORY_OBJECT 1
  105. #define DMU_POOL_CONFIG "config"
  106. #define DMU_POOL_ROOT_DATASET "root_dataset"
  107. #define DMU_POOL_SYNC_BPLIST "sync_bplist"
  108. #define DMU_POOL_ERRLOG_SCRUB "errlog_scrub"
  109. #define DMU_POOL_ERRLOG_LAST "errlog_last"
  110. #define DMU_POOL_SPARES "spares"
  111. #define DMU_POOL_DEFLATE "deflate"
  112. #define DMU_POOL_HISTORY "history"
  113. #define DMU_POOL_PROPS "pool_props"
  114. #define DMU_POOL_L2CACHE "l2cache"
  115. #endif /* _SYS_DMU_H */