diff options
author | Theodore Ts'o <tytso@mit.edu> | 2018-08-27 01:15:11 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-08-27 01:15:11 -0400 |
commit | 072ebb3bffe67d71d1f1e52add799f4491eab691 (patch) | |
tree | 26c9b4401a2f54521b1f8e7e186571dc4a4bdaf4 /fs/ext4/ext4.h | |
parent | 863c37fcb14f8b66ea831b45fb35a53ac4a8d69e (diff) |
ext4: add nonstring annotations to ext4.h
This suppresses some false positives in gcc 8's -Wstringop-truncation
Suggested by Miguel Ojeda (hopefully the __nonstring definition will
eventually get accepted in the compiler-gcc.h header file).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 1fc013f3d944..249bcee4d7b2 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -43,6 +43,17 @@ | |||
43 | #define __FS_HAS_ENCRYPTION IS_ENABLED(CONFIG_EXT4_FS_ENCRYPTION) | 43 | #define __FS_HAS_ENCRYPTION IS_ENABLED(CONFIG_EXT4_FS_ENCRYPTION) |
44 | #include <linux/fscrypt.h> | 44 | #include <linux/fscrypt.h> |
45 | 45 | ||
46 | #include <linux/compiler.h> | ||
47 | |||
48 | /* Until this gets included into linux/compiler-gcc.h */ | ||
49 | #ifndef __nonstring | ||
50 | #if defined(GCC_VERSION) && (GCC_VERSION >= 80000) | ||
51 | #define __nonstring __attribute__((nonstring)) | ||
52 | #else | ||
53 | #define __nonstring | ||
54 | #endif | ||
55 | #endif | ||
56 | |||
46 | /* | 57 | /* |
47 | * The fourth extended filesystem constants/structures | 58 | * The fourth extended filesystem constants/structures |
48 | */ | 59 | */ |
@@ -1226,7 +1237,7 @@ struct ext4_super_block { | |||
1226 | __le32 s_feature_ro_compat; /* readonly-compatible feature set */ | 1237 | __le32 s_feature_ro_compat; /* readonly-compatible feature set */ |
1227 | /*68*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */ | 1238 | /*68*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */ |
1228 | /*78*/ char s_volume_name[16]; /* volume name */ | 1239 | /*78*/ char s_volume_name[16]; /* volume name */ |
1229 | /*88*/ char s_last_mounted[64]; /* directory where last mounted */ | 1240 | /*88*/ char s_last_mounted[64] __nonstring; /* directory where last mounted */ |
1230 | /*C8*/ __le32 s_algorithm_usage_bitmap; /* For compression */ | 1241 | /*C8*/ __le32 s_algorithm_usage_bitmap; /* For compression */ |
1231 | /* | 1242 | /* |
1232 | * Performance hints. Directory preallocation should only | 1243 | * Performance hints. Directory preallocation should only |
@@ -1277,13 +1288,13 @@ struct ext4_super_block { | |||
1277 | __le32 s_first_error_time; /* first time an error happened */ | 1288 | __le32 s_first_error_time; /* first time an error happened */ |
1278 | __le32 s_first_error_ino; /* inode involved in first error */ | 1289 | __le32 s_first_error_ino; /* inode involved in first error */ |
1279 | __le64 s_first_error_block; /* block involved of first error */ | 1290 | __le64 s_first_error_block; /* block involved of first error */ |
1280 | __u8 s_first_error_func[32]; /* function where the error happened */ | 1291 | __u8 s_first_error_func[32] __nonstring; /* function where the error happened */ |
1281 | __le32 s_first_error_line; /* line number where error happened */ | 1292 | __le32 s_first_error_line; /* line number where error happened */ |
1282 | __le32 s_last_error_time; /* most recent time of an error */ | 1293 | __le32 s_last_error_time; /* most recent time of an error */ |
1283 | __le32 s_last_error_ino; /* inode involved in last error */ | 1294 | __le32 s_last_error_ino; /* inode involved in last error */ |
1284 | __le32 s_last_error_line; /* line number where error happened */ | 1295 | __le32 s_last_error_line; /* line number where error happened */ |
1285 | __le64 s_last_error_block; /* block involved of last error */ | 1296 | __le64 s_last_error_block; /* block involved of last error */ |
1286 | __u8 s_last_error_func[32]; /* function where the error happened */ | 1297 | __u8 s_last_error_func[32] __nonstring; /* function where the error happened */ |
1287 | #define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts) | 1298 | #define EXT4_S_ERR_END offsetof(struct ext4_super_block, s_mount_opts) |
1288 | __u8 s_mount_opts[64]; | 1299 | __u8 s_mount_opts[64]; |
1289 | __le32 s_usr_quota_inum; /* inode for tracking user quota */ | 1300 | __le32 s_usr_quota_inum; /* inode for tracking user quota */ |