__attribute__((nonnull(1)));
/* returns superblock according to 'struct blkid_idmag' */
+extern unsigned char *_blkid_probe_get_sb(blkid_probe pr, const struct blkid_idmag *mag, size_t size);
#define blkid_probe_get_sb(_pr, _mag, type) \
- ((type *) blkid_probe_get_buffer((_pr),\
- (_mag)->kboff << 10, sizeof(type)))
+ ((type *) _blkid_probe_get_sb((_pr), _mag, sizeof(type)))
extern blkid_partlist blkid_probe_get_partlist(blkid_probe pr)
__attribute__((nonnull))
return 0;
}
+unsigned char *_blkid_probe_get_sb(blkid_probe pr, const struct blkid_idmag *mag, size_t size)
+{
+ uint64_t hint_offset;
+
+ if (!mag->hoff || blkid_probe_get_hint(pr, mag->hoff, &hint_offset) < 0)
+ hint_offset = 0;
+
+ return blkid_probe_get_buffer(pr, hint_offset + (mag->kboff << 10), size);
+}
+
/*
* Check for matching magic value.
* Returns BLKID_PROBE_OK if found, BLKID_PROBE_NONE if not found