libnvdimm, pmem: Change pmem physical sector size to PAGE_SIZE
authorVishal Verma <vishal.l.verma@intel.com>
Thu, 23 Jul 2015 17:58:48 +0000 (11:58 -0600)
committerDan Williams <dan.j.williams@intel.com>
Tue, 28 Jul 2015 02:53:19 +0000 (22:53 -0400)
Based on a patch: c8fa317 brd: Request from fdisk 4k alignment by Boaz
Harrosh, allow fdisk to create properly aligned partitions for DAX. This
will also cause mkfs.ext4 to emit a warning if using a file system block
size of less than PAGE_SIZE.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Elliott, Robert <Elliott@hp.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Acked-by: Boaz Harrosh <boaz@plexistor.com>
Acked-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pmem.c

index ade9eb917a4d945b4ff9bd69ebbed1b3fedfd742..bcf48f1334431bd3db3be5966bc2676084ea5d45 100644 (file)
@@ -162,6 +162,7 @@ static int pmem_attach_disk(struct nd_namespace_common *ndns,
                return -ENOMEM;
 
        blk_queue_make_request(pmem->pmem_queue, pmem_make_request);
+       blk_queue_physical_block_size(pmem->pmem_queue, PAGE_SIZE);
        blk_queue_max_hw_sectors(pmem->pmem_queue, UINT_MAX);
        blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY);
        queue_flag_set_unlocked(QUEUE_FLAG_NONROT, pmem->pmem_queue);