aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-12 06:54:01 -0500
committerBen Myers <bpm@sgi.com>2012-11-15 22:34:02 -0500
commitc3f8fc73ac97b76a12692088ef9cace9af8422c0 (patch)
treea90e132507842b7ed8c5d93e0c002e0dc0f99a5c /fs/xfs/xfs_mount.c
parentfb59581404ab7ec5075299065c22cb211a9262a9 (diff)
xfs: make buffer read verication an IO completion function
Add a verifier function callback capability to the buffer read interfaces. This will be used by the callers to supply a function that verifies the contents of the buffer when it is read from disk. This patch does not provide callback functions, but simply modifies the interfaces to allow them to be called. The reason for adding this to the read interfaces is that it is very difficult to tell fom the outside is a buffer was just read from disk or whether we just pulled it out of cache. Supplying a callbck allows the buffer cache to use it's internal knowledge of the buffer to execute it only when the buffer is read from disk. It is intended that the verifier functions will mark the buffer with an EFSCORRUPTED error when verification fails. This allows the reading context to distinguish a verification error from an IO error, and potentially take further actions on the buffer (e.g. attempt repair) based on the error reported. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Phil White <pwhite@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 41ae7e1590f5..d5402b0eb6a3 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -652,7 +652,7 @@ xfs_readsb(xfs_mount_t *mp, int flags)
652 652
653reread: 653reread:
654 bp = xfs_buf_read_uncached(mp->m_ddev_targp, XFS_SB_DADDR, 654 bp = xfs_buf_read_uncached(mp->m_ddev_targp, XFS_SB_DADDR,
655 BTOBB(sector_size), 0); 655 BTOBB(sector_size), 0, NULL);
656 if (!bp) { 656 if (!bp) {
657 if (loud) 657 if (loud)
658 xfs_warn(mp, "SB buffer read failed"); 658 xfs_warn(mp, "SB buffer read failed");
@@ -1002,7 +1002,7 @@ xfs_check_sizes(xfs_mount_t *mp)
1002 } 1002 }
1003 bp = xfs_buf_read_uncached(mp->m_ddev_targp, 1003 bp = xfs_buf_read_uncached(mp->m_ddev_targp,
1004 d - XFS_FSS_TO_BB(mp, 1), 1004 d - XFS_FSS_TO_BB(mp, 1),
1005 XFS_FSS_TO_BB(mp, 1), 0); 1005 XFS_FSS_TO_BB(mp, 1), 0, NULL);
1006 if (!bp) { 1006 if (!bp) {
1007 xfs_warn(mp, "last sector read failed"); 1007 xfs_warn(mp, "last sector read failed");
1008 return EIO; 1008 return EIO;
@@ -1017,7 +1017,7 @@ xfs_check_sizes(xfs_mount_t *mp)
1017 } 1017 }
1018 bp = xfs_buf_read_uncached(mp->m_logdev_targp, 1018 bp = xfs_buf_read_uncached(mp->m_logdev_targp,
1019 d - XFS_FSB_TO_BB(mp, 1), 1019 d - XFS_FSB_TO_BB(mp, 1),
1020 XFS_FSB_TO_BB(mp, 1), 0); 1020 XFS_FSB_TO_BB(mp, 1), 0, NULL);
1021 if (!bp) { 1021 if (!bp) {
1022 xfs_warn(mp, "log device read failed"); 1022 xfs_warn(mp, "log device read failed");
1023 return EIO; 1023 return EIO;