lkml.org 
[lkml]   [2020]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 1/9] include/linux/pagemap.h: introduce set/clear_fs_page_private
From
Date
Hi Christoph,

On 4/27/20 7:52 AM, Christoph Hellwig wrote:
> Why not attach_page_private and clear_page_private as that conveys
> the use case a little better?

Yes, thanks for the good suggestion. Will rename them if no one else
has new idea ...

>> +static inline void *set_fs_page_private(struct page *page, void *data)
>> +{
>> + get_page(page);
>> + set_page_private(page, (unsigned long)data);
>> + SetPagePrivate(page);
>> +
>> + return data;
>> +}
>> +
>> +static inline void *clear_fs_page_private(struct page *page)
>> +{
>> + void *data = (void *)page_private(page);
>> +
>> + if (!PagePrivate(page))
>> + return NULL;
>> + ClearPagePrivate(page);
>> + set_page_private(page, 0);
>> + put_page(page);
>> +
>> + return data;
>> +}
> Can you add kerneldoc comments describing them, including why we
> take the refernces?

Ok, will do.

> Also what is the point of the return value of set_fs_page_private?

In this way, iomap_page_create can just return the function, but you
don't like this way as you replied, will change the return value to "void".

Thanks,
Guoqing

\
 
 \ /
  Last update: 2020-04-27 10:10    [W:0.096 / U:2.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site