Lines Matching +full:- +full:lh

4  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
55 li->l = l; in _alloc_li()
56 strcpy(li->name, name); in _alloc_li()
78 n = c->n; in label_exit()
80 li->l->ops->destroy(li->l); in label_exit()
94 dm_list_add(&_labellers, &li->list); in label_register_handler()
103 if (!strcmp(li->name, name)) in label_get_handler()
104 return li->l; in label_get_handler()
115 struct label_header *lh; in _find_labeller() local
130 lh = (struct label_header *) (readbuf + in _find_labeller()
133 if (!strncmp((char *)lh->id, LABEL_ID, sizeof(lh->id))) { in _find_labeller()
139 if (xlate64(lh->sector_xl) != sector + scan_sector) { in _find_labeller()
142 " - ignoring", dev_name(dev), in _find_labeller()
143 (uint64_t)xlate64(lh->sector_xl), in _find_labeller()
147 if (calc_crc(INITIAL_CRC, &lh->offset_xl, LABEL_SIZE - in _find_labeller()
148 ((uintptr_t) &lh->offset_xl - (uintptr_t) lh)) != in _find_labeller()
149 xlate32(lh->crc_xl)) { in _find_labeller()
150 log_info("Label checksum incorrect on %s - " in _find_labeller()
159 if (li->l->ops->can_handle(li->l, (char *) lh, in _find_labeller()
162 dev_name(dev), li->name); in _find_labeller()
170 r = li->l; in _find_labeller()
171 memcpy(buf, lh, LABEL_SIZE); in _find_labeller()
182 if ((info = info_from_pvid(dev->pvid, 0))) in _find_labeller()
183 lvmcache_update_vgname_and_id(info, info->fmt->orphan_vg_name, in _find_labeller()
184 info->fmt->orphan_vg_name, in _find_labeller()
201 struct label_header *lh; in label_remove() local
224 lh = (struct label_header *) (readbuf + in label_remove()
229 if (!strncmp((char *)lh->id, LABEL_ID, sizeof(lh->id))) { in label_remove()
230 if (xlate64(lh->sector_xl) == sector) in label_remove()
234 if (li->l->ops->can_handle(li->l, (char *) lh, in label_remove()
271 if ((info = info_from_pvid(dev->pvid, 1))) { in label_read()
273 *result = info->label; in label_read()
280 if ((info = info_from_pvid(dev->pvid, 0))) in label_read()
281 lvmcache_update_vgname_and_id(info, info->fmt->orphan_vg_name, in label_read()
282 info->fmt->orphan_vg_name, in label_read()
291 if ((r = (l->ops->read)(l, dev, buf, result)) && result && *result) in label_read()
292 (*result)->sector = sector; in label_read()
305 struct label_header *lh = (struct label_header *) buf; in label_write() local
308 if (!label->labeller->ops->write) { in label_write()
313 if ((LABEL_SIZE + (label->sector << SECTOR_SHIFT)) > LABEL_SCAN_SIZE) { in label_write()
315 label->sector, LABEL_SCAN_SECTORS); in label_write()
321 strncpy((char *)lh->id, LABEL_ID, sizeof(lh->id)); in label_write()
322 lh->sector_xl = xlate64(label->sector); in label_write()
323 lh->offset_xl = xlate32(sizeof(*lh)); in label_write()
325 if (!(label->labeller->ops->write)(label, buf)) in label_write()
328 lh->crc_xl = xlate32(calc_crc(INITIAL_CRC, &lh->offset_xl, LABEL_SIZE - in label_write()
329 ((uintptr_t) &lh->offset_xl - (uintptr_t) lh))); in label_write()
335 PRIu32 ".", dev_name(dev), label->sector, in label_write()
336 xlate32(lh->offset_xl)); in label_write()
337 if (!dev_write(dev, label->sector << SECTOR_SHIFT, LABEL_SIZE, buf)) { in label_write()
358 if ((info = info_from_pvid(dev->pvid, 0))) in label_verify()
359 lvmcache_update_vgname_and_id(info, info->fmt->orphan_vg_name, in label_verify()
360 info->fmt->orphan_vg_name, in label_verify()
369 r = l->ops->verify ? l->ops->verify(l, buf, sector) : 1; in label_verify()
380 label->labeller->ops->destroy_label(label->labeller, label); in label_destroy()
394 label->labeller = labeller; in label_create()
396 labeller->ops->initialise_label(labeller, label); in label_create()