criu/include/page-pipe.h
Pavel Emelyanov 960694e96f page-pipe: Introduce object to collect pages within
The page-pipe is an object, that can accumulate pages inside it. It
consists of list of page-pipe-bufs, which in turn has a pipa, an
array of iovecs that describe the pages' locations and some stats.

Users of it are supposed to vmsplice pages into pipes to accumulate
then for later use, and vmsplice them from pipes when required.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:12:58 +04:00

28 lines
783 B
C

#ifndef __CR_PAGE_PIPE_H__
#define __CR_PAGE_PIPE_H__
#include <sys/uio.h>
#include "list.h"
struct page_pipe_buf {
int p[2];
unsigned int pipe_size; /* how many pages can be fit into pipe */
unsigned int pages_in; /* how many pages are there */
unsigned int nr_segs; /* how many iov-s are busy */
struct iovec *iov;
struct list_head l;
};
struct page_pipe {
unsigned int nr_pipes;
struct list_head bufs;
unsigned int nr_iovs;
unsigned int free_iov;
struct iovec *iovs;
};
struct page_pipe *create_page_pipe(unsigned int nr, struct iovec *);
void destroy_page_pipe(struct page_pipe *p);
int page_pipe_add_page(struct page_pipe *p, unsigned long addr);
int page_pipe_iterate_pages(struct page_pipe *p,
int (*fn)(int rpipe, unsigned long addr, void *), void *);
#endif