|
@@ -185,6 +185,23 @@ struct ext3_group_desc
|
|
EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\
|
|
EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\
|
|
EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL)
|
|
EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL)
|
|
|
|
|
|
|
|
+/* Flags that are appropriate for regular files (all but dir-specific ones). */
|
|
|
|
+#define EXT3_REG_FLMASK (~(EXT3_DIRSYNC_FL | EXT3_TOPDIR_FL))
|
|
|
|
+
|
|
|
|
+/* Flags that are appropriate for non-directories/regular files. */
|
|
|
|
+#define EXT3_OTHER_FLMASK (EXT3_NODUMP_FL | EXT3_NOATIME_FL)
|
|
|
|
+
|
|
|
|
+/* Mask out flags that are inappropriate for the given type of inode. */
|
|
|
|
+static inline __u32 ext3_mask_flags(umode_t mode, __u32 flags)
|
|
|
|
+{
|
|
|
|
+ if (S_ISDIR(mode))
|
|
|
|
+ return flags;
|
|
|
|
+ else if (S_ISREG(mode))
|
|
|
|
+ return flags & EXT3_REG_FLMASK;
|
|
|
|
+ else
|
|
|
|
+ return flags & EXT3_OTHER_FLMASK;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Inode dynamic state flags
|
|
* Inode dynamic state flags
|
|
*/
|
|
*/
|