lkml.org 
[lkml]   [2021]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3][next] xfs: Replace one-element arrays with flexible-array members
From
Date


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@kernel.org>

Thanks!
--
Gustavo

\
 
 \ /
  Last update: 2021-03-15 20:56    [W:0.094 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site