1. 21 4月, 2017 1 次提交
    • D
      dax: introduce dax_direct_access() · b0686260
      Dan Williams 提交于
      Replace bdev_direct_access() with dax_direct_access() that uses
      dax_device and dax_operations instead of a block_device and
      block_device_operations for dax. Once all consumers of the old api have
      been converted bdev_direct_access() will be deleted.
      
      Given that block device partitioning decisions can cause dax page
      alignment constraints to be violated this also introduces the
      bdev_dax_pgoff() helper. It handles calculating a logical pgoff relative
      to the dax_device and also checks for page alignment.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      b0686260
  2. 20 4月, 2017 2 次提交
    • D
      dax: introduce dax_operations · 6568b08b
      Dan Williams 提交于
      Track a set of dax_operations per dax_device that can be set at
      alloc_dax() time. These operations will be used to stop the abuse of
      block_device_operations for communicating dax capabilities to
      filesystems. It will also be used to replace the "pmem api" and move
      pmem-specific cache maintenance, and other dax-driver-specific
      filesystem-dax operations, to dax device methods. In particular this
      allows us to stop abusing __copy_user_nocache(), via memcpy_to_pmem(),
      with a driver specific replacement.
      
      This is a standalone introduction of the operations. Follow on patches
      convert each dax-driver and teach fs/dax.c to use ->direct_access() from
      dax_operations instead of block_device_operations.
      Suggested-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      6568b08b
    • D
      dax: add a facility to lookup a dax device by 'host' device name · 72058005
      Dan Williams 提交于
      For the current block_device based filesystem-dax path, we need a way
      for it to lookup the dax_device associated with a block_device. Add a
      'host' property of a dax_device that can be used for this purpose. It is
      a free form string, but for a dax_device associated with a block device
      it is the bdev name.
      
      This is a stop-gap until filesystems are able to mount on a dax-inode
      directly.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      72058005
  3. 13 4月, 2017 1 次提交
    • D
      dax: refactor dax-fs into a generic provider of 'struct dax_device' instances · 7b6be844
      Dan Williams 提交于
      We want dax capable drivers to be able to publish a set of dax
      operations [1]. However, we do not want to further abuse block_devices
      to advertise these operations. Instead we will attach these operations
      to a dax device and add a lookup mechanism to go from block device path
      to a dax device. A dax capable driver like pmem or brd is responsible
      for registering a dax device, alongside a block device, and then a dax
      capable filesystem is responsible for retrieving the dax device by path
      name if it wants to call dax_operations.
      
      For now, we refactor the dax pseudo-fs to be a generic facility, rather
      than an implementation detail, of the device-dax use case. Where a "dax
      device" is just an inode + dax infrastructure, and "Device DAX" is a
      mapping service layered on top of that base 'struct dax_device'.
      "Filesystem DAX" is then a mapping service that layers a filesystem on
      top of that same base device. Filesystem DAX is associated with a
      block_device for now, but perhaps directly to a dax device in the
      future, or for new pmem-only filesystems.
      
      [1]: https://lkml.org/lkml/2017/1/19/880Suggested-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      7b6be844