]> Git Repo - linux.git/blobdiff - fs/xfs/xfs_buf.c
Merge tag 'mm-stable-2023-11-01-14-33' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / fs / xfs / xfs_buf.c
index 9e7ba04572db0526db853e4922605077fbefa129..545c7991b9b584cb576d33d55cdd67826e0fa753 100644 (file)
@@ -1943,8 +1943,6 @@ void
 xfs_free_buftarg(
        struct xfs_buftarg      *btp)
 {
-       struct block_device     *bdev = btp->bt_bdev;
-
        shrinker_free(btp->bt_shrinker);
        ASSERT(percpu_counter_sum(&btp->bt_io_count) == 0);
        percpu_counter_destroy(&btp->bt_io_count);
@@ -1952,8 +1950,8 @@ xfs_free_buftarg(
 
        fs_put_dax(btp->bt_daxdev, btp->bt_mount);
        /* the main block device is closed by kill_block_super */
-       if (bdev != btp->bt_mount->m_super->s_bdev)
-               blkdev_put(bdev, btp->bt_mount->m_super);
+       if (btp->bt_bdev != btp->bt_mount->m_super->s_bdev)
+               bdev_release(btp->bt_bdev_handle);
 
        kmem_free(btp);
 }
@@ -1988,16 +1986,15 @@ xfs_setsize_buftarg(
  */
 STATIC int
 xfs_setsize_buftarg_early(
-       xfs_buftarg_t           *btp,
-       struct block_device     *bdev)
+       xfs_buftarg_t           *btp)
 {
-       return xfs_setsize_buftarg(btp, bdev_logical_block_size(bdev));
+       return xfs_setsize_buftarg(btp, bdev_logical_block_size(btp->bt_bdev));
 }
 
 struct xfs_buftarg *
 xfs_alloc_buftarg(
        struct xfs_mount        *mp,
-       struct block_device     *bdev)
+       struct bdev_handle      *bdev_handle)
 {
        xfs_buftarg_t           *btp;
        const struct dax_holder_operations *ops = NULL;
@@ -2008,9 +2005,10 @@ xfs_alloc_buftarg(
        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_bdev_handle = bdev_handle;
+       btp->bt_dev = bdev_handle->bdev->bd_dev;
+       btp->bt_bdev = bdev_handle->bdev;
+       btp->bt_daxdev = fs_dax_get_by_bdev(btp->bt_bdev, &btp->bt_dax_part_off,
                                            mp, ops);
 
        /*
@@ -2020,7 +2018,7 @@ xfs_alloc_buftarg(
        ratelimit_state_init(&btp->bt_ioerror_rl, 30 * HZ,
                             DEFAULT_RATELIMIT_BURST);
 
-       if (xfs_setsize_buftarg_early(btp, bdev))
+       if (xfs_setsize_buftarg_early(btp))
                goto error_free;
 
        if (list_lru_init(&btp->bt_lru))
This page took 0.036451 seconds and 4 git commands to generate.