Merge tag 'irq-core-2022-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / fs / xfs / xfs_buf.c
index 584afe0..dde3464 100644 (file)
@@ -5,6 +5,7 @@
  */
 #include "xfs.h"
 #include <linux/backing-dev.h>
+#include <linux/dax.h>
 
 #include "xfs_shared.h"
 #include "xfs_format.h"
@@ -1944,7 +1945,7 @@ xfs_free_buftarg(
        list_lru_destroy(&btp->bt_lru);
 
        blkdev_issue_flush(btp->bt_bdev);
-       fs_put_dax(btp->bt_daxdev);
+       fs_put_dax(btp->bt_daxdev, btp->bt_mount);
 
        kmem_free(btp);
 }
@@ -1991,13 +1992,18 @@ xfs_alloc_buftarg(
        struct block_device     *bdev)
 {
        xfs_buftarg_t           *btp;
+       const struct dax_holder_operations *ops = NULL;
 
+#if defined(CONFIG_FS_DAX) && defined(CONFIG_MEMORY_FAILURE)
+       ops = &xfs_dax_holder_operations;
+#endif
        btp = kmem_zalloc(sizeof(*btp), KM_NOFS);
 
        btp->bt_mount = mp;
        btp->bt_dev =  bdev->bd_dev;
        btp->bt_bdev = bdev;
-       btp->bt_daxdev = fs_dax_get_by_bdev(bdev, &btp->bt_dax_part_off);
+       btp->bt_daxdev = fs_dax_get_by_bdev(bdev, &btp->bt_dax_part_off,
+                                           mp, ops);
 
        /*
         * Buffer IO error rate limiting. Limit it to no more than 10 messages
@@ -2019,7 +2025,8 @@ xfs_alloc_buftarg(
        btp->bt_shrinker.scan_objects = xfs_buftarg_shrink_scan;
        btp->bt_shrinker.seeks = DEFAULT_SEEKS;
        btp->bt_shrinker.flags = SHRINKER_NUMA_AWARE;
-       if (register_shrinker(&btp->bt_shrinker))
+       if (register_shrinker(&btp->bt_shrinker, "xfs-buf:%s",
+                             mp->m_super->s_id))
                goto error_pcpu;
        return btp;