mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Illumos 3654,3656
3654 zdb should print number of ganged blocks 3656 remove unused function zap_cursor_move_to_key() Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Christopher Siden <christopher.siden@delphix.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org> References: https://www.illumos.org/issues/3654 https://www.illumos.org/issues/3656 https://github.com/illumos/illumos-gate/commit/d5ee8a1 Porting Notes: 3655 and 3657 were part of this commit but those hunks were dropped since they apply to mdb. Ported by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
committed by
Brian Behlendorf
parent
6102d0376e
commit
83017311e4
@@ -1251,31 +1251,6 @@ zap_stats_ptrtbl(zap_t *zap, uint64_t *tbl, int len, zap_stats_t *zs)
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
fzap_cursor_move_to_key(zap_cursor_t *zc, zap_name_t *zn)
|
||||
{
|
||||
int err;
|
||||
zap_leaf_t *l;
|
||||
zap_entry_handle_t zeh;
|
||||
|
||||
if (zn->zn_key_orig_numints * zn->zn_key_intlen > ZAP_MAXNAMELEN)
|
||||
return (SET_ERROR(ENAMETOOLONG));
|
||||
|
||||
err = zap_deref_leaf(zc->zc_zap, zn->zn_hash, NULL, RW_READER, &l);
|
||||
if (err != 0)
|
||||
return (err);
|
||||
|
||||
err = zap_leaf_lookup(l, zn, &zeh);
|
||||
if (err == 0) {
|
||||
zc->zc_leaf = l;
|
||||
zc->zc_hash = zeh.zeh_hash;
|
||||
zc->zc_cd = zeh.zeh_cd;
|
||||
}
|
||||
|
||||
rw_exit(&l->l_rwlock);
|
||||
return (err);
|
||||
}
|
||||
|
||||
void
|
||||
fzap_get_stats(zap_t *zap, zap_stats_t *zs)
|
||||
{
|
||||
|
||||
@@ -1317,46 +1317,6 @@ zap_cursor_advance(zap_cursor_t *zc)
|
||||
zc->zc_cd++;
|
||||
}
|
||||
|
||||
int
|
||||
zap_cursor_move_to_key(zap_cursor_t *zc, const char *name, matchtype_t mt)
|
||||
{
|
||||
int err = 0;
|
||||
mzap_ent_t *mze;
|
||||
zap_name_t *zn;
|
||||
|
||||
if (zc->zc_zap == NULL) {
|
||||
err = zap_lockdir(zc->zc_objset, zc->zc_zapobj, NULL,
|
||||
RW_READER, TRUE, FALSE, &zc->zc_zap);
|
||||
if (err)
|
||||
return (err);
|
||||
} else {
|
||||
rw_enter(&zc->zc_zap->zap_rwlock, RW_READER);
|
||||
}
|
||||
|
||||
zn = zap_name_alloc(zc->zc_zap, name, mt);
|
||||
if (zn == NULL) {
|
||||
rw_exit(&zc->zc_zap->zap_rwlock);
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
}
|
||||
|
||||
if (!zc->zc_zap->zap_ismicro) {
|
||||
err = fzap_cursor_move_to_key(zc, zn);
|
||||
} else {
|
||||
mze = mze_find(zn);
|
||||
if (mze == NULL) {
|
||||
err = SET_ERROR(ENOENT);
|
||||
goto out;
|
||||
}
|
||||
zc->zc_hash = mze->mze_hash;
|
||||
zc->zc_cd = mze->mze_cd;
|
||||
}
|
||||
|
||||
out:
|
||||
zap_name_free(zn);
|
||||
rw_exit(&zc->zc_zap->zap_rwlock);
|
||||
return (err);
|
||||
}
|
||||
|
||||
int
|
||||
zap_get_stats(objset_t *os, uint64_t zapobj, zap_stats_t *zs)
|
||||
{
|
||||
@@ -1494,7 +1454,6 @@ EXPORT_SYMBOL(zap_cursor_fini);
|
||||
EXPORT_SYMBOL(zap_cursor_retrieve);
|
||||
EXPORT_SYMBOL(zap_cursor_advance);
|
||||
EXPORT_SYMBOL(zap_cursor_serialize);
|
||||
EXPORT_SYMBOL(zap_cursor_move_to_key);
|
||||
EXPORT_SYMBOL(zap_cursor_init_serialized);
|
||||
EXPORT_SYMBOL(zap_get_stats);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user