• D
    xfs: make buffer read verication an IO completion function · c3f8fc73
    Dave Chinner 提交于
    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: NDave Chinner <dchinner@redhat.com>
    Reviewed-by: NChristoph Hellwig <hch@lst.de>
    Reviewed-by: NPhil White <pwhite@sgi.com>
    Signed-off-by: NBen Myers <bpm@sgi.com>
    c3f8fc73
xfs_buf.h 11.6 KB