MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zap_length

Function zap_length

freebsd/contrib/openzfs/module/zfs/zap_micro.c:1127–1158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127int
1128zap_length(objset_t *os, uint64_t zapobj, const char *name,
1129 uint64_t *integer_size, uint64_t *num_integers)
1130{
1131 zap_t *zap;
1132
1133 int err =
1134 zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, FTAG, &zap);
1135 if (err != 0)
1136 return (err);
1137 zap_name_t *zn = zap_name_alloc(zap, name, 0);
1138 if (zn == NULL) {
1139 zap_unlockdir(zap, FTAG);
1140 return (SET_ERROR(ENOTSUP));
1141 }
1142 if (!zap->zap_ismicro) {
1143 err = fzap_length(zn, integer_size, num_integers);
1144 } else {
1145 mzap_ent_t *mze = mze_find(zn);
1146 if (mze == NULL) {
1147 err = SET_ERROR(ENOENT);
1148 } else {
1149 if (integer_size)
1150 *integer_size = 8;
1151 if (num_integers)
1152 *num_integers = 1;
1153 }
1154 }
1155 zap_name_free(zn);
1156 zap_unlockdir(zap, FTAG);
1157 return (err);
1158}
1159
1160int
1161zap_length_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,

Callers 5

load_zfeatureFunction · 0.85
ztest_zapFunction · 0.85
ztest_zap_parallelFunction · 0.85

Calls 6

zap_lockdirFunction · 0.85
zap_name_allocFunction · 0.85
zap_unlockdirFunction · 0.85
fzap_lengthFunction · 0.85
mze_findFunction · 0.85
zap_name_freeFunction · 0.85

Tested by 2

ztest_zapFunction · 0.68
ztest_zap_parallelFunction · 0.68