@@ -360,10 +360,32 @@ static size_t stripe_dax_copy_to_iter(struct dm_target *ti, pgoff_t pgoff,
360
360
return dax_copy_to_iter (dax_dev , pgoff , addr , bytes , i );
361
361
}
362
362
363
+ static int stripe_dax_zero_page_range (struct dm_target * ti , pgoff_t pgoff ,
364
+ size_t nr_pages )
365
+ {
366
+ int ret ;
367
+ sector_t dev_sector , sector = pgoff * PAGE_SECTORS ;
368
+ struct stripe_c * sc = ti -> private ;
369
+ struct dax_device * dax_dev ;
370
+ struct block_device * bdev ;
371
+ uint32_t stripe ;
372
+
373
+ stripe_map_sector (sc , sector , & stripe , & dev_sector );
374
+ dev_sector += sc -> stripe [stripe ].physical_start ;
375
+ dax_dev = sc -> stripe [stripe ].dev -> dax_dev ;
376
+ bdev = sc -> stripe [stripe ].dev -> bdev ;
377
+
378
+ ret = bdev_dax_pgoff (bdev , dev_sector , nr_pages << PAGE_SHIFT , & pgoff );
379
+ if (ret )
380
+ return ret ;
381
+ return dax_zero_page_range (dax_dev , pgoff , nr_pages );
382
+ }
383
+
363
384
#else
364
385
#define stripe_dax_direct_access NULL
365
386
#define stripe_dax_copy_from_iter NULL
366
387
#define stripe_dax_copy_to_iter NULL
388
+ #define stripe_dax_zero_page_range NULL
367
389
#endif
368
390
369
391
/*
@@ -486,6 +508,7 @@ static struct target_type stripe_target = {
486
508
.direct_access = stripe_dax_direct_access ,
487
509
.dax_copy_from_iter = stripe_dax_copy_from_iter ,
488
510
.dax_copy_to_iter = stripe_dax_copy_to_iter ,
511
+ .dax_zero_page_range = stripe_dax_zero_page_range ,
489
512
};
490
513
491
514
int __init dm_stripe_init (void )
0 commit comments