Skip to content

Commit

Permalink
Removed list_size struct member from kernel 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 18, 2024
1 parent ef00da8 commit b4a98f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion include/os/freebsd/spl/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
4 changes: 2 additions & 2 deletions include/os/linux/spl/sys/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
typedef struct list_head list_node_t;

typedef struct list {
size_t list_size;
size_t list_offset;
list_node_t list_head;
} list_t;
Expand All @@ -72,7 +71,8 @@ list_link_init(list_node_t *node)
static inline void
list_create(list_t *list, size_t size, size_t offset)
{
list->list_size = size;
(void) size;

list->list_offset = offset;
INIT_LIST_HEAD(&list->list_head);
}
Expand Down
5 changes: 2 additions & 3 deletions module/os/freebsd/spl/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ void
list_create(list_t *list, size_t size, size_t offset)
{
ASSERT3P(list, !=, NULL);
ASSERT3U(size, >=, offset + sizeof (list_node_t));

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

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

ASSERT3U(dst->list_size, ==, src->list_size);
ASSERT3U(dst->list_offset, ==, src->list_offset);

if (list_empty(src))
Expand Down

0 comments on commit b4a98f6

Please sign in to comment.