]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Remove list_size struct member from list implementation
authorMigeljanImeri <78048439+MigeljanImeri@users.noreply.github.com>
Fri, 26 Jan 2024 22:46:42 +0000 (15:46 -0700)
committerGitHub <noreply@github.com>
Fri, 26 Jan 2024 22:46:42 +0000 (14:46 -0800)
Removed the list_size struct member as it was only used in a single
assertion, as mentioned in PR #15478.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: MigeljanImeri <imerimigel@gmail.com>
Closes #15812

include/os/freebsd/spl/sys/list_impl.h
include/os/linux/spl/sys/list.h
lib/libspl/include/sys/list_impl.h
lib/libspl/list.c
module/os/freebsd/spl/list.c

index 09b70232e8ee4618b2526c7292461f849f1458b8..06a5c6d1dbc69a7f6ca5385272c09838d04cb1fb 100644 (file)
@@ -39,7 +39,6 @@ struct list_node {
 };
 
 struct list {
-       size_t  list_size;
        size_t  list_offset;
        struct list_node list_head;
 };
index 80300df15abe90c32e3ce6c4be6d910d0b6a0b26..046a75e19353e13e8d2f27b16af571f77acfa718 100644 (file)
@@ -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;
@@ -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);
 }
index 24c1ceb2a9fae5305d973c369f73805f26db52af..629db34da067db42549cd052c0ddc1e15bf929c6 100644 (file)
@@ -39,7 +39,6 @@ struct list_node {
 };
 
 struct list {
-       size_t  list_size;
        size_t  list_offset;
        struct list_node list_head;
 };
index 24403698627c7de1c1168634a761032ca794c3c9..aaa71dc73c980e8dbb904aaebe09394df41bad2f 100644 (file)
@@ -65,7 +65,8 @@ list_create(list_t *list, size_t size, size_t offset)
        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;
 }
@@ -194,7 +195,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))
index ab6049cfbd4334afaf1c0389238df6703c97b2e7..56432050fdc6044cd10439ecb16ce9e08113c420 100644 (file)
@@ -64,7 +64,8 @@ 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;
@@ -194,7 +195,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))