xfs: add buffer pre-write callback
authorDave Chinner <dchinner@redhat.com>
Mon, 12 Nov 2012 11:54:19 +0000 (22:54 +1100)
committerBen Myers <bpm@sgi.com>
Fri, 16 Nov 2012 03:35:00 +0000 (21:35 -0600)
commitcfb02852226aa449fe27075caffe88726507668c
tree796ede500b5fe4d3b0a7e7ec4621f85347741d79
parentda6958c873ecd846d71fafbfe0f6168bb9c2c99e
xfs: add buffer pre-write callback

Add a callback to the buffer write path to enable verification of
the buffer and CRC calculation prior to issuing the write to the
underlying storage.

If the callback function detects some kind of failure or error
condition, it must mark the buffer with an error so that the caller
can take appropriate action. In the case of xfs_buf_ioapply(), a
corrupt metadta buffer willt rigger a shutdown of the filesystem,
because something is clearly wrong and we can't allow corrupt
metadata to be written to disk.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h