diff options
author | Alasdair Kergon <agk@redhat.com> | 2005-05-11 16:46:59 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2005-05-11 16:46:59 +0000 |
commit | 0888dc43cfc8c2254ffe87b33726980d0455ce0e (patch) | |
tree | 2f7510c47162b0e77cebf37407c7c9c80ece5626 /libdm/datastruct | |
parent | fece7306458b065b66997f6959bf89d7b83c1fb8 (diff) | |
download | lvm2-0888dc43cfc8c2254ffe87b33726980d0455ce0e.tar.gz lvm2-0888dc43cfc8c2254ffe87b33726980d0455ce0e.tar.xz lvm2-0888dc43cfc8c2254ffe87b33726980d0455ce0e.zip |
Fix contiguous allocations with linear.
Diffstat (limited to 'libdm/datastruct')
-rw-r--r-- | libdm/datastruct/list.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libdm/datastruct/list.h b/libdm/datastruct/list.h index 0510e91b..b43b26ca 100644 --- a/libdm/datastruct/list.h +++ b/libdm/datastruct/list.h @@ -104,6 +104,14 @@ static inline int list_end(struct list *head, struct list *elem) } /* + * Return last element of the list or NULL if empty + */ +static inline struct list *list_last(struct list *head) +{ + return (list_empty(head) ? NULL : head->p); +} + +/* * Return the previous element of the list, or NULL if we've reached the start. */ static inline struct list *list_prev(struct list *head, struct list *elem) |