xfs
[Top] [All Lists]

Re: [PATCH 2/3] xfs_io: implement preadv for vectored reads

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/3] xfs_io: implement preadv for vectored reads
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Thu, 09 Aug 2012 15:08:49 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1343255450-28559-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1343255450-28559-1-git-send-email-david@xxxxxxxxxxxxx> <1343255450-28559-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 07/25/12 17:30, Dave Chinner wrote:
From: Dave Chinner<dchinner@xxxxxxxxxx>

When looking at KVM based direct IO patterns, I noticed that it was
using preadv and pwritev, and I could not use xfs_io to simulate
these IO patterns. Extend the pread command to be able to issue
vectored read IO to enable use to simulate KVM style direct IO.

Also document the new parameters as well as all the missing pread
command parameters in the xfs_io(8) man page.

Signed-off-by: Dave Chinner<dchinner@xxxxxxxxxx>
---
 +int   vectors;
+struct iovec *iov;
+
+static int
+alloc_iovec(
+       size_t          bsize,
+       int             uflag,
+       unsigned int    seed)
+{
+       int             i;
+
+       iov = calloc(vectors, sizeof(struct iovec));
+       if (!iov)
+               return -1;
+
+       buffersize = 0;
+       for (i = 0; i<  vectors; i++) {
+               iov[i].iov_base = memalign(pagesize, bsize);
                ^^^^^
Okay, make sense.

+               buffer = memalign(pagesize, bsize);
+               if (!buffer) {
                ^^^^^^

Here I am bit confused. Did you want to allocate to the buffer for the iovec case?

Thank-you,

Mark.

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [PATCH 2/3] xfs_io: implement preadv for vectored reads, Mark Tinguely <=