Add new filesystem magic numbers.

Signed-off-by: Sheng Yong <shengyo...@huawei.com>
---
 include/tst_fs_type.h | 17 +++++++++++++++++
 lib/tst_fs_type.c     | 26 ++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/include/tst_fs_type.h b/include/tst_fs_type.h
index fef0818..e8e8474 100644
--- a/include/tst_fs_type.h
+++ b/include/tst_fs_type.h
@@ -33,6 +33,23 @@
 #define TST_TMPFS_MAGIC    0x01021994
 #define TST_V9FS_MAGIC     0x01021997
 #define TST_XFS_MAGIC      0x58465342
+#define TST_EXT2_OLD_MAGIC 0xEF51
+#define TST_EXT2_MAGIC     0xEF53
+#define TST_EXT3_MAGIC     0xEF53
+#define TST_EXT4_MAGIC     0xEF53
+#define TST_MINIX_MAGIC    0x137F
+#define TST_MINIX_MAGIC2   0x138F
+#define TST_MINIX2_MAGIC   0x2468
+#define TST_MINIX2_MAGIC2  0x2478
+#define TST_MINIX3_MAGIC   0x4D5A
+#define TST_UDF_MAGIC      0x15013346
+#define TST_SYSV2_MAGIC    0x012FF7B6
+#define TST_SYSV4_MAGIC    0x012FF7B5
+#define TST_UFS_MAGIC      0x00011954
+#define TST_UFS2_MAGIC     0x19540119
+#define TST_F2FS_MAGIC     0xF2F52010
+#define TST_NILFS_MAGIC    0x3434
+#define TST_EXOFS_MAGIC    0x5DF5
 
 /*
  * Returns filesystem magick for a given path.
diff --git a/lib/tst_fs_type.c b/lib/tst_fs_type.c
index b1a3675..c15c10d 100644
--- a/lib/tst_fs_type.c
+++ b/lib/tst_fs_type.c
@@ -57,6 +57,32 @@ const char *tst_fs_type_name(long f_type)
                return "BTRFS";
        case TST_XFS_MAGIC:
                return "XFS";
+       case TST_EXT2_OLD_MAGIC:
+               return "EXT2";
+       case TST_EXT2_MAGIC:
+       case TST_EXT3_MAGIC:
+       case TST_EXT4_MAGIC:
+               return "EXT2/EXT3/EXT4";
+       case TST_MINIX_MAGIC:
+       case TST_MINIX_MAGIC2:
+       case TST_MINIX2_MAGIC:
+       case TST_MINIX2_MAGIC2:
+       case TST_MINIX3_MAGIC:
+               return "MINIX";
+       case TST_UDF_MAGIC:
+               return "UDF";
+       case TST_SYSV2_MAGIC:
+       case TST_SYSV4_MAGIC:
+               return "SYSV";
+       case TST_UFS_MAGIC:
+       case TST_UFS2_MAGIC:
+               return "UFS";
+       case TST_F2FS_MAGIC:
+               return "F2FS";
+       case TST_NILFS_MAGIC:
+               return "NILFS";
+       case TST_EXOFS_MAGIC:
+               return "EXOFS";
        default:
                return "Unknown";
        }
-- 
1.8.3.4


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to