summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2013-12-13 11:00:43 +1100
committerDave Chinner <david@fromorbit.com>2013-12-13 11:00:43 +1100
commit1234351cba958cd5d4338172ccfc869a687cd736 (patch)
tree4ac537e061808787a266a4d1fcfb0e09d185af2e /fs/xfs/xfs_log.h
parent3de559fbd04d67473b9be2bd183823c40c4b7557 (diff)
downloadlinux-1234351cba958cd5d4338172ccfc869a687cd736.tar.gz
linux-1234351cba958cd5d4338172ccfc869a687cd736.tar.bz2
linux-1234351cba958cd5d4338172ccfc869a687cd736.zip
xfs: introduce xlog_copy_iovec
Add a helper to abstract out filling the log iovecs in the log item format handlers. This will allow us to change the way we do the log item formatting more easily. The copy in the name is a bit confusing for now as it just assigns a pointer and lets the CIL code perform the copy, but that will change soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_log.h')
-rw-r--r--fs/xfs/xfs_log.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h
index e148719e0a5d..384c6c469661 100644
--- a/fs/xfs/xfs_log.h
+++ b/fs/xfs/xfs_log.h
@@ -30,6 +30,19 @@ struct xfs_log_vec {
#define XFS_LOG_VEC_ORDERED (-1)
+static inline void *
+xlog_copy_iovec(struct xfs_log_iovec **vecp, uint type, void *data, int len)
+{
+ struct xfs_log_iovec *vec = *vecp;
+
+ vec->i_type = type;
+ vec->i_addr = data;
+ vec->i_len = len;
+
+ *vecp = vec + 1;
+ return vec->i_addr;
+}
+
/*
* Structure used to pass callback function and the function's argument
* to the log manager.