FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-17-2009, 01:03 PM
Jonathan Brassow
 
Default dm-snap-exception-function-changes-3.patch

Index: linux-2.6/drivers/md/dm-snap.c
================================================== =================
--- linux-2.6.orig/drivers/md/dm-snap.c
+++ linux-2.6/drivers/md/dm-snap.c
@@ -343,6 +343,16 @@ static void unregister_snapshot(struct d
up_write(&_origins_lock);
}

+struct dm_exception_table_internal {
+ struct dm_exception_table et;
+
+ struct dm_exception *(*alloc_exception)(void *context);
+ void *alloc_context;
+
+ void (*free_exception)(struct dm_exception *e, void *context);
+ void *free_context;
+};
+
/*
* Implementation of the exception hash tables.
* The lowest hash_shift bits of the chunk number are ignored, allowing
@@ -352,12 +362,15 @@ static struct dm_exception_table *
dm_exception_table_create(uint32_t size, unsigned hash_shift)
{
unsigned int i;
+ struct dm_exception_table_internal *eti;
struct dm_exception_table *et;

- et = kmalloc(sizeof(*et), GFP_KERNEL);
- if (!et)
+ eti = kmalloc(sizeof(*eti), GFP_KERNEL);
+ if (!eti)
return NULL;

+ et = &eti->et;
+
et->hash_shift = hash_shift;
et->hash_mask = size - 1;
et->table = dm_vcalloc(size, sizeof(struct list_head));
@@ -375,10 +388,13 @@ dm_exception_table_create(uint32_t size,
static void dm_exception_table_destroy(struct dm_exception_table *et,
struct kmem_cache *mem)
{
+ struct dm_exception_table_internal *eti;
struct list_head *slot;
struct dm_exception *ex, *next;
int i, size;

+ eti = container_of(et, struct dm_exception_table_internal, et);
+
size = et->hash_mask + 1;
for (i = 0; i < size; i++) {
slot = et->table + i;
@@ -388,7 +404,7 @@ static void dm_exception_table_destroy(s
}

vfree(et->table);
- kfree(et);
+ kfree(eti);
}

static uint32_t exception_hash(struct dm_exception_table *et, chunk_t chunk)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 11:58 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org