Skip to content

Commit

Permalink
Removed list_size struct member from user space list implementation
Browse files Browse the repository at this point in the history
Removed the list_size struct member as it was only used in a single
assertion, as mentioned in PR openzfs#15478.

Signed-off-by: MigeljanImeri <imerimigel@gmail.com>
  • Loading branch information
MigeljanImeri committed Jan 24, 2024
1 parent 447755c commit b0eb8e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/libspl/include/sys/list_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ struct list_node {
};

struct list {
size_t list_size;
size_t list_offset;
struct list_node list_head;
};
Expand Down
6 changes: 2 additions & 4 deletions lib/libspl/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ void
list_create(list_t *list, size_t size, size_t offset)
{
ASSERT(list);
ASSERT(size > 0);
ASSERT(size >= offset + sizeof (list_node_t));

list->list_size = size;
(void) size;

list->list_offset = offset;
list->list_head.next = list->list_head.prev = &list->list_head;
}
Expand Down Expand Up @@ -194,7 +193,6 @@ list_move_tail(list_t *dst, list_t *src)
list_node_t *dstnode = &dst->list_head;
list_node_t *srcnode = &src->list_head;

ASSERT(dst->list_size == src->list_size);
ASSERT(dst->list_offset == src->list_offset);

if (list_empty(src))
Expand Down

0 comments on commit b0eb8e5

Please sign in to comment.