Commit 372cc85e authored by Dave Chinner's avatar Dave Chinner Committed by Ben Myers

xfs: support discontiguous buffers in the xfs_buf_log_item

discontigous buffer in separate buffer format structures. This means log
recovery will recover all the changes on a per segment basis without
requiring any knowledge of the fact that it was logged from a
compound buffer.

To do this, we need to be able to determine what buffer segment any
given offset into the compound buffer sits over. This enables us to
translate the dirty bitmap in the number of separate buffer format
structures required.

We also need to be able to determine the number of bitmap elements
that a given buffer segment has, as this determines the size of the
buffer format structure. Hence we need to be able to determine the
both the start offset into the buffer and the length of a given
segment to be able to calculate this.

With this information, we can preallocate, build and format the
correct log vector array for each segment in a compound buffer to
appear exactly the same as individually logged buffers in the log.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent de2a4f59
This diff is collapsed.
...@@ -102,6 +102,8 @@ typedef struct xfs_buf_log_item { ...@@ -102,6 +102,8 @@ typedef struct xfs_buf_log_item {
char *bli_orig; /* original buffer copy */ char *bli_orig; /* original buffer copy */
char *bli_logged; /* bytes logged (bitmap) */ char *bli_logged; /* bytes logged (bitmap) */
#endif #endif
int bli_format_count; /* count of headers */
struct xfs_buf_log_format *bli_formats; /* array of in-log header ptrs */
struct xfs_buf_log_format bli_format; /* embedded in-log header */ struct xfs_buf_log_format bli_format; /* embedded in-log header */
} xfs_buf_log_item_t; } xfs_buf_log_item_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment