diff options
Diffstat (limited to 'lib/ext2fs/ext2_fs.h')
-rw-r--r-- | lib/ext2fs/ext2_fs.h | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index e92a0452..01d2573b 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -27,6 +27,18 @@ #endif #endif +#ifndef __nonstring +#ifdef __has_attribute +#if __has_attribute(__nonstring__) +#define __nonstring __attribute__((__nonstring__)) +#else +#define __nonstring +#endif /* __has_attribute(__nonstring__) */ +#else +# define __nonstring +#endif /* __has_attribute */ +#endif /* __nonstring */ + /* * The second extended filesystem constants/structures */ @@ -525,8 +537,8 @@ struct ext2_inode_large { #endif /* __GNU__ */ #endif /* defined(__KERNEL__) || defined(__linux__) */ -#define inode_uid(inode) ((inode).i_uid | (inode).osd2.linux2.l_i_uid_high << 16) -#define inode_gid(inode) ((inode).i_gid | (inode).osd2.linux2.l_i_gid_high << 16) +#define inode_uid(inode) ((inode).i_uid | (unsigned)(inode).osd2.linux2.l_i_uid_high << 16) +#define inode_gid(inode) ((inode).i_gid | (unsigned)(inode).osd2.linux2.l_i_gid_high << 16) #define inode_projid(inode) ((inode).i_projid) #define ext2fs_set_i_uid_high(inode,x) ((inode).osd2.linux2.l_i_uid_high = (x)) #define ext2fs_set_i_gid_high(inode,x) ((inode).osd2.linux2.l_i_gid_high = (x)) @@ -683,9 +695,9 @@ struct ext2_super_block { __u32 s_feature_compat; /* compatible feature set */ /*060*/ __u32 s_feature_incompat; /* incompatible feature set */ __u32 s_feature_ro_compat; /* readonly-compatible feature set */ -/*068*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */ -/*078*/ __u8 s_volume_name[EXT2_LABEL_LEN]; /* volume name, no NUL? */ -/*088*/ __u8 s_last_mounted[64]; /* directory last mounted on, no NUL? */ +/*068*/ __u8 s_uuid[16] __nonstring; /* 128-bit uuid for volume */ +/*078*/ __u8 s_volume_name[EXT2_LABEL_LEN] __nonstring; /* volume name, no NUL? */ +/*088*/ __u8 s_last_mounted[64] __nonstring; /* directory last mounted on, no NUL? */ /*0c8*/ __u32 s_algorithm_usage_bitmap; /* For compression */ /* * Performance hints. Directory preallocation should only @@ -697,7 +709,7 @@ struct ext2_super_block { /* * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set. */ -/*0d0*/ __u8 s_journal_uuid[16]; /* uuid of journal superblock */ +/*0d0*/ __u8 s_journal_uuid[16] __nonstring; /* uuid of journal superblock */ /*0e0*/ __u32 s_journal_inum; /* inode number of journal file */ __u32 s_journal_dev; /* device number of journal file */ __u32 s_last_orphan; /* start of list of inodes to delete */ @@ -733,15 +745,15 @@ struct ext2_super_block { __u32 s_first_error_time; /* first time an error happened */ __u32 s_first_error_ino; /* inode involved in first error */ /*1a0*/ __u64 s_first_error_block; /* block involved in first error */ - __u8 s_first_error_func[32]; /* function where error hit, no NUL? */ + __u8 s_first_error_func[32] __nonstring; /* function where error hit, no NUL? */ /*1c8*/ __u32 s_first_error_line; /* line number where error happened */ __u32 s_last_error_time; /* most recent time of an error */ /*1d0*/ __u32 s_last_error_ino; /* inode involved in last error */ __u32 s_last_error_line; /* line number where error happened */ __u64 s_last_error_block; /* block involved of last error */ -/*1e0*/ __u8 s_last_error_func[32]; /* function where error hit, no NUL? */ +/*1e0*/ __u8 s_last_error_func[32] __nonstring; /* function where error hit, no NUL? */ #define EXT4_S_ERR_END ext4_offsetof(struct ext2_super_block, s_mount_opts) -/*200*/ __u8 s_mount_opts[64]; /* default mount options, no NUL? */ +/*200*/ __u8 s_mount_opts[64] __nonstring; /* default mount options, no NUL? */ /*240*/ __u32 s_usr_quota_inum; /* inode number of user quota file */ __u32 s_grp_quota_inum; /* inode number of group quota file */ __u32 s_overhead_clusters; /* overhead blocks/clusters in fs */ @@ -1137,8 +1149,8 @@ struct mmp_struct { __u32 mmp_magic; /* Magic number for MMP */ __u32 mmp_seq; /* Sequence no. updated periodically */ __u64 mmp_time; /* Time last updated (seconds) */ - __u8 mmp_nodename[64]; /* Node updating MMP block, no NUL? */ - __u8 mmp_bdevname[32]; /* Bdev updating MMP block, no NUL? */ + __u8 mmp_nodename[64] __nonstring; /* Node updating MMP block, no NUL? */ + __u8 mmp_bdevname[32] __nonstring; /* Bdev updating MMP block, no NUL? */ __u16 mmp_check_interval; /* Changed mmp_check_interval */ __u16 mmp_pad1; __u32 mmp_pad2[226]; |