mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
flexible-array transformations for 6.6-rc1
Hi Linus, Please, pull the following flexible-array transformations. These patches have been baking in linux-next for a while. Thanks -- Gustavo -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkmRahXBSurMIg1YvRwW0y0cG2zEFAmTtBEQACgkQRwW0y0cG 2zHgeBAAm1D5H+4THFOuYVsl93igowMbcPwraoo2xxnNtLqQR4y6p9SiWcjh2vk3 bmabPtID3jPZytjpV6QUYe6JlcOoWc2LsNTWqwnt2X2fhcovJfGMc/K3+7bRQzE8 uBqooxkiaZvPiUATeo0zdBSN9aYWXvEpYrBR5J9EtJWyS93LiYb/nn2DY+0d1yrY 89koxTV9/eOKJ7xi6UB0zWbyayor+JawX5RI2ysMFHO6UB2aVrNjqUCJP51dyywa 2QKtwkY/8vQIo8Y8c7ReApHR0t+s0jmxRi9ip+4rh/0VNl8ON5SoL+EcRB5FLCTn E/VqQcebjIwo0AfeEzUQIc68E1hZJLYhGGJupF1Wsb9IvmbdTTMhhfLJmWStz5+E GnNpXx9gTjCoM5+FqJlMkHgxT9JpHYSV5LtnZKmM7wiexHND+5T/ukAxRUhFjLY3 saMbXnJ85kHsNYLAxIDUfdRcXEDNBJl7XiVI2YRCI9fttD+GVjdFtATdNZFsFAge kHZCAFloFHwe0lTcksN5I/NVdDc6Jv7ABjrTKNezfrjfRn24zvR61V54/ebPp5Fs 2JA5kVJpgGnUdIM2uot2lYLCmLDjhGNfXE95AjK0SdJXrZtzYqzTcKJg6w1gz3ZJ VHWK4snsu48KxTx66f+v38ovKXLtlA8Rk8kYOHWXYgB0ZXOOAy4= =L9kF -----END PGP SIGNATURE----- Merge tag 'flex-array-transformations-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull flexible-array updates from Gustavo A. R. Silva. * tag 'flex-array-transformations-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: fs: omfs: Use flexible-array member in struct omfs_extent sparc: openpromio: Address -Warray-bounds warning reiserfs: Replace one-element array with flexible-array member
This commit is contained in:
commit
9d6b14cd1e
@ -10,10 +10,9 @@
|
||||
* were chosen to be exactly equal to the SunOS equivalents.
|
||||
*/
|
||||
|
||||
struct openpromio
|
||||
{
|
||||
struct openpromio {
|
||||
unsigned int oprom_size; /* Actual size of the oprom_array. */
|
||||
char oprom_array[1]; /* Holds property names and values. */
|
||||
char oprom_array[]; /* Holds property names and values. */
|
||||
};
|
||||
|
||||
#define OPROMMAXPARAM 4096 /* Maximum size of oprom_array. */
|
||||
|
@ -14,7 +14,7 @@ static u32 omfs_max_extents(struct omfs_sb_info *sbi, int offset)
|
||||
{
|
||||
return (sbi->s_sys_blocksize - offset -
|
||||
sizeof(struct omfs_extent)) /
|
||||
sizeof(struct omfs_extent_entry) + 1;
|
||||
sizeof(struct omfs_extent_entry);
|
||||
}
|
||||
|
||||
void omfs_make_empty_table(struct buffer_head *bh, int offset)
|
||||
@ -24,8 +24,8 @@ void omfs_make_empty_table(struct buffer_head *bh, int offset)
|
||||
oe->e_next = ~cpu_to_be64(0ULL);
|
||||
oe->e_extent_count = cpu_to_be32(1),
|
||||
oe->e_fill = cpu_to_be32(0x22),
|
||||
oe->e_entry.e_cluster = ~cpu_to_be64(0ULL);
|
||||
oe->e_entry.e_blocks = ~cpu_to_be64(0ULL);
|
||||
oe->e_entry[0].e_cluster = ~cpu_to_be64(0ULL);
|
||||
oe->e_entry[0].e_blocks = ~cpu_to_be64(0ULL);
|
||||
}
|
||||
|
||||
int omfs_shrink_inode(struct inode *inode)
|
||||
@ -68,7 +68,7 @@ int omfs_shrink_inode(struct inode *inode)
|
||||
|
||||
last = next;
|
||||
next = be64_to_cpu(oe->e_next);
|
||||
entry = &oe->e_entry;
|
||||
entry = oe->e_entry;
|
||||
|
||||
/* ignore last entry as it is the terminator */
|
||||
for (; extent_count > 1; extent_count--) {
|
||||
@ -117,7 +117,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
|
||||
u64 *ret_block)
|
||||
{
|
||||
struct omfs_extent_entry *terminator;
|
||||
struct omfs_extent_entry *entry = &oe->e_entry;
|
||||
struct omfs_extent_entry *entry = oe->e_entry;
|
||||
struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb);
|
||||
u32 extent_count = be32_to_cpu(oe->e_extent_count);
|
||||
u64 new_block = 0;
|
||||
@ -245,7 +245,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,
|
||||
|
||||
extent_count = be32_to_cpu(oe->e_extent_count);
|
||||
next = be64_to_cpu(oe->e_next);
|
||||
entry = &oe->e_entry;
|
||||
entry = oe->e_entry;
|
||||
|
||||
if (extent_count > max_extents)
|
||||
goto out_brelse;
|
||||
|
@ -77,7 +77,7 @@ struct omfs_extent {
|
||||
__be64 e_next; /* next extent table location */
|
||||
__be32 e_extent_count; /* total # extents in this table */
|
||||
__be32 e_fill;
|
||||
struct omfs_extent_entry e_entry; /* start of extent entries */
|
||||
struct omfs_extent_entry e_entry[]; /* start of extent entries */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -2252,8 +2252,9 @@ static int get_virtual_node_size(struct super_block *sb, struct buffer_head *bh)
|
||||
|
||||
return sizeof(struct virtual_node) +
|
||||
max(max_num_of_items * sizeof(struct virtual_item),
|
||||
sizeof(struct virtual_item) + sizeof(struct direntry_uarea) +
|
||||
(max_num_of_entries - 1) * sizeof(__u16));
|
||||
sizeof(struct virtual_item) +
|
||||
struct_size_t(struct direntry_uarea, entry_sizes,
|
||||
max_num_of_entries));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2373,7 +2373,7 @@ struct virtual_node {
|
||||
struct direntry_uarea {
|
||||
int flags;
|
||||
__u16 entry_count;
|
||||
__u16 entry_sizes[1];
|
||||
__u16 entry_sizes[];
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
/***************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user