Lines Matching refs:ldb

343  * @ldb:   Cache of the database structures
354 unsigned long base, struct ldmdb *ldb)
364 BUG_ON(!state || !ldb);
365 ph = &ldb->ph;
366 tb[0] = &ldb->toc;
419 * @ldb: Cache of the database structures
422 * information in @ldb.
424 * Return: 'true' @ldb contains validated VBDB info
425 * 'false' @ldb contents are undefined
428 unsigned long base, struct ldmdb *ldb)
436 BUG_ON (!state || !ldb);
438 vm = &ldb->vm;
439 toc = &ldb->toc;
528 * @ldb: Cache of the database structures
538 static struct vblk * ldm_get_disk_objid (const struct ldmdb *ldb)
542 BUG_ON (!ldb);
544 list_for_each (item, &ldb->v_disk) {
546 if (uuid_equal(&v->vblk.disk.disk_id, &ldb->ph.disk_id))
556 * @ldb: Cache of the database structures
571 const struct ldmdb *ldb)
579 BUG_ON (!pp || !ldb);
581 disk = ldm_get_disk_objid (ldb);
590 list_for_each (item, &ldb->v_part) {
597 put_partition (pp, part_num, ldb->ph.logical_disk_start +
1156 * @ldb: Cache of the database structures
1165 static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb)
1170 BUG_ON (!data || !ldb);
1187 list_add (&vb->list, &ldb->v_dgrp);
1191 list_add (&vb->list, &ldb->v_disk);
1194 list_add (&vb->list, &ldb->v_volu);
1197 list_add (&vb->list, &ldb->v_comp);
1201 list_for_each (item, &ldb->v_part) {
1209 list_add_tail (&vb->list, &ldb->v_part);
1310 * @ldb: Cache of the database structures
1318 static bool ldm_frag_commit (struct list_head *frags, struct ldmdb *ldb)
1323 BUG_ON (!frags || !ldb);
1334 if (!ldm_ldmdb_add (f->data, f->num*ldb->vm.vblk_size, ldb))
1344 * @ldb: Cache of the database structures
1347 * unpacked and validated. We cache them in @ldb according to their type.
1353 struct ldmdb *ldb)
1361 BUG_ON(!state || !ldb);
1363 size = ldb->vm.vblk_size;
1365 skip = ldb->vm.vblk_offset >> 9; /* Bytes to sectors */
1366 finish = (size * ldb->vm.last_vblk_seq) >> 9;
1383 if (!ldm_ldmdb_add (data, size, ldb))
1395 result = ldm_frag_commit (&frags, ldb); /* Failures, already logged */
1442 struct ldmdb *ldb;
1452 ldb = kmalloc (sizeof (*ldb), GFP_KERNEL);
1453 if (!ldb) {
1459 if (!ldm_validate_privheads(state, &ldb->ph))
1463 base = ldb->ph.config_start;
1466 if (!ldm_validate_tocblocks(state, base, ldb) ||
1467 !ldm_validate_vmdb(state, base, ldb))
1471 INIT_LIST_HEAD (&ldb->v_dgrp);
1472 INIT_LIST_HEAD (&ldb->v_disk);
1473 INIT_LIST_HEAD (&ldb->v_volu);
1474 INIT_LIST_HEAD (&ldb->v_comp);
1475 INIT_LIST_HEAD (&ldb->v_part);
1477 if (!ldm_get_vblks(state, base, ldb)) {
1483 if (ldm_create_data_partitions(state, ldb)) {
1490 ldm_free_vblks (&ldb->v_dgrp);
1491 ldm_free_vblks (&ldb->v_disk);
1492 ldm_free_vblks (&ldb->v_volu);
1493 ldm_free_vblks (&ldb->v_comp);
1494 ldm_free_vblks (&ldb->v_part);
1496 kfree (ldb);