Lines Matching refs:db
41 struct dir_info_db *db = ctx->dir_info;
58 retval = ext2fs_get_mem(strlen(tdb_dir) + 64, &db->tdb_fn);
63 sprintf(db->tdb_fn, "%s/%s-dirinfo-XXXXXX", tdb_dir, uuid);
64 fd = mkstemp(db->tdb_fn);
66 db->tdb = NULL;
73 db->tdb = tdb_open(db->tdb_fn, num_dirs, TDB_NOLOCK | TDB_NOSYNC,
80 struct dir_info_db *db;
84 db = (struct dir_info_db *)
86 "directory map db");
87 db->count = db->size = 0;
88 db->array = 0;
90 ctx->dir_info = db;
98 if (db->tdb) {
105 db->size = num_dirs + 10;
106 db->array = (struct dir_info *)
107 e2fsck_allocate_memory(ctx, db->size
119 struct dir_info_db *db;
130 db = ctx->dir_info;
148 if (db->tdb) {
185 struct dir_info_db *db = ctx->dir_info;
190 if (!db)
197 if (db->tdb) {
203 data = tdb_fetch(db->tdb, key);
205 if (tdb_error(db->tdb) != TDB_ERR_NOEXIST)
207 tdb_errorstr(db->tdb));
222 if (db->last_lookup && db->last_lookup->ino == ino)
223 return db->last_lookup;
266 struct dir_info_db *db = ctx->dir_info;
275 if (!db->tdb)
286 if (tdb_store(db->tdb, key, data, TDB_REPLACE) == -1) {
287 printf("store failed: %s\n", tdb_errorstr(db->tdb));
325 struct dir_info_db *db = ctx->dir_info;
330 if (db->tdb)
331 iter->tdb_iter = tdb_firstkey(db->tdb);
349 struct dir_info_db *db = ctx->dir_info;
356 if (db->tdb) {
360 data = tdb_fetch(db->tdb, key);
363 tdb_errorstr(db->tdb));
370 iter->tdb_iter = tdb_nextkey(db->tdb, key);