aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/ext2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fs/ext2.h')
-rw-r--r--src/kernel/fs/ext2.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/kernel/fs/ext2.h b/src/kernel/fs/ext2.h
index f98531e..2fd0e83 100644
--- a/src/kernel/fs/ext2.h
+++ b/src/kernel/fs/ext2.h
@@ -58,7 +58,7 @@ struct bgd {
} __attribute__((packed));
struct ext2_inode {
- uint16_t type_and_permissions;
+ uint16_t mode;
uint16_t uid;
uint32_t size;
@@ -93,6 +93,14 @@ struct ext2_inode {
#define S_IFLNK 0xA000
#define S_IFSOCK 0xC000
+#define S_ISDIR(m) ((m & 0170000) == 0040000)
+#define S_ISCHR(m) ((m & 0170000) == 0020000)
+#define S_ISBLK(m) ((m & 0170000) == 0060000)
+#define S_ISREG(m) ((m & 0170000) == 0100000)
+#define S_ISFIFO(m) ((m & 0170000) == 0010000)
+#define S_ISLNK(m) ((m & 0170000) == 0120000)
+#define S_ISSOCK(m) ((m & 0170000) == 0140000)
+
#define S_ISUID 04000
#define S_ISGID 02000
#define S_ISTICK 01000