diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 16:43:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 16:43:16 -0400 |
commit | dff4d1f6fe85627b7ce8e4c5291d8621a1995605 (patch) | |
tree | a5c52d6723d701b63bbd0bbc261b69bd5a56ceb3 /drivers/dax | |
parent | 503f04530fec97f93673ae9048b5312cc4455cfe (diff) | |
parent | c3ca015fab6df124c933b91902f3f2a3473f9da5 (diff) |
Merge tag 'for-4.14/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper updates from Mike Snitzer:
- Some request-based DM core and DM multipath fixes and cleanups
- Constify a few variables in DM core and DM integrity
- Add bufio optimization and checksum failure accounting to DM
integrity
- Fix DM integrity to avoid checking integrity of failed reads
- Fix DM integrity to use init_completion
- A couple DM log-writes target fixes
- Simplify DAX flushing by eliminating the unnecessary flush
abstraction that was stood up for DM's use.
* tag 'for-4.14/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dax: remove the pmem_dax_ops->flush abstraction
dm integrity: use init_completion instead of COMPLETION_INITIALIZER_ONSTACK
dm integrity: make blk_integrity_profile structure const
dm integrity: do not check integrity for failed read operations
dm log writes: fix >512b sectorsize support
dm log writes: don't use all the cpu while waiting to log blocks
dm ioctl: constify ioctl lookup table
dm: constify argument arrays
dm integrity: count and display checksum failures
dm integrity: optimize writing dm-bufio buffers that are partially changed
dm rq: do not update rq partially in each ending bio
dm rq: make dm-sq requeuing behavior consistent with dm-mq behavior
dm mpath: complain about unsupported __multipath_map_bio() return values
dm mpath: avoid that building with W=1 causes gcc 7 to complain about fall-through
Diffstat (limited to 'drivers/dax')
-rw-r--r-- | drivers/dax/super.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 3600ff786646..557b93703532 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c | |||
@@ -201,8 +201,10 @@ static umode_t dax_visible(struct kobject *kobj, struct attribute *a, int n) | |||
201 | if (!dax_dev) | 201 | if (!dax_dev) |
202 | return 0; | 202 | return 0; |
203 | 203 | ||
204 | if (a == &dev_attr_write_cache.attr && !dax_dev->ops->flush) | 204 | #ifndef CONFIG_ARCH_HAS_PMEM_API |
205 | if (a == &dev_attr_write_cache.attr) | ||
205 | return 0; | 206 | return 0; |
207 | #endif | ||
206 | return a->mode; | 208 | return a->mode; |
207 | } | 209 | } |
208 | 210 | ||
@@ -267,18 +269,23 @@ size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | |||
267 | } | 269 | } |
268 | EXPORT_SYMBOL_GPL(dax_copy_from_iter); | 270 | EXPORT_SYMBOL_GPL(dax_copy_from_iter); |
269 | 271 | ||
270 | void dax_flush(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | 272 | #ifdef CONFIG_ARCH_HAS_PMEM_API |
271 | size_t size) | 273 | void arch_wb_cache_pmem(void *addr, size_t size); |
274 | void dax_flush(struct dax_device *dax_dev, void *addr, size_t size) | ||
272 | { | 275 | { |
273 | if (!dax_alive(dax_dev)) | 276 | if (unlikely(!dax_alive(dax_dev))) |
274 | return; | 277 | return; |
275 | 278 | ||
276 | if (!test_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags)) | 279 | if (unlikely(!test_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags))) |
277 | return; | 280 | return; |
278 | 281 | ||
279 | if (dax_dev->ops->flush) | 282 | arch_wb_cache_pmem(addr, size); |
280 | dax_dev->ops->flush(dax_dev, pgoff, addr, size); | ||
281 | } | 283 | } |
284 | #else | ||
285 | void dax_flush(struct dax_device *dax_dev, void *addr, size_t size) | ||
286 | { | ||
287 | } | ||
288 | #endif | ||
282 | EXPORT_SYMBOL_GPL(dax_flush); | 289 | EXPORT_SYMBOL_GPL(dax_flush); |
283 | 290 | ||
284 | void dax_write_cache(struct dax_device *dax_dev, bool wc) | 291 | void dax_write_cache(struct dax_device *dax_dev, bool wc) |