Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcachefs: Replace zero-length arrays with flexible-array members

Fake flexible arrays (zero-length and one-element arrays) are
deprecated, and should be replaced by flexible-array members.

So, replace zero-length arrays with flexible-array members
in multiple structures.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

authored by

Gustavo A. R. Silva and committed by
Kent Overstreet
62286a08 8a4b4c52

+5 -5
+2 -2
fs/bcachefs/bcachefs_ioctl.h
··· 276 276 __u32 replica_entries_bytes; 277 277 __u32 pad; 278 278 279 - struct bch_replicas_usage replicas[0]; 279 + struct bch_replicas_usage replicas[]; 280 280 }; 281 281 282 282 /* ··· 313 313 __u32 bucket_size; 314 314 __u64 nr_buckets; 315 315 316 - struct bch_ioctl_dev_usage_type d[0]; 316 + struct bch_ioctl_dev_usage_type d[]; 317 317 }; 318 318 319 319 /*
+1 -1
fs/bcachefs/io_read.c
··· 80 80 struct bpos pos; 81 81 82 82 struct data_update write; 83 - struct bio_vec bi_inline_vecs[0]; /* must be last */ 83 + struct bio_vec bi_inline_vecs[]; /* must be last */ 84 84 }; 85 85 86 86 static const struct rhashtable_params bch_promote_params = {
+1 -1
fs/bcachefs/move.c
··· 70 70 71 71 struct data_update write; 72 72 /* Must be last since it is variable size */ 73 - struct bio_vec bi_inline_vecs[0]; 73 + struct bio_vec bi_inline_vecs[]; 74 74 }; 75 75 76 76 static void move_free(struct moving_io *io)
+1 -1
fs/bcachefs/replicas_types.h
··· 21 21 u64 nr_inodes; 22 22 u64 persistent_reserved[BCH_REPLICAS_MAX]; 23 23 struct {} memset_end; 24 - struct replicas_delta d[0]; 24 + struct replicas_delta d[]; 25 25 }; 26 26 27 27 #endif /* _BCACHEFS_REPLICAS_TYPES_H */