44 #include <sys/vmsystm.h> |
45 #include <sys/vmsystm.h> |
45 #include <sys/zfs_znode.h> |
46 #include <sys/zfs_znode.h> |
46 #endif |
47 #endif |
47 |
48 |
48 const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { |
49 const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { |
49 { byteswap_uint8_array, TRUE, "unallocated" }, |
50 { DMU_BSWAP_UINT8, TRUE, "unallocated" }, |
50 { zap_byteswap, TRUE, "object directory" }, |
51 { DMU_BSWAP_ZAP, TRUE, "object directory" }, |
51 { byteswap_uint64_array, TRUE, "object array" }, |
52 { DMU_BSWAP_UINT64, TRUE, "object array" }, |
52 { byteswap_uint8_array, TRUE, "packed nvlist" }, |
53 { DMU_BSWAP_UINT8, TRUE, "packed nvlist" }, |
53 { byteswap_uint64_array, TRUE, "packed nvlist size" }, |
54 { DMU_BSWAP_UINT64, TRUE, "packed nvlist size" }, |
54 { byteswap_uint64_array, TRUE, "bpobj" }, |
55 { DMU_BSWAP_UINT64, TRUE, "bpobj" }, |
55 { byteswap_uint64_array, TRUE, "bpobj header" }, |
56 { DMU_BSWAP_UINT64, TRUE, "bpobj header" }, |
56 { byteswap_uint64_array, TRUE, "SPA space map header" }, |
57 { DMU_BSWAP_UINT64, TRUE, "SPA space map header" }, |
57 { byteswap_uint64_array, TRUE, "SPA space map" }, |
58 { DMU_BSWAP_UINT64, TRUE, "SPA space map" }, |
58 { byteswap_uint64_array, TRUE, "ZIL intent log" }, |
59 { DMU_BSWAP_UINT64, TRUE, "ZIL intent log" }, |
59 { dnode_buf_byteswap, TRUE, "DMU dnode" }, |
60 { DMU_BSWAP_DNODE, TRUE, "DMU dnode" }, |
60 { dmu_objset_byteswap, TRUE, "DMU objset" }, |
61 { DMU_BSWAP_OBJSET, TRUE, "DMU objset" }, |
61 { byteswap_uint64_array, TRUE, "DSL directory" }, |
62 { DMU_BSWAP_UINT64, TRUE, "DSL directory" }, |
62 { zap_byteswap, TRUE, "DSL directory child map"}, |
63 { DMU_BSWAP_ZAP, TRUE, "DSL directory child map"}, |
63 { zap_byteswap, TRUE, "DSL dataset snap map" }, |
64 { DMU_BSWAP_ZAP, TRUE, "DSL dataset snap map" }, |
64 { zap_byteswap, TRUE, "DSL props" }, |
65 { DMU_BSWAP_ZAP, TRUE, "DSL props" }, |
65 { byteswap_uint64_array, TRUE, "DSL dataset" }, |
66 { DMU_BSWAP_UINT64, TRUE, "DSL dataset" }, |
66 { zfs_znode_byteswap, TRUE, "ZFS znode" }, |
67 { DMU_BSWAP_ZNODE, TRUE, "ZFS znode" }, |
67 { zfs_oldacl_byteswap, TRUE, "ZFS V0 ACL" }, |
68 { DMU_BSWAP_OLDACL, TRUE, "ZFS V0 ACL" }, |
68 { byteswap_uint8_array, FALSE, "ZFS plain file" }, |
69 { DMU_BSWAP_UINT8, FALSE, "ZFS plain file" }, |
69 { zap_byteswap, TRUE, "ZFS directory" }, |
70 { DMU_BSWAP_ZAP, TRUE, "ZFS directory" }, |
70 { zap_byteswap, TRUE, "ZFS master node" }, |
71 { DMU_BSWAP_ZAP, TRUE, "ZFS master node" }, |
71 { zap_byteswap, TRUE, "ZFS delete queue" }, |
72 { DMU_BSWAP_ZAP, TRUE, "ZFS delete queue" }, |
72 { byteswap_uint8_array, FALSE, "zvol object" }, |
73 { DMU_BSWAP_UINT8, FALSE, "zvol object" }, |
73 { zap_byteswap, TRUE, "zvol prop" }, |
74 { DMU_BSWAP_ZAP, TRUE, "zvol prop" }, |
74 { byteswap_uint8_array, FALSE, "other uint8[]" }, |
75 { DMU_BSWAP_UINT8, FALSE, "other uint8[]" }, |
75 { byteswap_uint64_array, FALSE, "other uint64[]" }, |
76 { DMU_BSWAP_UINT64, FALSE, "other uint64[]" }, |
76 { zap_byteswap, TRUE, "other ZAP" }, |
77 { DMU_BSWAP_ZAP, TRUE, "other ZAP" }, |
77 { zap_byteswap, TRUE, "persistent error log" }, |
78 { DMU_BSWAP_ZAP, TRUE, "persistent error log" }, |
78 { byteswap_uint8_array, TRUE, "SPA history" }, |
79 { DMU_BSWAP_UINT8, TRUE, "SPA history" }, |
79 { byteswap_uint64_array, TRUE, "SPA history offsets" }, |
80 { DMU_BSWAP_UINT64, TRUE, "SPA history offsets" }, |
80 { zap_byteswap, TRUE, "Pool properties" }, |
81 { DMU_BSWAP_ZAP, TRUE, "Pool properties" }, |
81 { zap_byteswap, TRUE, "DSL permissions" }, |
82 { DMU_BSWAP_ZAP, TRUE, "DSL permissions" }, |
82 { zfs_acl_byteswap, TRUE, "ZFS ACL" }, |
83 { DMU_BSWAP_ACL, TRUE, "ZFS ACL" }, |
83 { byteswap_uint8_array, TRUE, "ZFS SYSACL" }, |
84 { DMU_BSWAP_UINT8, TRUE, "ZFS SYSACL" }, |
84 { byteswap_uint8_array, TRUE, "FUID table" }, |
85 { DMU_BSWAP_UINT8, TRUE, "FUID table" }, |
85 { byteswap_uint64_array, TRUE, "FUID table size" }, |
86 { DMU_BSWAP_UINT64, TRUE, "FUID table size" }, |
86 { zap_byteswap, TRUE, "DSL dataset next clones"}, |
87 { DMU_BSWAP_ZAP, TRUE, "DSL dataset next clones"}, |
87 { zap_byteswap, TRUE, "scan work queue" }, |
88 { DMU_BSWAP_ZAP, TRUE, "scan work queue" }, |
88 { zap_byteswap, TRUE, "ZFS user/group used" }, |
89 { DMU_BSWAP_ZAP, TRUE, "ZFS user/group used" }, |
89 { zap_byteswap, TRUE, "ZFS user/group quota" }, |
90 { DMU_BSWAP_ZAP, TRUE, "ZFS user/group quota" }, |
90 { zap_byteswap, TRUE, "snapshot refcount tags"}, |
91 { DMU_BSWAP_ZAP, TRUE, "snapshot refcount tags"}, |
91 { zap_byteswap, TRUE, "DDT ZAP algorithm" }, |
92 { DMU_BSWAP_ZAP, TRUE, "DDT ZAP algorithm" }, |
92 { zap_byteswap, TRUE, "DDT statistics" }, |
93 { DMU_BSWAP_ZAP, TRUE, "DDT statistics" }, |
93 { byteswap_uint8_array, TRUE, "System attributes" }, |
94 { DMU_BSWAP_UINT8, TRUE, "System attributes" }, |
94 { zap_byteswap, TRUE, "SA master node" }, |
95 { DMU_BSWAP_ZAP, TRUE, "SA master node" }, |
95 { zap_byteswap, TRUE, "SA attr registration" }, |
96 { DMU_BSWAP_ZAP, TRUE, "SA attr registration" }, |
96 { zap_byteswap, TRUE, "SA attr layouts" }, |
97 { DMU_BSWAP_ZAP, TRUE, "SA attr layouts" }, |
97 { zap_byteswap, TRUE, "scan translations" }, |
98 { DMU_BSWAP_ZAP, TRUE, "scan translations" }, |
98 { byteswap_uint8_array, FALSE, "deduplicated block" }, |
99 { DMU_BSWAP_UINT8, FALSE, "deduplicated block" }, |
99 { zap_byteswap, TRUE, "DSL deadlist map" }, |
100 { DMU_BSWAP_ZAP, TRUE, "DSL deadlist map" }, |
100 { byteswap_uint64_array, TRUE, "DSL deadlist map hdr" }, |
101 { DMU_BSWAP_UINT64, TRUE, "DSL deadlist map hdr" }, |
101 { zap_byteswap, TRUE, "DSL dir clones" }, |
102 { DMU_BSWAP_ZAP, TRUE, "DSL dir clones" }, |
102 { byteswap_uint64_array, TRUE, "bpobj subobj" }, |
103 { DMU_BSWAP_UINT64, TRUE, "bpobj subobj" } |
|
104 }; |
|
105 |
|
106 const dmu_object_byteswap_info_t dmu_ot_byteswap[DMU_BSWAP_NUMFUNCS] = { |
|
107 { byteswap_uint8_array, "uint8" }, |
|
108 { byteswap_uint16_array, "uint16" }, |
|
109 { byteswap_uint32_array, "uint32" }, |
|
110 { byteswap_uint64_array, "uint64" }, |
|
111 { zap_byteswap, "zap" }, |
|
112 { dnode_buf_byteswap, "dnode" }, |
|
113 { dmu_objset_byteswap, "objset" }, |
|
114 { zfs_znode_byteswap, "znode" }, |
|
115 { zfs_oldacl_byteswap, "oldacl" }, |
|
116 { zfs_acl_byteswap, "acl" } |
103 }; |
117 }; |
104 |
118 |
105 int |
119 int |
106 dmu_buf_hold(objset_t *os, uint64_t object, uint64_t offset, |
120 dmu_buf_hold(objset_t *os, uint64_t object, uint64_t offset, |
107 void *tag, dmu_buf_t **dbp, int flags) |
121 void *tag, dmu_buf_t **dbp, int flags) |