Skip to content

Commit

Permalink
Merge branch 'for-4.7/dax' into libnvdimm-for-next
Browse files Browse the repository at this point in the history
  • Loading branch information
djbw committed May 21, 2016
2 parents 1b982ba + 03dca34 commit 36092ee
Show file tree
Hide file tree
Showing 26 changed files with 935 additions and 143 deletions.
32 changes: 0 additions & 32 deletions block/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,35 +407,6 @@ static inline int is_unrecognized_ioctl(int ret)
ret == -ENOIOCTLCMD;
}

#ifdef CONFIG_FS_DAX
bool blkdev_dax_capable(struct block_device *bdev)
{
struct gendisk *disk = bdev->bd_disk;

if (!disk->fops->direct_access)
return false;

/*
* If the partition is not aligned on a page boundary, we can't
* do dax I/O to it.
*/
if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
return false;

/*
* If the device has known bad blocks, force all I/O through the
* driver / page cache.
*
* TODO: support finer grained dax error handling
*/
if (disk->bb && disk->bb->count)
return false;

return true;
}
#endif

static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
unsigned cmd, unsigned long arg)
{
Expand Down Expand Up @@ -598,9 +569,6 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
case BLKTRACESETUP:
case BLKTRACETEARDOWN:
return blk_trace_ioctl(bdev, cmd, argp);
case BLKDAXGET:
return put_int(arg, !!(bdev->bd_inode->i_flags & S_DAX));
break;
case IOC_PR_REGISTER:
return blkdev_pr_register(bdev, argp);
case IOC_PR_RESERVE:
Expand Down
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ source "drivers/android/Kconfig"

source "drivers/nvdimm/Kconfig"

source "drivers/dax/Kconfig"

source "drivers/nvmem/Kconfig"

source "drivers/hwtracing/stm/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ obj-$(CONFIG_PARPORT) += parport/
obj-$(CONFIG_NVM) += lightnvm/
obj-y += base/ block/ misc/ mfd/ nfc/
obj-$(CONFIG_LIBNVDIMM) += nvdimm/
obj-$(CONFIG_DEV_DAX) += dax/
obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
obj-$(CONFIG_NUBUS) += nubus/
obj-y += macintosh/
Expand Down
26 changes: 26 additions & 0 deletions drivers/dax/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
menuconfig DEV_DAX
tristate "DAX: direct access to differentiated memory"
default m if NVDIMM_DAX
depends on TRANSPARENT_HUGEPAGE
help
Support raw access to differentiated (persistence, bandwidth,
latency...) memory via an mmap(2) capable character
device. Platform firmware or a device driver may identify a
platform memory resource that is differentiated from the
baseline memory pool. Mappings of a /dev/daxX.Y device impose
restrictions that make the mapping behavior deterministic.

if DEV_DAX

config DEV_DAX_PMEM
tristate "PMEM DAX: direct access to persistent memory"
depends on NVDIMM_DAX
default DEV_DAX
help
Support raw access to persistent memory. Note that this
driver consumes memory ranges allocated and exported by the
libnvdimm sub-system.

Say Y if unsure

endif
4 changes: 4 additions & 0 deletions drivers/dax/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
obj-$(CONFIG_DEV_DAX) += dax.o
obj-$(CONFIG_DEV_DAX_PMEM) += dax_pmem.o

dax_pmem-y := pmem.o
Loading

0 comments on commit 36092ee

Please sign in to comment.