[PATCHv3,22/30] page-pipe: grow page pipe on compatible iovec size

Submitted by Dmitry Safonov on June 28, 2016, 7:24 p.m.

Details

Message ID 20160628192423.14943-23-dsafonov@virtuozzo.com
State Rejected
Series "x86 Compatible C/R, part 2"
Headers show

Commit Message

Dmitry Safonov June 28, 2016, 7:24 p.m.
Update pointer to first free iov on page pipe growing
according to compat_iov flag.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
 criu/page-pipe.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index db597b27f1e2..591935771b4d 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -109,6 +109,7 @@  static inline void iov_init_compat(struct iovec_compat *iov, unsigned long addr)
 static int page_pipe_grow(struct page_pipe *pp, unsigned int flags)
 {
 	struct page_pipe_buf *ppb;
+	struct iovec *free_iov;
 
 	pr_debug("Will grow page pipe (iov off is %u)\n", pp->free_iov);
 
@@ -126,7 +127,11 @@  static int page_pipe_grow(struct page_pipe *pp, unsigned int flags)
 		return -1;
 
 out:
-	ppb_init(ppb, 0, 0, flags, &pp->iovs[pp->free_iov]);
+	if (pp->compat_iov)
+		free_iov = (void*)&((struct iovec_compat*)pp->iovs)[pp->free_iov];
+	else
+		free_iov = &pp->iovs[pp->free_iov];
+	ppb_init(ppb, 0, 0, flags, free_iov);
 
 	return 0;
 }