summaryrefslogtreecommitdiffstats
path: root/block/partition-generic.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-01-27 17:13:15 -0500
committerDan Williams <dan.j.williams@intel.com>2017-04-25 16:20:46 -0400
commita41fe02b6bba853a29c864d00fd161bbe6cfc715 (patch)
tree7060e9ed2234c8b6b2cc99523f18ed66bddba33a /block/partition-generic.c
parentfa5d932c323e8e0d9b24b3517997d15b36d1607d (diff)
Revert "block: use DAX for partition table reads"
commit d1a5f2b4d8a1 ("block: use DAX for partition table reads") was part of a stalled effort to allow dax mappings of block devices. Since then the device-dax mechanism has filled the role of dax-mapping static device ranges. Now that we are moving ->direct_access() from a block_device operation to a dax_inode operation we would need block devices to map and carry their own dax_inode reference. Unless / until we decide to revive dax mapping of raw block devices through the dax_inode scheme, there is no need to carry read_dax_sector(). Its removal in turn allows for the removal of bdev_direct_access() and should have been included in commit 223757016837 ("block_dev: remove DAX leftovers"). Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'block/partition-generic.c')
-rw-r--r--block/partition-generic.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 7afb9907821f..5dfac337b0f2 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -16,7 +16,6 @@
16#include <linux/kmod.h> 16#include <linux/kmod.h>
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18#include <linux/genhd.h> 18#include <linux/genhd.h>
19#include <linux/dax.h>
20#include <linux/blktrace_api.h> 19#include <linux/blktrace_api.h>
21 20
22#include "partitions/check.h" 21#include "partitions/check.h"
@@ -631,24 +630,12 @@ int invalidate_partitions(struct gendisk *disk, struct block_device *bdev)
631 return 0; 630 return 0;
632} 631}
633 632
634static struct page *read_pagecache_sector(struct block_device *bdev, sector_t n)
635{
636 struct address_space *mapping = bdev->bd_inode->i_mapping;
637
638 return read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_SHIFT-9)),
639 NULL);
640}
641
642unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p) 633unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
643{ 634{
635 struct address_space *mapping = bdev->bd_inode->i_mapping;
644 struct page *page; 636 struct page *page;
645 637
646 /* don't populate page cache for dax capable devices */ 638 page = read_mapping_page(mapping, (pgoff_t)(n >> (PAGE_SHIFT-9)), NULL);
647 if (IS_DAX(bdev->bd_inode))
648 page = read_dax_sector(bdev, n);
649 else
650 page = read_pagecache_sector(bdev, n);
651
652 if (!IS_ERR(page)) { 639 if (!IS_ERR(page)) {
653 if (PageError(page)) 640 if (PageError(page))
654 goto fail; 641 goto fail;