summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-11-15 22:53:25 +0100
committerLennart Poettering <lennart@poettering.net>2021-11-15 22:53:25 +0100
commit05715f12a8be1123c9c8ee2096b9a1c0a38907b3 (patch)
tree65d69b96b9a07e932363c0e9d8235f6b39bdb372
parentad4e99fe9a1722acfb3fc4b4c5d9f93f0651300e (diff)
downloadsystemd-05715f12a8be1123c9c8ee2096b9a1c0a38907b3.tar.gz
filesystems: add ntfs/ntfs3 magic and add it current version to group
As suggested: https://github.com/systemd/systemd/pull/21373#discussion_r749523677
-rw-r--r--src/basic/filesystems-gperf.gperf2
-rw-r--r--src/basic/filesystems.c1
-rw-r--r--src/basic/missing_magic.h10
3 files changed, 13 insertions, 0 deletions
diff --git a/src/basic/filesystems-gperf.gperf b/src/basic/filesystems-gperf.gperf
index 0c0c609f80..7dd660addf 100644
--- a/src/basic/filesystems-gperf.gperf
+++ b/src/basic/filesystems-gperf.gperf
@@ -85,6 +85,8 @@ nfs, {NFS_SUPER_MAGIC}
nfs4, {NFS_SUPER_MAGIC}
nilfs2, {NILFS_SUPER_MAGIC}
nsfs, {NSFS_MAGIC}
+ntfs, {NTFS_SB_MAGIC}
+ntfs3, {NTFS3_SUPER_MAGIC}
ocfs2, {OCFS2_SUPER_MAGIC}
openpromfs, {OPENPROM_SUPER_MAGIC}
orangefs, {ORANGEFS_DEVREQ_MAGIC}
diff --git a/src/basic/filesystems.c b/src/basic/filesystems.c
index c3fe6497be..b9cc622107 100644
--- a/src/basic/filesystems.c
+++ b/src/basic/filesystems.c
@@ -99,6 +99,7 @@ const FilesystemSet filesystem_sets[_FILESYSTEM_SET_MAX] = {
"exfat\0"
"ext4\0"
"iso9660\0"
+ "ntfs3\0"
"squashfs\0"
"udf\0"
"vfat\0"
diff --git a/src/basic/missing_magic.h b/src/basic/missing_magic.h
index 7b586971ae..7d9320bb6d 100644
--- a/src/basic/missing_magic.h
+++ b/src/basic/missing_magic.h
@@ -177,3 +177,13 @@
#ifndef RPC_PIPEFS_SUPER_MAGIC
#define RPC_PIPEFS_SUPER_MAGIC 0x67596969
#endif
+
+/* Not exposed yet, defined at fs/ntfs/ntfs.h */
+#ifndef NTFS_SB_MAGIC
+#define NTFS_SB_MAGIC 0x5346544e
+#endif
+
+/* Not exposed yet, encoded literally in fs/ntfs3/super.c. */
+#ifndef NTFS3_SUPER_MAGIC
+#define NTFS3_SUPER_MAGIC 0x7366746e
+#endif