static int osd_trans_start(const struct lu_env *env, struct dt_device *d,
struct thandle *th)
{
- struct osd_device *osd = osd_dt_dev(th->th_dev);
struct osd_thandle *oh;
int rc;
ENTRY;
OBD_ALLOC_PTR(it);
if (it != NULL) {
if (udmu_zap_cursor_init(&it->ozi_zc, &osd->od_objset,
- udmu_object_get_id(obj->oo_db)))
+ udmu_object_get_id(obj->oo_db), 0))
RETURN(ERR_PTR(-ENOMEM));
it->ozi_obj = obj;
{
struct osd_zap_it *it = (struct osd_zap_it *)di;
struct osd_object *obj = it->ozi_obj;
+ struct osd_device *osd = osd_obj2dev(obj);
ENTRY;
LASSERT(it);
/* XXX: API is broken at the moment */
LASSERT(((const char *)key)[0] == '\0');
- udmu_zap_cursor_init_serialized(it->ozi_zc, &osd_obj2dev(obj)->od_objset,
- udmu_object_get_id(obj->oo_db), 0ULL);
+ udmu_zap_cursor_fini(it->ozi_zc);
+ if (udmu_zap_cursor_init(&it->ozi_zc, &osd->od_objset,
+ udmu_object_get_id(obj->oo_db), 0))
+ RETURN(-ENOMEM);
+
it->ozi_reset = 1;
RETURN(+1);
{
struct osd_zap_it *it = (struct osd_zap_it *)di;
struct osd_object *obj = it->ozi_obj;
+ struct osd_device *osd = osd_obj2dev(obj);
int rc;
ENTRY;
+ udmu_zap_cursor_fini(it->ozi_zc);
+ if (udmu_zap_cursor_init(&it->ozi_zc, &osd->od_objset,
+ udmu_object_get_id(obj->oo_db), hash))
+ RETURN(-ENOMEM);
it->ozi_reset = 0;
- udmu_zap_cursor_init_serialized(it->ozi_zc, &osd_obj2dev(obj)->od_objset,
- udmu_object_get_id(obj->oo_db), hash);
/* same as osd_zap_it_next()*/
rc = udmu_zap_cursor_retrieve_key(it->ozi_zc, NULL, NAME_MAX + 1);
rc = -ENODATA;
if (rc == 0)
rc = size;
-out:
+
RETURN(rc);
}
num_int = len;
}
-
/* Assert that the transaction has been assigned to a
transaction group. */
ASSERT(tx->tx_txg != 0);
/*
* Zap cursor APIs
*/
-int udmu_zap_cursor_init(zap_cursor_t **zc, udmu_objset_t *uos, uint64_t zapobj)
+int udmu_zap_cursor_init(zap_cursor_t **zc, udmu_objset_t *uos,
+ uint64_t zapobj, uint64_t hash)
{
zap_cursor_t * t;
t = kmem_alloc(sizeof(*t), KM_NOSLEEP);
if (t) {
- zap_cursor_init(t, uos->os, zapobj);
+ zap_cursor_init_serialized(t, uos->os, zapobj, hash);
*zc = t;
return 0;
}
return zap_cursor_move_to_key(zc, name, MT_BEST);
}
-void udmu_zap_cursor_init_serialized(zap_cursor_t *zc, udmu_objset_t *uos,
- uint64_t zapobj, uint64_t serialized)
-{
- zap_cursor_init_serialized(zc, uos->os, zapobj, serialized);
-}
-
-
/*
* Read data from a DMU object
*/
const char *name);
/* zap cursor apis */
-int udmu_zap_cursor_init(zap_cursor_t **zc, udmu_objset_t *uos, uint64_t zapobj);
+int udmu_zap_cursor_init(zap_cursor_t **zc, udmu_objset_t *uos,
+ uint64_t zapobj, uint64_t hash);
void udmu_zap_cursor_fini(zap_cursor_t *zc);
int udmu_zap_cursor_move_to_key(zap_cursor_t *zc, const char *name);
-void udmu_zap_cursor_init_serialized(zap_cursor_t *zc, udmu_objset_t *uos,
- uint64_t zapobj, uint64_t serialized);
/* udmu object API */