Home | History | Annotate | Download | only in blkid

Lines Matching refs:probe

2  * probe.c - identify a block device by its contents, and return a dev
37 #include "probe.h"
322 static int probe_ext4dev(struct blkid_probe *probe,
363 get_ext2_info(probe->dev, id, buf);
367 static int probe_ext4(struct blkid_probe *probe, struct blkid_magic *id,
411 get_ext2_info(probe->dev, id, buf);
415 static int probe_ext3(struct blkid_probe *probe, struct blkid_magic *id,
433 get_ext2_info(probe->dev, id, buf);
437 static int probe_ext2(struct blkid_probe *probe, struct blkid_magic *id,
465 get_ext2_info(probe->dev, id, buf);
469 static int probe_jbd(struct blkid_probe *probe, struct blkid_magic *id,
478 get_ext2_info(probe->dev, id, buf);
514 static int probe_fat(struct blkid_probe *probe,
567 dir = (struct vfat_dir_entry *) get_buffer(probe, root_start,
576 blkid_set_tag(probe->dev, "SEC_TYPE", "msdos",
594 get_buffer(probe, next_off, buf_size);
607 buf = get_buffer(probe, fat_entry_off, buf_size);
629 blkid_set_tag(probe->dev, "LABEL", (const char *) label, label_len);
630 blkid_set_tag(probe->dev, "UUID", serno, sizeof(serno)-1);
641 static int probe_fat_nomagic(struct blkid_probe *probe,
679 return probe_fat(probe, id, buf);
682 static int probe_ntfs(struct blkid_probe *probe,
721 buf_mft = get_buffer(probe, off, mft_record_size);
731 buf_mft = get_buffer(probe, off, mft_record_size);
740 buf_mft = get_buffer(probe, off, mft_record_size);
783 blkid_set_tag(probe->dev, "UUID", uuid_str, 0);
785 blkid_set_tag(probe->dev, "LABEL", label_str, 0);
790 static int probe_xfs(struct blkid_probe *probe,
801 blkid_set_tag(probe->dev, "LABEL", label, sizeof(xs->xs_fname));
802 set_uuid(probe->dev, xs->xs_uuid, 0);
806 static int probe_reiserfs(struct blkid_probe *probe,
827 set_uuid(probe->dev, rs->rs_uuid, 0);
829 blkid_set_tag(probe->dev, "LABEL", label, sizeof(rs->rs_label));
834 static int probe_reiserfs4(struct blkid_probe *probe,
843 set_uuid(probe->dev, rs4->rs4_uuid, 0);
844 blkid_set_tag(probe->dev, "LABEL", (const char *) label,
850 static int probe_jfs(struct blkid_probe *probe,
871 blkid_set_tag(probe->dev, "LABEL", label, sizeof(js->js_label));
872 set_uuid(probe->dev, js->js_uuid, 0);
876 static int probe_zfs(struct blkid_probe *probe, struct blkid_magic *id,
884 blkid_set_tag(probe->dev, "LABEL", pool_name, sizeof(pool_name));
885 set_uuid(probe->dev, pool_guid, 0);
890 static int probe_luks(struct blkid_probe *probe,
899 blkid_set_tag(probe->dev, "UUID", uuid, sizeof(uuid));
903 static int probe_romfs(struct blkid_probe *probe,
914 blkid_set_tag(probe->dev, "LABEL", label, 0);
918 static int probe_cramfs(struct blkid_probe *probe,
929 blkid_set_tag(probe->dev, "LABEL", label, 0);
933 static int probe_swap0(struct blkid_probe *probe,
937 blkid_set_tag(probe->dev, "UUID", 0, 0);
938 blkid_set_tag(probe->dev, "LABEL", 0, 0);
942 static int probe_swap1(struct blkid_probe *probe,
948 probe_swap0(probe, id, buf);
955 sws = (struct swap_id_block *) get_buffer(probe, 1024, 1024);
967 blkid_set_tag(probe->dev, "LABEL", sws->sws_volume,
970 set_uuid(probe->dev, sws->sws_uuid, 0);
975 static int probe_iso9660(struct blkid_probe *probe,
985 blkid_set_tag(probe->dev, "LABEL", (const char *) label,
995 static int probe_udf(struct blkid_probe *probe,
1007 get_buffer(probe, bs*2048+32768, sizeof(isosb));
1018 get_buffer(probe, j*bs*2048+32768,
1028 return probe_iso9660(probe, id, buf);
1038 static int probe_ocfs(struct blkid_probe *probe,
1051 blkid_set_tag(probe->dev,"SEC_TYPE","ocfs1",sizeof("ocfs1"));
1053 blkid_set_tag(probe->dev,"SEC_TYPE","ntocfs",sizeof("ntocfs"));
1055 blkid_set_tag(probe->dev, "LABEL", ovl.label, ocfslabellen(ovl));
1056 blkid_set_tag(probe->dev, "MOUNT", ovh.mount, ocfsmountlen(ovh));
1057 set_uuid(probe->dev, ovl.vol_id, 0);
1061 static int probe_ocfs2(struct blkid_probe *probe,
1069 blkid_set_tag(probe->dev, "LABEL", osb->s_label, sizeof(osb->s_label));
1070 set_uuid(probe->dev, osb->s_uuid, 0);
1074 static int probe_oracleasm(struct blkid_probe *probe,
1082 blkid_set_tag(probe->dev, "LABEL", dl->dl_id, sizeof(dl->dl_id));
1086 static int probe_gfs(struct blkid_probe *probe,
1098 blkid_set_tag(probe->dev, "UUID", 0, 0);
1102 blkid_set_tag(probe->dev, "LABEL", label, sizeof(sbd->sb_locktable));
1108 static int probe_gfs2(struct blkid_probe *probe,
1120 blkid_set_tag(probe->dev, "UUID", 0, 0);
1124 blkid_set_tag(probe->dev, "LABEL", label, sizeof(sbd->sb_locktable));
1161 static int probe_hfs(struct blkid_probe *probe __BLKID_ATTR((unused)),
1176 blkid_set_tag(probe->dev, "UUID", uuid_str, 0);
1178 blkid_set_tag(probe->dev, "LABEL", hfs->label, hfs->label_len);
1183 static int probe_hfsplus(struct blkid_probe *probe,
1223 buf = get_buffer(probe, off + (id->bim_kboff * 1024),
1240 blkid_set_tag(probe->dev, "UUID", uuid_str, 0);
1247 buf = get_buffer(probe, off + (cat_block * blocksize), 0x2000);
1280 buf = get_buffer(probe, off + leaf_off, leaf_node_size);
1300 blkid_set_tag(probe->dev, "LABEL", label, 0);
1324 static int probe_lvm2(struct blkid_probe *probe,
1366 blkid_set_tag(probe->dev, "UUID", uuid, LVM2_ID_LEN+6);
1371 static int probe_btrfs(struct blkid_probe *probe,
1382 blkid_set_tag(probe->dev, "LABEL", label, sizeof(bs->label));
1383 set_uuid(probe->dev, bs->fsid, 0);
1392 /* type kboff sboff len magic probe */
1500 struct blkid_probe probe;
1543 if ((probe.fd = open(dev->bid_name, O_RDONLY)) < 0) {
1550 probe.cache = cache;
1551 probe.dev = dev;
1552 probe.sbbuf = 0;
1553 probe.buf = 0;
1554 probe.buf_max = 0;
1567 if (check_mdraid(probe.fd, uuid) == 0) {
1579 buf = get_buffer(&probe, idx << 10, 1024);
1588 (id->bim_probe(&probe, id, buf) == 0)) {
1600 "trying full probe\n", dev->bid_type));
1627 free(probe.sbbuf);
1628 free(probe.buf);
1629 if (probe.fd >= 0)
1630 close(probe.fd);
1655 "Probe a single device to determine type\n", argv[0]);