|
@@ -351,6 +351,25 @@ static size_t stripe_dax_copy_from_iter(struct dm_target *ti, pgoff_t pgoff,
|
|
return dax_copy_from_iter(dax_dev, pgoff, addr, bytes, i);
|
|
return dax_copy_from_iter(dax_dev, pgoff, addr, bytes, i);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void stripe_dax_flush(struct dm_target *ti, pgoff_t pgoff, void *addr,
|
|
|
|
+ size_t size)
|
|
|
|
+{
|
|
|
|
+ sector_t dev_sector, sector = pgoff * PAGE_SECTORS;
|
|
|
|
+ struct stripe_c *sc = ti->private;
|
|
|
|
+ struct dax_device *dax_dev;
|
|
|
|
+ struct block_device *bdev;
|
|
|
|
+ uint32_t stripe;
|
|
|
|
+
|
|
|
|
+ stripe_map_sector(sc, sector, &stripe, &dev_sector);
|
|
|
|
+ dev_sector += sc->stripe[stripe].physical_start;
|
|
|
|
+ dax_dev = sc->stripe[stripe].dev->dax_dev;
|
|
|
|
+ bdev = sc->stripe[stripe].dev->bdev;
|
|
|
|
+
|
|
|
|
+ if (bdev_dax_pgoff(bdev, dev_sector, ALIGN(size, PAGE_SIZE), &pgoff))
|
|
|
|
+ return;
|
|
|
|
+ dax_flush(dax_dev, pgoff, addr, size);
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Stripe status:
|
|
* Stripe status:
|
|
*
|
|
*
|
|
@@ -471,6 +490,7 @@ static struct target_type stripe_target = {
|
|
.io_hints = stripe_io_hints,
|
|
.io_hints = stripe_io_hints,
|
|
.direct_access = stripe_dax_direct_access,
|
|
.direct_access = stripe_dax_direct_access,
|
|
.dax_copy_from_iter = stripe_dax_copy_from_iter,
|
|
.dax_copy_from_iter = stripe_dax_copy_from_iter,
|
|
|
|
+ .dax_flush = stripe_dax_flush,
|
|
};
|
|
};
|
|
|
|
|
|
int __init dm_stripe_init(void)
|
|
int __init dm_stripe_init(void)
|