summaryrefslogtreecommitdiff
path: root/block/partition-generic.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 22:36:04 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 22:36:04 (GMT)
commit249f3c4fe4fdef159d3f9b3f7a6c41a92103c860 (patch)
tree58abfec8444741fd3bd403a908be50c4f63d4842 /block/partition-generic.c
parent54573c4a073ff510d028f423ed3074573c7d9437 (diff)
parent18558cae0272f8fd9647e69d3fec1565a7949865 (diff)
downloadlinux-249f3c4fe4fdef159d3f9b3f7a6c41a92103c860.tar.xz
Merge 4.5-rc4 into tty-next
We want the fixes in here, and this resolves a merge error in tty_io.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block/partition-generic.c')
-rw-r--r--block/partition-generic.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 746935a..fefd01b 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -16,6 +16,7 @@
#include <linux/kmod.h>
#include <linux/ctype.h>
#include <linux/genhd.h>
+#include <linux/dax.h>
#include <linux/blktrace_api.h>
#include "partitions/check.h"
@@ -550,13 +551,24 @@ int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
return 0;
}
-unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
+static struct page *read_pagecache_sector(struct block_device *bdev, sector_t n)
{
struct address_space *mapping = bdev->bd_inode->i_mapping;
+
+ return read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_CACHE_SHIFT-9)),
+ NULL);
+}
+
+unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
+{
struct page *page;
- page = read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_CACHE_SHIFT-9)),
- NULL);
+ /* don't populate page cache for dax capable devices */
+ if (IS_DAX(bdev->bd_inode))
+ page = read_dax_sector(bdev, n);
+ else
+ page = read_pagecache_sector(bdev, n);
+
if (!IS_ERR(page)) {
if (PageError(page))
goto fail;