Commit 8ffa54e3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Christian Brauner

xfs use fs_holder_ops for the log and RT devices

Use the generic fs_holder_ops to shut down the file system when the
log or RT device goes away instead of duplicating the logic.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
Message-Id: <20230802154131.2221419-13-hch@lst.de>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 8d945b59
...@@ -377,17 +377,6 @@ xfs_setup_dax_always( ...@@ -377,17 +377,6 @@ xfs_setup_dax_always(
return 0; return 0;
} }
static void
xfs_bdev_mark_dead(
struct block_device *bdev)
{
xfs_force_shutdown(bdev->bd_holder, SHUTDOWN_DEVICE_REMOVED);
}
static const struct blk_holder_ops xfs_holder_ops = {
.mark_dead = xfs_bdev_mark_dead,
};
STATIC int STATIC int
xfs_blkdev_get( xfs_blkdev_get(
xfs_mount_t *mp, xfs_mount_t *mp,
...@@ -396,8 +385,8 @@ xfs_blkdev_get( ...@@ -396,8 +385,8 @@ xfs_blkdev_get(
{ {
int error = 0; int error = 0;
*bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, mp, *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE,
&xfs_holder_ops); mp->m_super, &fs_holder_ops);
if (IS_ERR(*bdevp)) { if (IS_ERR(*bdevp)) {
error = PTR_ERR(*bdevp); error = PTR_ERR(*bdevp);
xfs_warn(mp, "Invalid device [%s], error=%d", name, error); xfs_warn(mp, "Invalid device [%s], error=%d", name, error);
...@@ -529,10 +518,10 @@ xfs_open_devices( ...@@ -529,10 +518,10 @@ xfs_open_devices(
xfs_free_buftarg(mp->m_ddev_targp); xfs_free_buftarg(mp->m_ddev_targp);
out_close_rtdev: out_close_rtdev:
if (rtdev) if (rtdev)
blkdev_put(rtdev, mp); blkdev_put(rtdev, sb);
out_close_logdev: out_close_logdev:
if (logdev && logdev != ddev) if (logdev && logdev != ddev)
blkdev_put(logdev, mp); blkdev_put(logdev, sb);
goto out_relock; goto out_relock;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment