lkml.org 
[lkml]   [2021]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/7] fsdax: Copy data before write
From
Date


On 2021/2/8 下午11:14, Christoph Hellwig wrote:
>> switch (iomap.type) {
>> case IOMAP_MAPPED:
>> +cow:
>> if (iomap.flags & IOMAP_F_NEW) {
>> count_vm_event(PGMAJFAULT);
>> count_memcg_event_mm(vma->vm_mm, PGMAJFAULT);
>> major = VM_FAULT_MAJOR;
>> }
>> error = dax_iomap_direct_access(&iomap, pos, PAGE_SIZE,
>> - NULL, &pfn);
>> + &kaddr, &pfn);
>
> Any chance you could look into factoring out this code into a helper
> to avoid the goto magic, which is a little too convoluted?
>
>> switch (iomap.type) {
>> case IOMAP_MAPPED:
>> +cow:
>> error = dax_iomap_direct_access(&iomap, pos, PMD_SIZE,
>> - NULL, &pfn);
>> + &kaddr, &pfn);
>> if (error < 0)
>> goto finish_iomap;
>>
>> entry = dax_insert_entry(&xas, mapping, vmf, entry, pfn,
>> DAX_PMD, write && !sync);
>>
>> + if (srcmap.type != IOMAP_HOLE) {
>
> Same here.

Thanks for suggestion. I'll try it.


--
Thanks,
Ruan Shiyang.
>
>


\
 
 \ /
  Last update: 2021-02-09 02:55    [W:0.064 / U:6.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site