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 02-20-2009, 10:13 PM
Jonathan Brassow
 
Default dm-snap-consolidate-insert_exception.patch

It is ridiculous to have two 'insert_*exception' functions when one
of the functions already handles both cases. Consolidating them.

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

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
@@ -388,13 +388,6 @@ static uint32_t exception_hash(struct dm
return (chunk >> et->hash_shift) & et->hash_mask;
}

-static void insert_exception(struct dm_exception_table *eh,
- struct dm_exception *e)
-{
- struct list_head *l = &eh->table[exception_hash(eh, e->old_chunk)];
- list_add(&e->hash_list, l);
-}
-
static void remove_exception(struct dm_exception *e)
{
list_del(&e->hash_list);
@@ -455,10 +448,9 @@ static void free_pending_exception(struc
atomic_dec(&s->pending_exceptions_count);
}

-static void insert_completed_exception(struct dm_snapshot *s,
- struct dm_exception *new_e)
+static void insert_exception(struct dm_exception_table *eh,
+ struct dm_exception *new_e)
{
- struct dm_exception_table *eh = &s->complete;
struct list_head *l;
struct dm_exception *e = NULL;

@@ -516,7 +508,7 @@ static int dm_add_exception(void *contex
/* Consecutive_count is implicitly initialised to zero */
e->new_chunk = new;

- insert_completed_exception(s, e);
+ insert_exception(&s->complete, e);

return 0;
}
@@ -958,7 +950,7 @@ static void pending_complete(struct dm_s
* Add a proper exception, and remove the
* in-flight exception from the list.
*/
- insert_completed_exception(s, e);
+ insert_exception(&s->complete, e);

out:
remove_exception(&pe->e);


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 03-17-2009, 01:02 PM
Jonathan Brassow
 
Default dm-snap-consolidate-insert_exception.patch

It is ridiculous to have two 'insert_*exception' functions when one
of the functions already handles both cases. Consolidating them.

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

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
@@ -388,13 +388,6 @@ static uint32_t exception_hash(struct dm
return (chunk >> et->hash_shift) & et->hash_mask;
}

-static void insert_exception(struct dm_exception_table *eh,
- struct dm_exception *e)
-{
- struct list_head *l = &eh->table[exception_hash(eh, e->old_chunk)];
- list_add(&e->hash_list, l);
-}
-
static void remove_exception(struct dm_exception *e)
{
list_del(&e->hash_list);
@@ -455,10 +448,9 @@ static void free_pending_exception(struc
atomic_dec(&s->pending_exceptions_count);
}

-static void insert_completed_exception(struct dm_snapshot *s,
- struct dm_exception *new_e)
+static void insert_exception(struct dm_exception_table *eh,
+ struct dm_exception *new_e)
{
- struct dm_exception_table *eh = &s->complete;
struct list_head *l;
struct dm_exception *e = NULL;

@@ -516,7 +508,7 @@ static int dm_add_exception(void *contex
/* Consecutive_count is implicitly initialised to zero */
e->new_chunk = new;

- insert_completed_exception(s, e);
+ insert_exception(&s->complete, e);

return 0;
}
@@ -958,7 +950,7 @@ static void pending_complete(struct dm_s
* Add a proper exception, and remove the
* in-flight exception from the list.
*/
- insert_completed_exception(s, e);
+ insert_exception(&s->complete, e);

out:
remove_exception(&pe->e);

--
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:30 AM.

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