Lines Matching refs:dev
20 blkid_dev dev; in blkid_new_dev() local
22 if (!(dev = (blkid_dev) calloc(1, sizeof(struct blkid_struct_dev)))) in blkid_new_dev()
25 INIT_LIST_HEAD(&dev->bid_devs); in blkid_new_dev()
26 INIT_LIST_HEAD(&dev->bid_tags); in blkid_new_dev()
28 return dev; in blkid_new_dev()
31 void blkid_free_dev(blkid_dev dev) in blkid_free_dev() argument
33 if (!dev) in blkid_free_dev()
37 printf(" freeing dev %s (%s)\n", dev->bid_name, dev->bid_type ? in blkid_free_dev()
38 dev->bid_type : "(null)")); in blkid_free_dev()
39 DBG(DEBUG_DEV, blkid_debug_dump_dev(dev)); in blkid_free_dev()
41 list_del(&dev->bid_devs); in blkid_free_dev()
42 while (!list_empty(&dev->bid_tags)) { in blkid_free_dev()
43 blkid_tag tag = list_entry(dev->bid_tags.next, in blkid_free_dev()
48 free(dev->bid_name); in blkid_free_dev()
49 free(dev); in blkid_free_dev()
55 extern const char *blkid_dev_devname(blkid_dev dev) in blkid_dev_devname() argument
57 return dev->bid_name; in blkid_dev_devname()
61 void blkid_debug_dump_dev(blkid_dev dev) in blkid_debug_dump_dev() argument
65 if (!dev) { in blkid_debug_dump_dev()
70 printf(" dev: name = %s\n", dev->bid_name); in blkid_debug_dump_dev()
71 printf(" dev: DEVNO=\"0x%0llx\"\n", (long long)dev->bid_devno); in blkid_debug_dump_dev()
72 printf(" dev: TIME=\"%ld\"\n", (long)dev->bid_time); in blkid_debug_dump_dev()
73 printf(" dev: PRI=\"%d\"\n", dev->bid_pri); in blkid_debug_dump_dev()
74 printf(" dev: flags = 0x%08X\n", dev->bid_flags); in blkid_debug_dump_dev()
76 list_for_each(p, &dev->bid_tags) { in blkid_debug_dump_dev()
158 blkid_dev dev; in blkid_dev_next() local
164 dev = list_entry(iter->p, struct blkid_struct_dev, bid_devs); in blkid_dev_next()
167 !blkid_dev_has_tag(dev, iter->search_type, in blkid_dev_next()
170 *ret_dev = dev; in blkid_dev_next()
203 blkid_dev dev; in main() local
243 while (blkid_dev_next(iter, &dev) == 0) { in main()
244 printf("Device: %s\n", blkid_dev_devname(dev)); in main()