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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux