Re: [PATCH 2/2 V2] xfs: don't take addresses of packed xfs_rmap_key member

Eric Sandeen
2020-01-29T18:31:28Z

On 1/29/20 12:29 PM, Christoph Hellwig wrote:
> On Wed, Jan 29, 2020 at 12:15:06PM -0600, Eric Sandeen wrote:
>> {
>> uint64_t off;
>> + xfs_agblock_t start;
>> int adj;
>>
>> adj = be32_to_cpu(rec->rmap.rm_blockcount) - 1;
>>
>> key->rmap.rm_startblock = rec->rmap.rm_startblock;
>> - be32_add_cpu(&key->rmap.rm_startblock, adj);
>> + start = be32_to_cpu(key->rmap.rm_startblock) - adj;
>> + key->rmap.rm_startblock = cpu_to_be32(start);
>
> Do we really need the local variable? Why not:
>
> key->rmap.rm_startblock =
> cpu_to_be32(be32_to_cpu(key->rmap.rm_startblock) - adj);
>

Sure

-Eric