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-19-2009, 08:35 PM
Jonathan Brassow
 
Default DM Exception Sto populate cache on commit

Patch name: dm-exception-store-populate-cache-on-commit.patch

The 'resume' exception store function is now in place to
load the exception store type's caches on startup. However,
we still need to continue to populate the caches as
new exceptions are committed. This patch takes care of
that.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>

Index: linux-2.6/drivers/md/dm-snap-persistent.c
================================================== =================
--- linux-2.6.orig/drivers/md/dm-snap-persistent.c
+++ linux-2.6/drivers/md/dm-snap-persistent.c
@@ -665,6 +665,15 @@ static void persistent_commit_exception(
write_exception(ps, ps->current_committed++, &de);

/*
+ * We are safe to add the exception to our cache before we
+ * issue the callbacks. If we fail to allocate the memory
+ * to put it in the cache though, the callbacks will have to
+ * report the failure.
+ */
+ if (add_exception(store, de.old_chunk, de.new_chunk))
+ ps->valid = 0;
+
+ /*
* Add the callback to the back of the array. This code
* is the only place where the callback array is
* manipulated, and we know that it will never be called
Index: linux-2.6/drivers/md/dm-snap-transient.c
================================================== =================
--- linux-2.6.orig/drivers/md/dm-snap-transient.c
+++ linux-2.6/drivers/md/dm-snap-transient.c
@@ -77,7 +77,20 @@ static void transient_commit_exception(s
void (*callback) (void *, int success),
void *callback_context)
{
- /* Just succeed */
+ struct transient_c *tc = store->context;
+ struct dm_exception *new;
+
+ new = dm_alloc_exception(tc->table);
+ if (!new) {
+ callback(callback_context, 0);
+ return;
+ }
+
+ new->old_chunk = e->old_chunk;
+ new->new_chunk = e->new_chunk;
+
+ dm_insert_exception(tc->table, new);
+
callback(callback_context, 1);
}


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-25-2009, 08:36 PM
Jonathan Brassow
 
Default DM Exception Sto populate cache on commit

Patch name: dm-exception-store-populate-cache-on-commit.patch

The 'resume' exception store function is now in place to
load the exception store type's caches on startup. However,
we still need to continue to populate the caches as
new exceptions are committed. This patch takes care of
that.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>

Index: linux-2.6/drivers/md/dm-snap-persistent.c
================================================== =================
--- linux-2.6.orig/drivers/md/dm-snap-persistent.c
+++ linux-2.6/drivers/md/dm-snap-persistent.c
@@ -665,6 +665,15 @@ static void persistent_commit_exception(
write_exception(ps, ps->current_committed++, &de);

/*
+ * We are safe to add the exception to our cache before we
+ * issue the callbacks. If we fail to allocate the memory
+ * to put it in the cache though, the callbacks will have to
+ * report the failure.
+ */
+ if (add_exception(store, de.old_chunk, de.new_chunk))
+ ps->valid = 0;
+
+ /*
* Add the callback to the back of the array. This code
* is the only place where the callback array is
* manipulated, and we know that it will never be called
Index: linux-2.6/drivers/md/dm-snap-transient.c
================================================== =================
--- linux-2.6.orig/drivers/md/dm-snap-transient.c
+++ linux-2.6/drivers/md/dm-snap-transient.c
@@ -77,7 +77,20 @@ static void transient_commit_exception(s
void (*callback) (void *, int success),
void *callback_context)
{
- /* Just succeed */
+ struct transient_c *tc = store->context;
+ struct dm_exception *new;
+
+ new = dm_alloc_exception(tc->table);
+ if (!new) {
+ callback(callback_context, 0);
+ return;
+ }
+
+ new->old_chunk = e->old_chunk;
+ new->new_chunk = e->new_chunk;
+
+ dm_insert_exception(tc->table, new);
+
callback(callback_context, 1);
}


--
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 02:54 PM.

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