summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-08-02 18:41:31 +0300
committerChristian Brauner <brauner@kernel.org>2023-08-11 14:15:04 +0300
commit8ffa54e3370c5a8b9538dbe4077fc9c4b5a08f45 (patch)
tree436b4414d0de98994909adcfe2764027aa4ef394 /fs/xfs
parent8d945b595ed07db13fef1f3311ad456c97941930 (diff)
downloadlinux-8ffa54e3370c5a8b9538dbe4077fc9c4b5a08f45.tar.xz
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: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Message-Id: <20230802154131.2221419-13-hch@lst.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_super.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 97ef41acb03d..8fee15292499 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -377,17 +377,6 @@ disable_dax:
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
xfs_blkdev_get(
xfs_mount_t *mp,
@@ -396,8 +385,8 @@ xfs_blkdev_get(
{
int error = 0;
- *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE, mp,
- &xfs_holder_ops);
+ *bdevp = blkdev_get_by_path(name, BLK_OPEN_READ | BLK_OPEN_WRITE,
+ mp->m_super, &fs_holder_ops);
if (IS_ERR(*bdevp)) {
error = PTR_ERR(*bdevp);
xfs_warn(mp, "Invalid device [%s], error=%d", name, error);
@@ -529,10 +518,10 @@ out_relock:
xfs_free_buftarg(mp->m_ddev_targp);
out_close_rtdev:
if (rtdev)
- blkdev_put(rtdev, mp);
+ blkdev_put(rtdev, sb);
out_close_logdev:
if (logdev && logdev != ddev)
- blkdev_put(logdev, mp);
+ blkdev_put(logdev, sb);
goto out_relock;
}