xfs
[Top] [All Lists]

[PATCH v3 16/18] xfs_copy: store data buf alignment in buf data structur

To: xfs@xxxxxxxxxxx
Subject: [PATCH v3 16/18] xfs_copy: store data buf alignment in buf data structure
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Fri, 2 Oct 2015 14:19:53 -0400
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1443809995-20395-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1443809995-20395-1-git-send-email-bfoster@xxxxxxxxxx>
The write buffer data structure stores various characteristics of the
write buffer, such as I/O alignment requirements, etc., but does not
include the required data buffer alignment.

Data buffer alignment is a required buffer initialization parameter and
the v5 log format support code would like to initialize an independent
log buffer based on the predetermined alignment constraints encoded into
the global write buffer. Update the write buffer data structure to store
the provided data alignment value such that it can be accessed
throughout the codebase. This patch does not change existing behavior.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 copy/xfs_copy.c | 1 +
 copy/xfs_copy.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 0481ece..e03796a 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -352,6 +352,7 @@ wbuf_init(wbuf *buf, int data_size, int data_align, int 
min_io_size, int id)
                        return NULL;
        }
        ASSERT(min_io_size % BBSIZE == 0);
+       buf->data_align = data_align;
        buf->min_io_size = min_io_size;
        buf->size = data_size;
        buf->id = id;
diff --git a/copy/xfs_copy.h b/copy/xfs_copy.h
index e76b937..6b94130 100644
--- a/copy/xfs_copy.h
+++ b/copy/xfs_copy.h
@@ -54,6 +54,7 @@ typedef struct {
        int             id;             /* buffer ID */
        size_t          size;           /* size of buffer -- fixed */
        size_t          min_io_size;    /* for direct I/O */
+       int             data_align;     /* data buffer alignment */
        xfs_off_t       position;       /* requested position (bytes) */
        size_t          length;         /* requested length (bytes) */
        char            *data;          /* pointer to data buffer */
-- 
2.1.0

<Prev in Thread] Current Thread [Next in Thread>