aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-12 06:54:19 -0500
committerBen Myers <bpm@sgi.com>2012-11-15 22:35:00 -0500
commitcfb02852226aa449fe27075caffe88726507668c (patch)
tree796ede500b5fe4d3b0a7e7ec4621f85347741d79 /fs/xfs/xfs_buf.h
parentda6958c873ecd846d71fafbfe0f6168bb9c2c99e (diff)
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>
Diffstat (limited to 'fs/xfs/xfs_buf.h')
-rw-r--r--fs/xfs/xfs_buf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 677b1dc822f4..51bc16a1cd9c 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -155,6 +155,9 @@ typedef struct xfs_buf {
155 unsigned int b_offset; /* page offset in first page */ 155 unsigned int b_offset; /* page offset in first page */
156 unsigned short b_error; /* error code on I/O */ 156 unsigned short b_error; /* error code on I/O */
157 157
158 void (*b_pre_io)(struct xfs_buf *);
159 /* pre-io callback function */
160
158#ifdef XFS_BUF_LOCK_TRACKING 161#ifdef XFS_BUF_LOCK_TRACKING
159 int b_last_holder; 162 int b_last_holder;
160#endif 163#endif