Lines Matching defs:data

58  * @data:  Raw database PRIVHEAD structure loaded from the device
61 * This parses the LDM database PRIVHEAD structure supplied in @data and
64 * Return: 'true' @ph contains the PRIVHEAD data
67 static bool ldm_parse_privhead(const u8 *data, struct privhead *ph)
71 BUG_ON(!data || !ph);
72 if (MAGIC_PRIVHEAD != get_unaligned_be64(data)) {
77 ph->ver_major = get_unaligned_be16(data + 0x000C);
78 ph->ver_minor = get_unaligned_be16(data + 0x000E);
79 ph->logical_disk_start = get_unaligned_be64(data + 0x011B);
80 ph->logical_disk_size = get_unaligned_be64(data + 0x0123);
81 ph->config_start = get_unaligned_be64(data + 0x012B);
82 ph->config_size = get_unaligned_be64(data + 0x0133);
104 if (uuid_parse(data + 0x0030, &ph->disk_id)) {
114 * @data: Raw database TOCBLOCK structure loaded from the device
118 * in @data and sets up the in-memory tocblock structure @toc with the obtained
123 * Return: 'true' @toc contains the TOCBLOCK data
126 static bool ldm_parse_tocblock (const u8 *data, struct tocblock *toc)
128 BUG_ON (!data || !toc);
130 if (MAGIC_TOCBLOCK != get_unaligned_be64(data)) {
134 strncpy (toc->bitmap1_name, data + 0x24, sizeof (toc->bitmap1_name));
136 toc->bitmap1_start = get_unaligned_be64(data + 0x2E);
137 toc->bitmap1_size = get_unaligned_be64(data + 0x36);
145 strncpy (toc->bitmap2_name, data + 0x46, sizeof (toc->bitmap2_name));
147 toc->bitmap2_start = get_unaligned_be64(data + 0x50);
148 toc->bitmap2_size = get_unaligned_be64(data + 0x58);
161 * @data: Raw database VMDB structure loaded from the device
164 * This parses the LDM Database VMDB structure supplied in @data and sets up
172 static bool ldm_parse_vmdb (const u8 *data, struct vmdb *vm)
174 BUG_ON (!data || !vm);
176 if (MAGIC_VMDB != get_unaligned_be32(data)) {
181 vm->ver_major = get_unaligned_be16(data + 0x12);
182 vm->ver_minor = get_unaligned_be16(data + 0x14);
189 vm->vblk_size = get_unaligned_be32(data + 0x08);
195 vm->vblk_offset = get_unaligned_be32(data + 0x0C);
196 vm->last_vblk_seq = get_unaligned_be32(data + 0x04);
271 u8 *data;
290 data = read_part_sector(state, ph[0]->config_start + off[i],
292 if (!data) {
296 result = ldm_parse_privhead (data, ph[i]);
360 u8 *data;
381 data = read_part_sector(state, base + off[i], &sect);
382 if (!data) {
386 if (ldm_parse_tocblock(data, tb[nr_tbs]))
431 u8 *data;
441 data = read_part_sector(state, base + OFF_VMDB, &sect);
442 if (!data) {
447 if (!ldm_parse_vmdb (data, vm))
451 if (get_unaligned_be16(data + 0x10) != 0x01) {
495 u8 *data;
502 data = read_part_sector(state, 0, &sect);
503 if (!data) {
508 if (*(__le16*) (data + 0x01FE) != cpu_to_le16 (MSDOS_LABEL_MAGIC))
511 p = (struct msdos_partition *)(data + 0x01BE);
554 * ldm_create_data_partitions - Create data partitions for this device
589 /* Create the data partitions */
609 * @buffer: Block of data being worked on
610 * @buflen: Size of the block of data
711 * @buffer: Block of data being worked on
712 * @buflen: Size of the block of data
761 * @buffer: Block of data being worked on
762 * @buflen: Size of the block of data
802 * @buffer: Block of data being worked on
803 * @buflen: Size of the block of data
840 * @buffer: Block of data being worked on
841 * @buflen: Size of the block of data
879 * @buffer: Block of data being worked on
880 * @buflen: Size of the block of data
912 * @buffer: Block of data being worked on
913 * @buflen: Size of the block of data
986 * @buffer: Block of data being worked on
987 * @buflen: Size of the block of data
1093 * @buf: Block of data being worked on
1094 * @len: Size of the block of data
1145 * @data: Raw VBLK to add to the database
1156 static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb)
1161 BUG_ON (!data || !ldb);
1169 if (!ldm_parse_vblk (data, len, vb)) {
1208 * @data: Raw fragment to be added to the list
1218 static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
1224 BUG_ON (!data || !frags);
1231 group = get_unaligned_be32(data + 0x08);
1232 rec = get_unaligned_be16(data + 0x0C);
1233 num = get_unaligned_be16(data + 0x0E);
1273 memcpy(f->data, data, VBLK_SIZE_HEAD);
1274 data += VBLK_SIZE_HEAD;
1276 memcpy(f->data + VBLK_SIZE_HEAD + rec * size, data, size);
1325 if (!ldm_ldmdb_add (f->data, f->num*ldb->vm.vblk_size, ldb))
1347 u8 *data = NULL;
1360 data = read_part_sector(state, base + OFF_VMDB + s, &sect);
1361 if (!data) {
1366 for (v = 0; v < perbuf; v++, data+=size) { /* For each vblk */
1367 if (MAGIC_VBLK != get_unaligned_be32(data)) {
1372 recs = get_unaligned_be16(data + 0x0E); /* Number of records */
1374 if (!ldm_ldmdb_add (data, size, ldb))
1377 if (!ldm_frag_add (data, size, &frags))
1383 data = NULL;
1388 if (data)
1424 * and so on: the actual data containing partitions.
1473 /* Finally, create the data partition devices. */