ia64/xen-unstable

changeset 5394:29cc3bc7efec

bitkeeper revision 1.1699 (42a84d06sZDrQ46g-Bcc7JqWMygr2Q)

Fix a bug with snapshots that was introduced with the crc code.
author akw27@arcadians.cl.cam.ac.uk
date Thu Jun 09 14:07:02 2005 +0000 (2005-06-09)
parents b5e263150850
children 6d3e8f90c2df fcbdfa6fe74d
files tools/blktap/Makefile tools/blktap/requests-async.c tools/blktap/vdi.c
line diff
     1.1 --- a/tools/blktap/Makefile	Thu Jun 09 13:37:53 2005 +0000
     1.2 +++ b/tools/blktap/Makefile	Thu Jun 09 14:07:02 2005 +0000
     1.3 @@ -80,7 +80,7 @@ install: all
     1.4  	$(INSTALL_PROG) $(IBINS) $(DESTDIR)/$(BLKTAP_INSTALL_DIR)
     1.5  
     1.6  clean:
     1.7 -	rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump $(VDI_TOOLS) parallax
     1.8 +	rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump $(VDI_TOOLS) parallax vdi_unittest
     1.9  
    1.10  rpm: all
    1.11  	rm -rf staging
     2.1 --- a/tools/blktap/requests-async.c	Thu Jun 09 13:37:53 2005 +0000
     2.2 +++ b/tools/blktap/requests-async.c	Thu Jun 09 14:07:02 2005 +0000
     2.3 @@ -51,6 +51,14 @@ struct io_req {
     2.4  void clear_w_bits(radix_tree_node node) 
     2.5  {
     2.6      int i;
     2.7 +    for (i=0; i<RADIX_TREE_MAP_ENTRIES; i++)
     2.8 +        node[i] = node[i] & ONEMASK;
     2.9 +    return;
    2.10 +}
    2.11 +
    2.12 +void clear_L3_w_bits(radix_tree_node node) 
    2.13 +{
    2.14 +    int i;
    2.15      for (i=0; i<RADIX_TREE_MAP_ENTRIES; i+=2)
    2.16          node[i] = node[i] & ONEMASK;
    2.17      return;
    2.18 @@ -513,7 +521,7 @@ static void write_cb(struct io_ret r, vo
    2.19      
    2.20      	DPRINTF("READ_L3_L2f\n");
    2.21          node = (radix_tree_node) IO_BLOCK(r);
    2.22 -        clear_w_bits(node);
    2.23 +        clear_L3_w_bits(node);
    2.24          if (node == NULL) goto fail;
    2.25          a    = node[L2_IDX(req->vaddr)];
    2.26          addr = getid(a);
    2.27 @@ -613,7 +621,7 @@ static void write_cb(struct io_ret r, vo
    2.28      
    2.29      	DPRINTF("READ_L3_L1f\n");
    2.30          node = (radix_tree_node) IO_BLOCK(r);
    2.31 -        clear_w_bits(node);
    2.32 +        clear_L3_w_bits(node);
    2.33          if (node == NULL) goto fail;
    2.34          a    = node[L2_IDX(req->vaddr)];
    2.35          addr = getid(a);
     3.1 --- a/tools/blktap/vdi.c	Thu Jun 09 13:37:53 2005 +0000
     3.2 +++ b/tools/blktap/vdi.c	Thu Jun 09 14:07:02 2005 +0000
     3.3 @@ -14,6 +14,7 @@
     3.4  #include <pthread.h>
     3.5  #include "blockstore.h"
     3.6  #include "block-async.h"
     3.7 +#include "requests-async.h"
     3.8  #include "radix.h"
     3.9  #include "vdi.h"
    3.10                      
    3.11 @@ -161,28 +162,6 @@ void vdi_put(vdi_t *vdi)
    3.12      freeblock(vdi);
    3.13  }
    3.14  
    3.15 -u64 vdi_lookup_block(vdi_t *vdi, u64 vdi_block, int *writable)
    3.16 -{
    3.17 -    u64 gblock;
    3.18 -    
    3.19 -    gblock = lookup(VDI_HEIGHT, vdi->radix_root, vdi_block);
    3.20 -    
    3.21 -    if (writable != NULL) *writable = iswritable(gblock);
    3.22 -
    3.23 -    return getid(gblock);
    3.24 -}
    3.25 -
    3.26 -void vdi_update_block(vdi_t *vdi, u64 vdi_block, u64 g_block)
    3.27 -{
    3.28 -    u64 id;
    3.29 -    
    3.30 -    /* updates are always writable. */
    3.31 -    id = writable(g_block);
    3.32 -    
    3.33 -    vdi->radix_root = update(VDI_HEIGHT, vdi->radix_root, vdi_block, id);
    3.34 -    writeblock(vdi->block, vdi);
    3.35 -}
    3.36 -
    3.37  void vdi_snapshot(vdi_t *vdi)
    3.38  {
    3.39      snap_rec_t rec;