File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -465,18 +465,18 @@ void iova_bitmap_set(struct iova_bitmap *bitmap,
465
465
last_bit - cur_bit + 1 );
466
466
void * kaddr ;
467
467
468
- if (unlikely (page_idx > last_page_idx ))
468
+ if (unlikely (page_idx > last_page_idx )) {
469
+ unsigned long left =
470
+ ((last_bit - cur_bit + 1 ) << mapped -> pgshift );
471
+
472
+ bitmap -> set_ahead_length = left ;
469
473
break ;
474
+ }
470
475
471
476
kaddr = kmap_local_page (mapped -> pages [page_idx ]);
472
477
bitmap_set (kaddr , offset , nbits );
473
478
kunmap_local (kaddr );
474
479
cur_bit += nbits ;
475
480
} while (cur_bit <= last_bit );
476
-
477
- if (unlikely (cur_bit <= last_bit )) {
478
- bitmap -> set_ahead_length =
479
- ((last_bit - cur_bit + 1 ) << bitmap -> mapped .pgshift );
480
- }
481
481
}
482
482
EXPORT_SYMBOL_NS_GPL (iova_bitmap_set , IOMMUFD );
You can’t perform that action at this time.
0 commit comments