[CRIU] [PATCH 01/16] mem/page-pipe: Eliminate redundant pipe_off setup

Cyrill Gorcunov gorcunov at gmail.com
Fri Jul 5 18:37:56 MSK 2019


In case if we may use previous pipe the pipe_off
get set directly so no need for redundat unconditional
assignment.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 criu/page-pipe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index c32b89332521..33741db4224f 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -104,8 +104,6 @@ static struct page_pipe_buf *ppb_alloc(struct page_pipe *pp,
 		return NULL;
 	cnt_add(CNT_PAGE_PIPE_BUFS, 1);
 
-	ppb->pipe_off = 0;
-
 	if (prev && ppb_resize_pipe(prev) == 0) {
 		/* The previous pipe isn't full and we can continue to use it. */
 		ppb->p[0] = prev->p[0];
@@ -120,6 +118,7 @@ static struct page_pipe_buf *ppb_alloc(struct page_pipe *pp,
 		}
 		cnt_add(CNT_PAGE_PIPES, 1);
 
+		ppb->pipe_off = 0;
 		ppb->pipe_size = fcntl(ppb->p[0], F_GETPIPE_SZ, 0) / PAGE_SIZE;
 		pp->nr_pipes++;
 	}
-- 
2.20.1



More information about the CRIU mailing list