[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0471728-6a03-3e44-f0cc-adb1a6bd3470@cloud.ionos.com>
Date: Mon, 27 Apr 2020 10:14:17 +0200
From: Guoqing Jiang <guoqing.jiang@...ud.ionos.com>
To: Dave Chinner <david@...morbit.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
hch@...radead.org, willy@...radead.org, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>, linux-btrfs@...r.kernel.org
Subject: Re: [RFC PATCH 3/9] btrfs: use set/clear_fs_page_private
On 4/27/20 12:20 AM, Dave Chinner wrote:
> On Sun, Apr 26, 2020 at 11:49:19PM +0200, Guoqing Jiang wrote:
>> Since the new pair function is introduced, we can call them to clean the
>> code in btrfs.
>>
>> Cc: Chris Mason <clm@...com>
>> Cc: Josef Bacik <josef@...icpanda.com>
>> Cc: David Sterba <dsterba@...e.com>
>> Cc: linux-btrfs@...r.kernel.org
>> Signed-off-by: Guoqing Jiang <guoqing.jiang@...ud.ionos.com>
> ....
>
>> void set_page_extent_mapped(struct page *page)
>> {
>> - if (!PagePrivate(page)) {
>> - SetPagePrivate(page);
>> - get_page(page);
>> - set_page_private(page, EXTENT_PAGE_PRIVATE);
>> - }
>> + if (!PagePrivate(page))
>> + set_fs_page_private(page, (void *)EXTENT_PAGE_PRIVATE);
> Change the definition of EXTENT_PAGE_PRIVATE so the cast is not
> needed? Nothing ever reads EXTENT_PAGE_PRIVATE; it's only there to
> set the private flag for other code to check and release the extent
> mapping reference to the page...
Not know the code well, so I just make the cast ...
>> @@ -8331,11 +8328,9 @@ static int btrfs_migratepage(struct address_space *mapping,
>>
>> if (page_has_private(page)) {
>> ClearPagePrivate(page);
>> - get_page(newpage);
>> - set_page_private(newpage, page_private(page));
>> + set_fs_page_private(newpage, (void *)page_private(page));
>> set_page_private(page, 0);
>> put_page(page);
>> - SetPagePrivate(newpage);
>> }
> This is just:
> set_fs_page_private(newpage, clear_fs_page_private(page));
>
Thanks a lot! It is more better.
Thanks,
Guoqing
Powered by blists - more mailing lists