aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-10-01 19:04:40 -0400
committerDave Chinner <david@fromorbit.com>2014-10-01 19:04:40 -0400
commit8dac39219827113f14e97507646a610ca426b69e (patch)
tree625f8d009bccc4a70f3d442948cc0a287171c88b /fs/xfs
parent61be9c529a4a715ab8679e9ca82bc3790c7ab66c (diff)
xfs: kill xfs_bdstrat_cb
Only has two callers, and is just a shutdown check and error handler around xfs_buf_iorequest. However, the error handling is a mess of read and write semantics, and both internal callers only call it for writes. Hence kill the wrapper, and follow up with a patch to sanitise the error handling. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_buf.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 170d6c0afe71..0eee0f1f099e 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1146,27 +1146,6 @@ xfs_bioerror_relse(
1146 return -EIO; 1146 return -EIO;
1147} 1147}
1148 1148
1149STATIC int
1150xfs_bdstrat_cb(
1151 struct xfs_buf *bp)
1152{
1153 if (XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) {
1154 trace_xfs_bdstrat_shut(bp, _RET_IP_);
1155 /*
1156 * Metadata write that didn't get logged but
1157 * written delayed anyway. These aren't associated
1158 * with a transaction, and can be ignored.
1159 */
1160 if (!bp->b_iodone && !XFS_BUF_ISREAD(bp))
1161 return xfs_bioerror_relse(bp);
1162 else
1163 return xfs_bioerror(bp);
1164 }
1165
1166 xfs_buf_iorequest(bp);
1167 return 0;
1168}
1169
1170int 1149int
1171xfs_bwrite( 1150xfs_bwrite(
1172 struct xfs_buf *bp) 1151 struct xfs_buf *bp)
@@ -1178,7 +1157,20 @@ xfs_bwrite(
1178 bp->b_flags |= XBF_WRITE; 1157 bp->b_flags |= XBF_WRITE;
1179 bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q | XBF_WRITE_FAIL); 1158 bp->b_flags &= ~(XBF_ASYNC | XBF_READ | _XBF_DELWRI_Q | XBF_WRITE_FAIL);
1180 1159
1181 xfs_bdstrat_cb(bp); 1160 if (XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) {
1161 trace_xfs_bdstrat_shut(bp, _RET_IP_);
1162
1163 /*
1164 * Metadata write that didn't get logged but written anyway.
1165 * These aren't associated with a transaction, and can be
1166 * ignored.
1167 */
1168 if (!bp->b_iodone)
1169 return xfs_bioerror_relse(bp);
1170 return xfs_bioerror(bp);
1171 }
1172
1173 xfs_buf_iorequest(bp);
1182 1174
1183 error = xfs_buf_iowait(bp); 1175 error = xfs_buf_iowait(bp);
1184 if (error) { 1176 if (error) {
@@ -1861,7 +1853,17 @@ __xfs_buf_delwri_submit(
1861 xfs_buf_hold(bp); 1853 xfs_buf_hold(bp);
1862 else 1854 else
1863 list_del_init(&bp->b_list); 1855 list_del_init(&bp->b_list);
1864 xfs_bdstrat_cb(bp); 1856
1857 if (XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) {
1858 trace_xfs_bdstrat_shut(bp, _RET_IP_);
1859
1860 if (!bp->b_iodone)
1861 xfs_bioerror_relse(bp);
1862 else
1863 xfs_bioerror(bp);
1864 continue;
1865 }
1866 xfs_buf_iorequest(bp);
1865 } 1867 }
1866 blk_finish_plug(&plug); 1868 blk_finish_plug(&plug);
1867 1869