diff options
author | Manuel Bentele | 2019-08-21 14:58:42 +0200 |
---|---|---|
committer | Manuel Bentele | 2019-08-21 14:58:42 +0200 |
commit | 0692b963aa3cb846d8abab5ef5247c4dbb3fec96 (patch) | |
tree | f13776d25da3e1adc1445aef22e7566ac98cbe84 /libblkid/src/superblocks/ntfs.c | |
parent | losetup: added file format option to the man page (diff) | |
parent | partx: document -d vs. --nr and fix test (diff) | |
download | kernel-qcow2-util-linux-0692b963aa3cb846d8abab5ef5247c4dbb3fec96.tar.gz kernel-qcow2-util-linux-0692b963aa3cb846d8abab5ef5247c4dbb3fec96.tar.xz kernel-qcow2-util-linux-0692b963aa3cb846d8abab5ef5247c4dbb3fec96.zip |
lib/losetup: merge remote-tracking branch 'util-linux/master'kernel-qcow2
Signed-off-by: Manuel Bentele <development@manuel-bentele.de>
Diffstat (limited to 'libblkid/src/superblocks/ntfs.c')
-rw-r--r-- | libblkid/src/superblocks/ntfs.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libblkid/src/superblocks/ntfs.c b/libblkid/src/superblocks/ntfs.c index 5ea2a454a..90a102f89 100644 --- a/libblkid/src/superblocks/ntfs.c +++ b/libblkid/src/superblocks/ntfs.c @@ -78,7 +78,7 @@ struct file_attribute { #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; @@ -174,6 +174,10 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag) 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); @@ -211,6 +215,24 @@ static int probe_ntfs(blkid_probe pr, const struct blkid_idmag *mag) 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 = { |