Re: [PATCH v3][next] xfs: Replace one-element arrays with flexible-array members

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 3/10/21 22:47, Darrick J. Wong wrote:
> On Wed, Mar 10, 2021 at 10:23:02PM -0600, Gustavo A. R. Silva wrote:
>> There is a regular need in the kernel to provide a way to declare having
>> a dynamically sized set of trailing elements in a structure. Kernel code
>> should always use “flexible array members”[1] for these cases. The older
>> style of one-element or zero-length arrays should no longer be used[2].
>>
>> Refactor the code according to the use of flexible-array members in
>> multiple structures, instead of one-element arrays. Also, make use of
>> the new struct_size() helper to properly calculate the size of multiple
>> structures that contain flexible-array members. Additionally, wrap
>> some calls to the struct_size() helper in multiple inline functions.
>>
>> Below are the results of running xfstests for groups shutdown and log
>> with the following configuration in local.config:
>>
>> export TEST_DEV=/dev/sda3
>> export TEST_DIR=/mnt/test
>> export SCRATCH_DEV=/dev/sda4
>> export SCRATCH_MNT=/mnt/scratch
>>
>> The size for both partitions /dev/sda3 and /dev/sda4 is 25GB.
> 
> Looks good to me, will toss it at my fstests cloud and see if anything
> shakes out.  Thanks for cleaning up this goofy thorn-pile!

Great. It's been fun to work on this. :p

> Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>

Thanks!
--
Gustavo



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux