aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.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_dquot.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_dquot.c')
-rw-r--r--fs/xfs/xfs_dquot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index bf27fcca4843..e95f800333d4 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -439,7 +439,7 @@ xfs_qm_dqtobp(
439 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, 439 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp,
440 dqp->q_blkno, 440 dqp->q_blkno,
441 mp->m_quotainfo->qi_dqchunklen, 441 mp->m_quotainfo->qi_dqchunklen,
442 0, &bp); 442 0, &bp, NULL);
443 if (error || !bp) 443 if (error || !bp)
444 return XFS_ERROR(error); 444 return XFS_ERROR(error);
445 } 445 }
@@ -920,7 +920,7 @@ xfs_qm_dqflush(
920 * Get the buffer containing the on-disk dquot 920 * Get the buffer containing the on-disk dquot
921 */ 921 */
922 error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, dqp->q_blkno, 922 error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, dqp->q_blkno,
923 mp->m_quotainfo->qi_dqchunklen, 0, &bp); 923 mp->m_quotainfo->qi_dqchunklen, 0, &bp, NULL);
924 if (error) 924 if (error)
925 goto out_unlock; 925 goto out_unlock;
926 926