[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2 of 3] xenpaging: convert xenpaging_t to struct xenpaging
# HG changeset patch # User Olaf Hering <olaf@xxxxxxxxx> # Date 1326125246 -3600 # Node ID de41b885dd70757c8a3a283e895d813c2f5e6744 # Parent dfcef53aa44f76b0dc13fa2acb012f4158da5c7b xenpaging: convert xenpaging_t to struct xenpaging Signed-off-by: Olaf Hering <olaf@xxxxxxxxx> diff -r dfcef53aa44f -r de41b885dd70 tools/xenpaging/pagein.c --- a/tools/xenpaging/pagein.c +++ b/tools/xenpaging/pagein.c @@ -61,7 +61,7 @@ void page_in_trigger(void) pthread_cond_signal(&page_in_cond); } -void create_page_in_thread(xenpaging_t *paging) +void create_page_in_thread(struct xenpaging *paging) { page_in_args.dom = paging->mem_event.domain_id; page_in_args.pagein_queue = paging->pagein_queue; diff -r dfcef53aa44f -r de41b885dd70 tools/xenpaging/policy.h --- a/tools/xenpaging/policy.h +++ b/tools/xenpaging/policy.h @@ -28,8 +28,8 @@ #include "xenpaging.h" -int policy_init(xenpaging_t *paging); -int policy_choose_victim(xenpaging_t *paging, struct victim *victim); +int policy_init(struct xenpaging *paging); +int policy_choose_victim(struct xenpaging *paging, struct victim *victim); void policy_notify_paged_out(unsigned long gfn); void policy_notify_paged_in(unsigned long gfn); void policy_notify_paged_in_nomru(unsigned long gfn); diff -r dfcef53aa44f -r de41b885dd70 tools/xenpaging/policy_default.c --- a/tools/xenpaging/policy_default.c +++ b/tools/xenpaging/policy_default.c @@ -37,7 +37,7 @@ static unsigned long current_gfn; static unsigned long max_pages; -int policy_init(xenpaging_t *paging) +int policy_init(struct xenpaging *paging) { int i; int rc = -ENOMEM; @@ -77,7 +77,7 @@ int policy_init(xenpaging_t *paging) return rc; } -int policy_choose_victim(xenpaging_t *paging, struct victim *victim) +int policy_choose_victim(struct xenpaging *paging, struct victim *victim) { xc_interface *xch = paging->xc_handle; unsigned long wrap = current_gfn; diff -r dfcef53aa44f -r de41b885dd70 tools/xenpaging/xenpaging.c --- a/tools/xenpaging/xenpaging.c +++ b/tools/xenpaging/xenpaging.c @@ -62,7 +62,7 @@ static void close_handler(int sig) unlink_pagefile(); } -static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging) +static int xenpaging_mem_paging_flush_ioemu_cache(struct xenpaging *paging) { struct xs_handle *xsh = paging->xs_handle; domid_t domain_id = paging->mem_event.domain_id; @@ -76,7 +76,7 @@ static int xenpaging_mem_paging_flush_io return rc == true ? 0 : -1; } -static int xenpaging_wait_for_event_or_timeout(xenpaging_t *paging) +static int xenpaging_wait_for_event_or_timeout(struct xenpaging *paging) { xc_interface *xch = paging->xc_handle; xc_evtchn *xce = paging->mem_event.xce_handle; @@ -164,7 +164,7 @@ err: return rc; } -static int xenpaging_get_tot_pages(xenpaging_t *paging) +static int xenpaging_get_tot_pages(struct xenpaging *paging) { xc_interface *xch = paging->xc_handle; xc_domaininfo_t domain_info; @@ -219,7 +219,7 @@ static void usage(void) printf(" -h --help this output.\n"); } -static int xenpaging_getopts(xenpaging_t *paging, int argc, char *argv[]) +static int xenpaging_getopts(struct xenpaging *paging, int argc, char *argv[]) { int ch; static const char sopts[] = "hvd:f:m:r:"; @@ -278,9 +278,9 @@ static int xenpaging_getopts(xenpaging_t return 0; } -static xenpaging_t *xenpaging_init(int argc, char *argv[]) +static struct xenpaging *xenpaging_init(int argc, char *argv[]) { - xenpaging_t *paging; + struct xenpaging *paging; xc_domaininfo_t domain_info; xc_interface *xch = NULL; xentoollog_logger *dbg = NULL; @@ -288,7 +288,7 @@ static xenpaging_t *xenpaging_init(int a int rc; /* Allocate memory */ - paging = calloc(1, sizeof(xenpaging_t)); + paging = calloc(1, sizeof(struct xenpaging)); if ( !paging ) goto err; @@ -476,7 +476,7 @@ static xenpaging_t *xenpaging_init(int a return NULL; } -static int xenpaging_teardown(xenpaging_t *paging) +static int xenpaging_teardown(struct xenpaging *paging) { int rc; xc_interface *xch; @@ -562,7 +562,7 @@ static void put_response(mem_event_t *me RING_PUSH_RESPONSES(back_ring); } -static int xenpaging_evict_page(xenpaging_t *paging, struct victim *victim, int fd, int i) +static int xenpaging_evict_page(struct xenpaging *paging, struct victim *victim, int fd, int i) { xc_interface *xch = paging->xc_handle; void *page; @@ -613,7 +613,7 @@ static int xenpaging_evict_page(xenpagin return ret; } -static int xenpaging_resume_page(xenpaging_t *paging, mem_event_response_t *rsp, int notify_policy) +static int xenpaging_resume_page(struct xenpaging *paging, mem_event_response_t *rsp, int notify_policy) { int ret; @@ -647,7 +647,7 @@ static int xenpaging_resume_page(xenpagi return ret; } -static int xenpaging_populate_page(xenpaging_t *paging, +static int xenpaging_populate_page(struct xenpaging *paging, xen_pfn_t gfn, int fd, int i) { xc_interface *xch = paging->xc_handle; @@ -691,7 +691,7 @@ static int xenpaging_populate_page(xenpa } /* Trigger a page-in for a batch of pages */ -static void resume_pages(xenpaging_t *paging, int num_pages) +static void resume_pages(struct xenpaging *paging, int num_pages) { xc_interface *xch = paging->xc_handle; int i, num = 0; @@ -711,7 +711,7 @@ static void resume_pages(xenpaging_t *pa page_in_trigger(); } -static int evict_victim(xenpaging_t *paging, struct victim *victim, int fd, int i) +static int evict_victim(struct xenpaging *paging, struct victim *victim, int fd, int i) { xc_interface *xch = paging->xc_handle; int j = 0; @@ -754,7 +754,7 @@ static int evict_victim(xenpaging_t *pag } /* Evict a batch of pages and write them to a free slot in the paging file */ -static int evict_pages(xenpaging_t *paging, int fd, struct victim *victims, int num_pages) +static int evict_pages(struct xenpaging *paging, int fd, struct victim *victims, int num_pages) { xc_interface *xch = paging->xc_handle; int rc, slot, num = 0; @@ -780,7 +780,7 @@ static int evict_pages(xenpaging_t *pagi int main(int argc, char *argv[]) { struct sigaction act; - xenpaging_t *paging; + struct xenpaging *paging; struct victim *victims; mem_event_request_t req; mem_event_response_t rsp; diff -r dfcef53aa44f -r de41b885dd70 tools/xenpaging/xenpaging.h --- a/tools/xenpaging/xenpaging.h +++ b/tools/xenpaging/xenpaging.h @@ -40,7 +40,7 @@ typedef struct mem_event { void *ring_page; } mem_event_t; -typedef struct xenpaging { +struct xenpaging { xc_interface *xc_handle; struct xs_handle *xs_handle; @@ -54,7 +54,7 @@ typedef struct xenpaging { int policy_mru_size; int debug; unsigned long pagein_queue[XENPAGING_PAGEIN_QUEUE_SIZE]; -} xenpaging_t; +}; struct victim { @@ -63,7 +63,7 @@ struct victim { }; -extern void create_page_in_thread(xenpaging_t *paging); +extern void create_page_in_thread(struct xenpaging *paging); extern void page_in_trigger(void); #endif // __XEN_PAGING_H__ _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |