diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-06-08 08:04:36 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-06-08 08:04:36 +0100 |
commit | c6913b5aaf48107f7bb9fb4e01c7f74c863b3713 (patch) | |
tree | fc54da78886f20023cd57fcc188f255f624b36ed /tools/blktap2/include | |
parent | 08a07a95dd601b4fe686e4e2d8ef41930652d2bb (diff) | |
download | xen-c6913b5aaf48107f7bb9fb4e01c7f74c863b3713.tar.gz xen-c6913b5aaf48107f7bb9fb4e01c7f74c863b3713.tar.bz2 xen-c6913b5aaf48107f7bb9fb4e01c7f74c863b3713.zip |
blktap2: Cleanup vdi stacking code.
Removes some rough edges, memory leakage (?), fixes __list_splice, ...
Signed-off-by: Jake Wires <jake.wires@citrix.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Diffstat (limited to 'tools/blktap2/include')
-rw-r--r-- | tools/blktap2/include/list.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/blktap2/include/list.h b/tools/blktap2/include/list.h index 2a5f855743..cbd0050dc5 100644 --- a/tools/blktap2/include/list.h +++ b/tools/blktap2/include/list.h @@ -87,24 +87,25 @@ static inline int list_is_last(const struct list_head *list, return list->next == head; } -static inline void __list_splice(struct list_head *list, - struct list_head *head) +static inline void __list_splice(const struct list_head *list, + struct list_head *prev, + struct list_head *next) { struct list_head *first = list->next; struct list_head *last = list->prev; - struct list_head *at = head->next; - first->prev = head; - head->next = first; + first->prev = prev; + prev->next = first; - last->next = at; - at->prev = last; + last->next = next; + next->prev = last; } -static inline void list_splice(struct list_head *list, struct list_head *head) +static inline void list_splice(const struct list_head *list, + struct list_head *head) { if (!list_empty(list)) - __list_splice(list, head); + __list_splice(list, head, head->next); } #define list_entry(ptr, type, member) \ |