Merge branch 'libnvdimm-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fixes from Dan Williams: "A couple of compile fixes. With the removal of the ->direct_access() method from block_device_operations in favor of a new dax_device + dax_operations we broke two configurations. The CONFIG_BLOCK=n case is fixed by compiling out the block+dax helpers in the dax core. Configurations with FS_DAX=n EXT4=y / XFS=y and DAX=m fail due to the helpers the builtin filesystem needs being in a module, so we stub out the helpers in the FS_DAX=n case." * 'libnvdimm-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax, xfs, ext4: compile out iomap-dax paths in the FS_DAX=n case dax: fix false CONFIG_BLOCK dependency
This commit is contained in:
@ -44,6 +44,7 @@ void dax_read_unlock(int id)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(dax_read_unlock);
|
EXPORT_SYMBOL_GPL(dax_read_unlock);
|
||||||
|
|
||||||
|
#ifdef CONFIG_BLOCK
|
||||||
int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size,
|
int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size,
|
||||||
pgoff_t *pgoff)
|
pgoff_t *pgoff)
|
||||||
{
|
{
|
||||||
@ -112,6 +113,7 @@ int __bdev_dax_supported(struct super_block *sb, int blocksize)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(__bdev_dax_supported);
|
EXPORT_SYMBOL_GPL(__bdev_dax_supported);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct dax_device - anchor object for dax services
|
* struct dax_device - anchor object for dax services
|
||||||
|
@ -817,7 +817,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
|
|||||||
iomap->bdev = bdev;
|
iomap->bdev = bdev;
|
||||||
iomap->offset = (u64)first_block << blkbits;
|
iomap->offset = (u64)first_block << blkbits;
|
||||||
if (blk_queue_dax(bdev->bd_queue))
|
if (blk_queue_dax(bdev->bd_queue))
|
||||||
iomap->dax_dev = dax_get_by_host(bdev->bd_disk->disk_name);
|
iomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);
|
||||||
else
|
else
|
||||||
iomap->dax_dev = NULL;
|
iomap->dax_dev = NULL;
|
||||||
|
|
||||||
@ -841,7 +841,7 @@ static int
|
|||||||
ext2_iomap_end(struct inode *inode, loff_t offset, loff_t length,
|
ext2_iomap_end(struct inode *inode, loff_t offset, loff_t length,
|
||||||
ssize_t written, unsigned flags, struct iomap *iomap)
|
ssize_t written, unsigned flags, struct iomap *iomap)
|
||||||
{
|
{
|
||||||
put_dax(iomap->dax_dev);
|
fs_put_dax(iomap->dax_dev);
|
||||||
if (iomap->type == IOMAP_MAPPED &&
|
if (iomap->type == IOMAP_MAPPED &&
|
||||||
written < length &&
|
written < length &&
|
||||||
(flags & IOMAP_WRITE))
|
(flags & IOMAP_WRITE))
|
||||||
|
@ -3412,7 +3412,7 @@ retry:
|
|||||||
bdev = inode->i_sb->s_bdev;
|
bdev = inode->i_sb->s_bdev;
|
||||||
iomap->bdev = bdev;
|
iomap->bdev = bdev;
|
||||||
if (blk_queue_dax(bdev->bd_queue))
|
if (blk_queue_dax(bdev->bd_queue))
|
||||||
iomap->dax_dev = dax_get_by_host(bdev->bd_disk->disk_name);
|
iomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);
|
||||||
else
|
else
|
||||||
iomap->dax_dev = NULL;
|
iomap->dax_dev = NULL;
|
||||||
iomap->offset = first_block << blkbits;
|
iomap->offset = first_block << blkbits;
|
||||||
@ -3447,7 +3447,7 @@ static int ext4_iomap_end(struct inode *inode, loff_t offset, loff_t length,
|
|||||||
int blkbits = inode->i_blkbits;
|
int blkbits = inode->i_blkbits;
|
||||||
bool truncate = false;
|
bool truncate = false;
|
||||||
|
|
||||||
put_dax(iomap->dax_dev);
|
fs_put_dax(iomap->dax_dev);
|
||||||
if (!(flags & IOMAP_WRITE) || (flags & IOMAP_FAULT))
|
if (!(flags & IOMAP_WRITE) || (flags & IOMAP_FAULT))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -1068,7 +1068,7 @@ xfs_file_iomap_begin(
|
|||||||
/* optionally associate a dax device with the iomap bdev */
|
/* optionally associate a dax device with the iomap bdev */
|
||||||
bdev = iomap->bdev;
|
bdev = iomap->bdev;
|
||||||
if (blk_queue_dax(bdev->bd_queue))
|
if (blk_queue_dax(bdev->bd_queue))
|
||||||
iomap->dax_dev = dax_get_by_host(bdev->bd_disk->disk_name);
|
iomap->dax_dev = fs_dax_get_by_host(bdev->bd_disk->disk_name);
|
||||||
else
|
else
|
||||||
iomap->dax_dev = NULL;
|
iomap->dax_dev = NULL;
|
||||||
|
|
||||||
@ -1149,7 +1149,7 @@ xfs_file_iomap_end(
|
|||||||
unsigned flags,
|
unsigned flags,
|
||||||
struct iomap *iomap)
|
struct iomap *iomap)
|
||||||
{
|
{
|
||||||
put_dax(iomap->dax_dev);
|
fs_put_dax(iomap->dax_dev);
|
||||||
if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)
|
if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)
|
||||||
return xfs_file_iomap_end_delalloc(XFS_I(inode), offset,
|
return xfs_file_iomap_end_delalloc(XFS_I(inode), offset,
|
||||||
length, written, iomap);
|
length, written, iomap);
|
||||||
|
@ -18,20 +18,6 @@ struct dax_operations {
|
|||||||
void **, pfn_t *);
|
void **, pfn_t *);
|
||||||
};
|
};
|
||||||
|
|
||||||
int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff);
|
|
||||||
#if IS_ENABLED(CONFIG_FS_DAX)
|
|
||||||
int __bdev_dax_supported(struct super_block *sb, int blocksize);
|
|
||||||
static inline int bdev_dax_supported(struct super_block *sb, int blocksize)
|
|
||||||
{
|
|
||||||
return __bdev_dax_supported(sb, blocksize);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static inline int bdev_dax_supported(struct super_block *sb, int blocksize)
|
|
||||||
{
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_DAX)
|
#if IS_ENABLED(CONFIG_DAX)
|
||||||
struct dax_device *dax_get_by_host(const char *host);
|
struct dax_device *dax_get_by_host(const char *host);
|
||||||
void put_dax(struct dax_device *dax_dev);
|
void put_dax(struct dax_device *dax_dev);
|
||||||
@ -46,6 +32,40 @@ static inline void put_dax(struct dax_device *dax_dev)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff);
|
||||||
|
#if IS_ENABLED(CONFIG_FS_DAX)
|
||||||
|
int __bdev_dax_supported(struct super_block *sb, int blocksize);
|
||||||
|
static inline int bdev_dax_supported(struct super_block *sb, int blocksize)
|
||||||
|
{
|
||||||
|
return __bdev_dax_supported(sb, blocksize);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct dax_device *fs_dax_get_by_host(const char *host)
|
||||||
|
{
|
||||||
|
return dax_get_by_host(host);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void fs_put_dax(struct dax_device *dax_dev)
|
||||||
|
{
|
||||||
|
put_dax(dax_dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
static inline int bdev_dax_supported(struct super_block *sb, int blocksize)
|
||||||
|
{
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline struct dax_device *fs_dax_get_by_host(const char *host)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void fs_put_dax(struct dax_device *dax_dev)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int dax_read_lock(void);
|
int dax_read_lock(void);
|
||||||
void dax_read_unlock(int id);
|
void dax_read_unlock(int id);
|
||||||
struct dax_device *alloc_dax(void *private, const char *host,
|
struct dax_device *alloc_dax(void *private, const char *host,
|
||||||
|
Reference in New Issue
Block a user