|
@@ -1049,27 +1049,6 @@ xfs_buf_ioerror_alert(
|
|
(__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length);
|
|
(__uint64_t)XFS_BUF_ADDR(bp), func, bp->b_error, bp->b_length);
|
|
}
|
|
}
|
|
|
|
|
|
-int
|
|
|
|
-xfs_bwrite(
|
|
|
|
- struct xfs_buf *bp)
|
|
|
|
-{
|
|
|
|
- int error;
|
|
|
|
-
|
|
|
|
- ASSERT(xfs_buf_islocked(bp));
|
|
|
|
-
|
|
|
|
- bp->b_flags |= XBF_WRITE;
|
|
|
|
- bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q);
|
|
|
|
-
|
|
|
|
- xfs_bdstrat_cb(bp);
|
|
|
|
-
|
|
|
|
- error = xfs_buf_iowait(bp);
|
|
|
|
- if (error) {
|
|
|
|
- xfs_force_shutdown(bp->b_target->bt_mount,
|
|
|
|
- SHUTDOWN_META_IO_ERROR);
|
|
|
|
- }
|
|
|
|
- return error;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Called when we want to stop a buffer from getting written or read.
|
|
* Called when we want to stop a buffer from getting written or read.
|
|
* We attach the EIO error, muck with its flags, and call xfs_buf_ioend
|
|
* We attach the EIO error, muck with its flags, and call xfs_buf_ioend
|
|
@@ -1139,14 +1118,7 @@ xfs_bioerror_relse(
|
|
return EIO;
|
|
return EIO;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-/*
|
|
|
|
- * All xfs metadata buffers except log state machine buffers
|
|
|
|
- * get this attached as their b_bdstrat callback function.
|
|
|
|
- * This is so that we can catch a buffer
|
|
|
|
- * after prematurely unpinning it to forcibly shutdown the filesystem.
|
|
|
|
- */
|
|
|
|
-int
|
|
|
|
|
|
+STATIC int
|
|
xfs_bdstrat_cb(
|
|
xfs_bdstrat_cb(
|
|
struct xfs_buf *bp)
|
|
struct xfs_buf *bp)
|
|
{
|
|
{
|
|
@@ -1167,6 +1139,27 @@ xfs_bdstrat_cb(
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int
|
|
|
|
+xfs_bwrite(
|
|
|
|
+ struct xfs_buf *bp)
|
|
|
|
+{
|
|
|
|
+ int error;
|
|
|
|
+
|
|
|
|
+ ASSERT(xfs_buf_islocked(bp));
|
|
|
|
+
|
|
|
|
+ bp->b_flags |= XBF_WRITE;
|
|
|
|
+ bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q);
|
|
|
|
+
|
|
|
|
+ xfs_bdstrat_cb(bp);
|
|
|
|
+
|
|
|
|
+ error = xfs_buf_iowait(bp);
|
|
|
|
+ if (error) {
|
|
|
|
+ xfs_force_shutdown(bp->b_target->bt_mount,
|
|
|
|
+ SHUTDOWN_META_IO_ERROR);
|
|
|
|
+ }
|
|
|
|
+ return error;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Wrapper around bdstrat so that we can stop data from going to disk in case
|
|
* Wrapper around bdstrat so that we can stop data from going to disk in case
|
|
* we are shutting down the filesystem. Typically user data goes thru this
|
|
* we are shutting down the filesystem. Typically user data goes thru this
|