diff options
author | David Sterba <dsterba@suse.com> | 2015-11-19 05:42:31 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-01-07 09:01:15 -0500 |
commit | 4d4ab6d6bc05ba65169de9a5391e6ccbe09d8719 (patch) | |
tree | b4402e0388ee13df3bbd6d7f78108436e0dbea6b | |
parent | 20e5506baf3fd651e245bc970d8c11a734ee1b8a (diff) |
btrfs: constify static arrays
There are a few statically initialized arrays that can be made const.
The remaining (like file_system_type, sysfs attributes or prop handlers)
do not allow that due to type mismatch when passed to the APIs or
because the structures are modified through other members.
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 2 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/btrfs/super.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 35489e7129a7..99059fcb563e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -174,7 +174,7 @@ struct btrfs_ordered_sum; | |||
174 | /* csum types */ | 174 | /* csum types */ |
175 | #define BTRFS_CSUM_TYPE_CRC32 0 | 175 | #define BTRFS_CSUM_TYPE_CRC32 0 |
176 | 176 | ||
177 | static int btrfs_csum_sizes[] = { 4 }; | 177 | static const int btrfs_csum_sizes[] = { 4 }; |
178 | 178 | ||
179 | /* four bytes for CRC32 */ | 179 | /* four bytes for CRC32 */ |
180 | #define BTRFS_EMPTY_DIR_SIZE 0 | 180 | #define BTRFS_EMPTY_DIR_SIZE 0 |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c4cfba79ab47..3e1398b123aa 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -83,7 +83,7 @@ struct kmem_cache *btrfs_path_cachep; | |||
83 | struct kmem_cache *btrfs_free_space_cachep; | 83 | struct kmem_cache *btrfs_free_space_cachep; |
84 | 84 | ||
85 | #define S_SHIFT 12 | 85 | #define S_SHIFT 12 |
86 | static unsigned char btrfs_type_by_mode[S_IFMT >> S_SHIFT] = { | 86 | static const unsigned char btrfs_type_by_mode[S_IFMT >> S_SHIFT] = { |
87 | [S_IFREG >> S_SHIFT] = BTRFS_FT_REG_FILE, | 87 | [S_IFREG >> S_SHIFT] = BTRFS_FT_REG_FILE, |
88 | [S_IFDIR >> S_SHIFT] = BTRFS_FT_DIR, | 88 | [S_IFDIR >> S_SHIFT] = BTRFS_FT_DIR, |
89 | [S_IFCHR >> S_SHIFT] = BTRFS_FT_CHRDEV, | 89 | [S_IFCHR >> S_SHIFT] = BTRFS_FT_CHRDEV, |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index da94138eb85e..fd429d7f40ab 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -5286,7 +5286,7 @@ out_unlock: | |||
5286 | static int btrfs_ioctl_get_supported_features(struct file *file, | 5286 | static int btrfs_ioctl_get_supported_features(struct file *file, |
5287 | void __user *arg) | 5287 | void __user *arg) |
5288 | { | 5288 | { |
5289 | static struct btrfs_ioctl_feature_flags features[3] = { | 5289 | static const struct btrfs_ioctl_feature_flags features[3] = { |
5290 | INIT_FEATURE_FLAGS(SUPP), | 5290 | INIT_FEATURE_FLAGS(SUPP), |
5291 | INIT_FEATURE_FLAGS(SAFE_SET), | 5291 | INIT_FEATURE_FLAGS(SAFE_SET), |
5292 | INIT_FEATURE_FLAGS(SAFE_CLEAR) | 5292 | INIT_FEATURE_FLAGS(SAFE_CLEAR) |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 24154e422945..b813fd76f03f 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -309,7 +309,7 @@ enum { | |||
309 | Opt_err, | 309 | Opt_err, |
310 | }; | 310 | }; |
311 | 311 | ||
312 | static match_table_t tokens = { | 312 | static const match_table_t tokens = { |
313 | {Opt_degraded, "degraded"}, | 313 | {Opt_degraded, "degraded"}, |
314 | {Opt_subvol, "subvol=%s"}, | 314 | {Opt_subvol, "subvol=%s"}, |
315 | {Opt_subvolid, "subvolid=%s"}, | 315 | {Opt_subvolid, "subvolid=%s"}, |