diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-07-01 02:12:43 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-07-01 02:12:43 +0000 |
commit | 13ea39a34766fcbecd96ab94bcdf798b08e9bb60 (patch) | |
tree | 1e1463b03838a6f36868a4dafc7e652358a51857 /ext2fs/ext2_fs.h | |
parent | 1f8d504f631531c199d7c6154a0dc442d80ea4a7 (diff) | |
parent | 7e15f3d69a83a34ac62cbbee944a0bfbfa92724e (diff) |
Merge branch 'master' into xkb
Conflicts:
config.make.in
configure.in
Diffstat (limited to 'ext2fs/ext2_fs.h')
-rw-r--r-- | ext2fs/ext2_fs.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ext2fs/ext2_fs.h b/ext2fs/ext2_fs.h index a8f922e1..b1caeefa 100644 --- a/ext2fs/ext2_fs.h +++ b/ext2fs/ext2_fs.h @@ -203,6 +203,29 @@ struct ext2_group_desc #define EXT2_FL_USER_VISIBLE 0x00001FFF /* User visible flags */ #define EXT2_FL_USER_MODIFIABLE 0x000000FF /* User modifiable flags */ +/* Flags that should be inherited by new inodes from their parent. */ +#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ + EXT2_SYNC_FL | EXT2_NODUMP_FL |\ + EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\ + EXT2_NOCOMP_FL) + +/* Flags that are appropriate for regular files (all but dir-specific ones). */ +#define EXT2_REG_FLMASK (~(0)) + +/* Flags that are appropriate for non-directories/regular files. */ +#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL) + +/* Mask out flags that are inappropriate for the given type of inode. */ +static __inline__ __u32 ext2_mask_flags(mode_t mode, __u32 flags) +{ + if (S_ISDIR(mode)) + return flags; + else if (S_ISREG(mode)) + return flags & EXT2_REG_FLMASK; + else + return flags & EXT2_OTHER_FLMASK; +} + /* * ioctl commands */ |