[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Parallax fixes/updates:
ChangeSet 1.1695, 2005/06/09 10:41:04+01:00, akw27@xxxxxxxxxxxxxxxxxxxxxx Parallax fixes/updates: - all data access now through the async lookup code. - added synchronous wrappers for tools to use. - added end-to-end crc32 on all image blocks - various other fixes/cleanups/test stubs. Signed-off-by: andrew.warfield@xxxxxxxxxxxx b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c | 11 b/tools/blktap/Makefile | 40 b/tools/blktap/blockstore.c | 1 b/tools/blktap/parallax.c | 6 b/tools/blktap/requests-async.c | 200 ++- b/tools/blktap/requests-async.h | 14 b/tools/blktap/snaplog.c | 1 b/tools/blktap/vdi_fill.c | 7 b/tools/blktap/vdi_unittest.c | 184 ++ b/tools/blktap/vdi_validate.c | 21 tools/blktap/parallax-threaded.c | 654 ---------- tools/blktap/parallax-threaded.h | 24 12 files changed, 408 insertions(+), 755 deletions(-) diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c --- a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c 2005-06-09 10:02:44 -04:00 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c 2005-06-09 10:02:44 -04:00 @@ -34,7 +34,7 @@ static wait_queue_head_t blktap_wait; /* Where things are inside the device mapping. */ -struct vm_area_struct *blktap_vma; +struct vm_area_struct *blktap_vma = NULL; unsigned long mmap_vstart; unsigned long rings_vstart; @@ -139,7 +139,14 @@ ClearPageReserved(virt_to_page(blktap_ube_ring.sring)); free_page((unsigned long) blktap_ube_ring.sring); - + + /* Clear any active mappings. */ + if (blktap_vma != NULL) { + zap_page_range(blktap_vma, blktap_vma->vm_start, + blktap_vma->vm_end - blktap_vma->vm_start, NULL); + blktap_vma = NULL; + } + return 0; } diff -Nru a/tools/blktap/Makefile b/tools/blktap/Makefile --- a/tools/blktap/Makefile 2005-06-09 10:02:44 -04:00 +++ b/tools/blktap/Makefile 2005-06-09 10:02:44 -04:00 @@ -15,6 +15,8 @@ INCLUDES += +LIBS := -lpthread -lz + SRCS := SRCS += blktaplib.c @@ -24,10 +26,8 @@ PLX_SRCS += snaplog.c PLX_SRCS += blockstore.c PLX_SRCS += block-async.c -PLXT_SRCS := $(PLX_SRCS) -PLXT_SRCS += parallax-threaded.c -VDI_SRCS := $(PLX_SRCS) PLX_SRCS += requests-async.c +VDI_SRCS := $(PLX_SRCS) PLX_SRCS += parallax.c VDI_TOOLS := @@ -58,7 +58,7 @@ LIB = libblktap.so libblktap.so.$(MAJOR) libblktap.so.$(MAJOR).$(MINOR) -all: mk-symlinks blkdump $(VDI_TOOLS) parallax parallax-threaded blockstored +all: mk-symlinks blkdump $(VDI_TOOLS) parallax blockstored $(MAKE) $(LIB) LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse) @@ -80,7 +80,7 @@ $(INSTALL_PROG) $(IBINS) $(DESTDIR)/$(BLKTAP_INSTALL_DIR) clean: - rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump $(VDI_TOOLS) parallax parallax-threaded + rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump $(VDI_TOOLS) parallax rpm: all rm -rf staging @@ -96,45 +96,45 @@ libblktap.so.$(MAJOR): ln -sf libblktap.so.$(MAJOR).$(MINOR) $@ libblktap.so.$(MAJOR).$(MINOR): $(OBJS) - $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -lpthread -lz + $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ $(LIBS) blkdump: $(LIB) $(CC) $(CFLAGS) -o blkdump -L$(XEN_LIBXC) -L. -l blktap blkdump.c parallax: $(LIB) $(PLX_SRCS) - $(CC) $(CFLAGS) -o parallax -L$(XEN_LIBXC) -L. -lblktap -lpthread $(PLX_SRCS) - -parallax-threaded: $(LIB) $(PLXT_SRCS) - $(CC) $(CFLAGS) -o parallax-threaded -L$(XEN_LIBXC) -L. -lpthread -lblktap $(PLXT_SRCS) + $(CC) $(CFLAGS) -o parallax -L$(XEN_LIBXC) -L. -lblktap $(LIBS) $(PLX_SRCS) vdi_list: $(LIB) vdi_list.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_list vdi_list.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_list vdi_list.c $(LIBS) $(VDI_SRCS) vdi_create: $(LIB) vdi_create.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_create vdi_create.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_create vdi_create.c $(LIBS) $(VDI_SRCS) vdi_snap: $(LIB) vdi_snap.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_snap vdi_snap.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_snap vdi_snap.c $(LIBS) $(VDI_SRCS) vdi_snap_list: $(LIB) vdi_snap_list.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_snap_list vdi_snap_list.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_snap_list vdi_snap_list.c $(LIBS) $(VDI_SRCS) vdi_snap_delete: $(LIB) vdi_snap_delete.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_snap_delete vdi_snap_delete.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_snap_delete vdi_snap_delete.c $(LIBS) $(VDI_SRCS) vdi_tree: $(LIB) vdi_tree.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_tree vdi_tree.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_tree vdi_tree.c $(LIBS) $(VDI_SRCS) vdi_fill: $(LIB) vdi_fill.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_fill vdi_fill.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_fill vdi_fill.c $(LIBS) $(VDI_SRCS) vdi_validate: $(LIB) vdi_validate.c $(VDI_SRCS) - $(CC) $(CFLAGS) -g3 -o vdi_validate vdi_validate.c -lpthread $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_validate vdi_validate.c $(LIBS) $(VDI_SRCS) + +vdi_unittest: $(LIB) vdi_unittest.c $(VDI_SRCS) + $(CC) $(CFLAGS) -g3 -o vdi_unittest vdi_unittest.c $(LIBS) $(VDI_SRCS) blockstored: blockstored.c - $(CC) $(CFLAGS) -g3 -o blockstored -lpthread blockstored.c + $(CC) $(CFLAGS) -g3 -o blockstored $(LIBS) blockstored.c bstest: bstest.c blockstore.c - $(CC) $(CFLAGS) -g3 -o bstest bstest.c -lpthread blockstore.c + $(CC) $(CFLAGS) -g3 -o bstest bstest.c $(LIBS) blockstore.c .PHONY: TAGS clean install mk-symlinks rpm TAGS: diff -Nru a/tools/blktap/blockstore.c b/tools/blktap/blockstore.c --- a/tools/blktap/blockstore.c 2005-06-09 10:02:44 -04:00 +++ b/tools/blktap/blockstore.c 2005-06-09 10:02:44 -04:00 @@ -17,7 +17,6 @@ #include <stdarg.h> #include "blockstore.h" #include <pthread.h> -#include "parallax-threaded.h" //#define BLOCKSTORE_REMOTE //#define BSDEBUG diff -Nru a/tools/blktap/parallax-threaded.c b/tools/blktap/parallax-threaded.c --- a/tools/blktap/parallax-threaded.c 2005-06-09 10:02:44 -04:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,654 +0,0 @@ -/************************************************************************** - * - * parallax.c - * - * The Parallax Storage Server - * - */ - - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <pthread.h> -#include "blktaplib.h" -#include "blockstore.h" -#include "vdi.h" -#include "parallax-threaded.h" - -#define PARALLAX_DEV 61440 - - -#if 0 -#define DPRINTF(_f, _a...) printf ( _f , ## _a ) -#else -#define DPRINTF(_f, _a...) ((void)0) -#endif - -/* ------[ session records ]----------------------------------------------- */ - -#define BLKIF_HASHSZ 1024 -#define BLKIF_HASH(_d,_h) (((int)(_d)^(int)(_h))&(BLKIF_HASHSZ-1)) - -#define VDI_HASHSZ 16 -#define VDI_HASH(_vd) ((((_vd)>>8)^(_vd))&(VDI_HASHSZ-1)) - -typedef struct blkif { - domid_t domid; - unsigned int handle; - enum { DISCONNECTED, DISCONNECTING, CONNECTED } status; - vdi_t *vdi_hash[VDI_HASHSZ]; - struct blkif *hash_next; -} blkif_t; - -static blkif_t *blkif_hash[BLKIF_HASHSZ]; - -blkif_t *blkif_find_by_handle(domid_t domid, unsigned int handle) -{ - if ( handle != 0 ) - printf("blktap/parallax don't currently support non-0 dev handles!\n"); - - blkif_t *blkif = blkif_hash[BLKIF_HASH(domid, handle)]; - while ( (blkif != NULL) && - ((blkif->domid != domid) || (blkif->handle != handle)) ) - blkif = blkif->hash_next; - return blkif; -} - -vdi_t *blkif_get_vdi(blkif_t *blkif, blkif_vdev_t device) -{ - vdi_t *vdi = blkif->vdi_hash[VDI_HASH(device)]; - - while ((vdi != NULL) && (vdi->vdevice != device)) - vdi = vdi->next; - - return vdi; -} - -/* ------[ control message handling ]-------------------------------------- */ - -void blkif_create(blkif_be_create_t *create) -{ - domid_t domid = create->domid; - unsigned int handle = create->blkif_handle; - blkif_t **pblkif, *blkif; - - DPRINTF("parallax (blkif_create): create is %p\n", create); - - if ( (blkif = (blkif_t *)malloc(sizeof(blkif_t))) == NULL ) - { - DPRINTF("Could not create blkif: out of memory\n"); - create->status = BLKIF_BE_STATUS_OUT_OF_MEMORY; - return; - } - - memset(blkif, 0, sizeof(*blkif)); - blkif->domid = domid; - blkif->handle = handle; - blkif->status = DISCONNECTED; -/* - spin_lock_init(&blkif->vbd_lock); - spin_lock_init(&blkif->blk_ring_lock); - atomic_set(&blkif->refcnt, 0); -*/ - pblkif = &blkif_hash[BLKIF_HASH(domid, handle)]; - while ( *pblkif != NULL ) - { - if ( ((*pblkif)->domid == domid) && ((*pblkif)->handle == handle) ) - { - DPRINTF("Could not create blkif: already exists\n"); - create->status = BLKIF_BE_STATUS_INTERFACE_EXISTS; - free(blkif); - return; - } - pblkif = &(*pblkif)->hash_next; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |