Lines Matching refs:ldb

341  * @ldb:   Cache of the database structures
352 unsigned long base, struct ldmdb *ldb)
362 BUG_ON(!state || !ldb);
363 ph = &ldb->ph;
364 tb[0] = &ldb->toc;
417 * @ldb: Cache of the database structures
420 * information in @ldb.
422 * Return: 'true' @ldb contains validated VBDB info
423 * 'false' @ldb contents are undefined
426 unsigned long base, struct ldmdb *ldb)
434 BUG_ON (!state || !ldb);
436 vm = &ldb->vm;
437 toc = &ldb->toc;
526 * @ldb: Cache of the database structures
536 static struct vblk * ldm_get_disk_objid (const struct ldmdb *ldb)
540 BUG_ON (!ldb);
542 list_for_each (item, &ldb->v_disk) {
544 if (uuid_equal(&v->vblk.disk.disk_id, &ldb->ph.disk_id))
554 * @ldb: Cache of the database structures
569 const struct ldmdb *ldb)
577 BUG_ON (!pp || !ldb);
579 disk = ldm_get_disk_objid (ldb);
588 list_for_each (item, &ldb->v_part) {
595 put_partition (pp, part_num, ldb->ph.logical_disk_start +
1145 * @ldb: Cache of the database structures
1154 static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb)
1159 BUG_ON (!data || !ldb);
1176 list_add (&vb->list, &ldb->v_dgrp);
1180 list_add (&vb->list, &ldb->v_disk);
1183 list_add (&vb->list, &ldb->v_volu);
1186 list_add (&vb->list, &ldb->v_comp);
1190 list_for_each (item, &ldb->v_part) {
1198 list_add_tail (&vb->list, &ldb->v_part);
1299 * @ldb: Cache of the database structures
1307 static bool ldm_frag_commit (struct list_head *frags, struct ldmdb *ldb)
1312 BUG_ON (!frags || !ldb);
1323 if (!ldm_ldmdb_add (f->data, f->num*ldb->vm.vblk_size, ldb))
1333 * @ldb: Cache of the database structures
1336 * unpacked and validated. We cache them in @ldb according to their type.
1342 struct ldmdb *ldb)
1350 BUG_ON(!state || !ldb);
1352 size = ldb->vm.vblk_size;
1354 skip = ldb->vm.vblk_offset >> 9; /* Bytes to sectors */
1355 finish = (size * ldb->vm.last_vblk_seq) >> 9;
1372 if (!ldm_ldmdb_add (data, size, ldb))
1384 result = ldm_frag_commit (&frags, ldb); /* Failures, already logged */
1431 struct ldmdb *ldb;
1441 ldb = kmalloc (sizeof (*ldb), GFP_KERNEL);
1442 if (!ldb) {
1448 if (!ldm_validate_privheads(state, &ldb->ph))
1452 base = ldb->ph.config_start;
1455 if (!ldm_validate_tocblocks(state, base, ldb) ||
1456 !ldm_validate_vmdb(state, base, ldb))
1460 INIT_LIST_HEAD (&ldb->v_dgrp);
1461 INIT_LIST_HEAD (&ldb->v_disk);
1462 INIT_LIST_HEAD (&ldb->v_volu);
1463 INIT_LIST_HEAD (&ldb->v_comp);
1464 INIT_LIST_HEAD (&ldb->v_part);
1466 if (!ldm_get_vblks(state, base, ldb)) {
1472 if (ldm_create_data_partitions(state, ldb)) {
1479 ldm_free_vblks (&ldb->v_dgrp);
1480 ldm_free_vblks (&ldb->v_disk);
1481 ldm_free_vblks (&ldb->v_volu);
1482 ldm_free_vblks (&ldb->v_comp);
1483 ldm_free_vblks (&ldb->v_part);
1485 kfree (ldb);