#include <stdint.h>
#include "partitions.h"
+#include "superblocks/superblocks.h"
#include "aix.h"
/* see superblocks/vfat.c */
goto nothing;
}
+ /* Another false possitive is NTFS */
+ if (blkid_probe_is_ntfs(pr) == 1) {
+ DBG(LOWPROBE, ul_debug("probably NTFS -- ignore"));
+ goto nothing;
+ }
+
/*
* Ugly exception, if the device contains a valid LVM physical volume
* and empty MBR (=no partition defined) then it's LVM and MBR should
#define MFT_RECORD_ATTR_VOLUME_NAME 0x60
#define MFT_RECORD_ATTR_END 0xffffffff
-static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag)
+static int __probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag, int save_info)
{
struct ntfs_super_block *ns;
struct master_file_table_record *mft;
if (memcmp(buf_mft, "FILE", 4))
return 1;
+ /* return if caller does not care about UUID and LABEL */
+ if (!save_info)
+ return 0;
+
mft = (struct master_file_table_record *) buf_mft;
attr_off = le16_to_cpu(mft->attrs_offset);
return 0;
}
+static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag)
+{
+ return __probe_ntfs(pr, mag, 1);
+}
+
+int blkid_probe_is_ntfs(blkid_probe pr)
+{
+ const struct blkid_idmag *mag = NULL;
+ int rc;
+
+ rc = blkid_probe_get_idmag(pr, &ntfs_idinfo, NULL, &mag);
+ if (rc < 0)
+ return rc; /* error */
+ if (rc != BLKID_PROBE_OK || !mag)
+ return 0;
+
+ return __probe_ntfs(pr, mag, 0) == 0 ? 1 : 0;
+}
const struct blkid_idinfo ntfs_idinfo =
{
const unsigned char *data, size_t len, int enc);
extern int blkid_probe_is_bitlocker(blkid_probe pr);
+extern int blkid_probe_is_ntfs(blkid_probe pr);
#endif /* _BLKID_SUPERBLOCKS_H */