On Tue, 24 Mar 2026 00:39:31 +0000
John Groves <[email protected]> wrote:

> From: John Groves <[email protected]>
> 
> The fs_dax_get() function should be called by fs-dax file systems after
> opening a fsdev dax device. This adds holder_operations, which provides
> a memory failure callback path and effects exclusivity between callers
> of fs_dax_get().
> 
> fs_dax_get() is specific to fsdev_dax, so it checks the driver type
> (which required touching bus.[ch]). fs_dax_get() fails if fsdev_dax is
> not bound to the memory.
> 
> This function serves the same role as fs_dax_get_by_bdev(), which dax
> file systems call after opening the pmem block device.
> 
> This can't be located in fsdev.c because struct dax_device is opaque
> there.
> 
> This will be called by fs/fuse/famfs.c in a subsequent commit.
> 
> Signed-off-by: John Groves <[email protected]>
Hi John,

Looks like a stray header change  - see inline.

With that tidied up.
Reviewed-by: Jonathan Cameron <[email protected]>

>  #define dax_driver_register(driver) \
> diff --git a/drivers/dax/super.c b/drivers/dax/super.c
> index ba0b4cd18a77..d4ab60c406bf 100644
> --- a/drivers/dax/super.c
> +++ b/drivers/dax/super.c

> diff --git a/include/linux/dax.h b/include/linux/dax.h
> index b19bfe0c2fd1..bf37b9a982f3 100644
> --- a/include/linux/dax.h
> +++ b/include/linux/dax.h

>  #if IS_ENABLED(CONFIG_FS_DAX)
> +void fs_put_dax(struct dax_device *dax_dev, void *holder);
> +int fs_dax_get(struct dax_device *dax_dev, void *holder,
> +            const struct dax_holder_operations *hops);
> +struct dax_device *inode_dax(struct inode *inode);

What's this? Not used in this patch and not stubbed.
It's in drivers/dax/dax-private.h already and given I assume code builds
before this patch (and it's not used in patch 8) then presumably it doesn't
need to be here.

I got suspicious due to the lack of stub rather indicating something differnt
form the other two.

>  int dax_writeback_mapping_range(struct address_space *mapping,
>               struct dax_device *dax_dev, struct writeback_control *wbc);
>  int dax_folio_reset_order(struct folio *folio);
> @@ -164,6 +164,15 @@ dax_entry_t dax_lock_mapping_entry(struct address_space 
> *mapping,
>  void dax_unlock_mapping_entry(struct address_space *mapping,
>               unsigned long index, dax_entry_t cookie);
>  #else
> +static inline void fs_put_dax(struct dax_device *dax_dev, void *holder)
> +{
> +}
> +
> +static inline int fs_dax_get(struct dax_device *dax_dev, void *holder,
> +                          const struct dax_holder_operations *hops)
> +{
> +     return -EOPNOTSUPP;
> +}
>  static inline struct page *dax_layout_busy_page(struct address_space 
> *mapping)
>  {
>       return NULL;


Reply via email to