On 20.02.19 г. 17:25 ч., Johannes Thumshirn wrote:
> On 20/02/2019 16:11, Nikolay Borisov wrote:
>> We always pass an inode alongside async_cow. fs_info can be referenced
>> from this inode so it makes the explicit fs_info member in
>> struct async_cow redundant, remove it. No functional changes.
>
> [...]
>
>> @@ -1151,13 +1150,10 @@ static noinline void async_cow_start(struct btrfs_work *work)
>> */
>> static noinline void async_cow_submit(struct btrfs_work *work)
>> {
>> - struct btrfs_fs_info *fs_info;
>> - struct async_cow *async_cow;
>> + struct async_cow *async_cow = container_of(work, struct async_cow, work);
>> + struct btrfs_fs_info *fs_info = btrfs_work_owner(work);
>> unsigned long nr_pages;
>
> Nit, in your changelog you write that fs_info can be retrieved from the
> inode that is passed with 'struct async_cow' but you're getting fs_info
> from the btrfs_work structure.
Ah blimey, indeed, this was because the inode could indeed be null so we
can actually take it from the btrfs_work struct which is always
guaranteed to have it initialized. I'll wait for more review comments to
accumulate before resend
>