aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 10:26:44 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 08:38:45 -0700
commit98f72a539c8ca2ba1ca7fc8cac44018ade96065c (patch)
tree466e468d0e1b4abbad0e42cf7bbba222371a9962 /module/zfs/arc.c
parent59e6e7ca85e984433fc9c929dd0d474579bb88a5 (diff)
Fix list handling to only use the API
Remove all instances of list handling where the API is not used and instead list data members are directly accessed. Doing this sort of thing is bad for portability. Additionally, ensure that list_link_init() is called on newly created list nodes. This ensures the node is properly initialized and does not rely on the assumption that zero'ing the list_node_t via kmem_zalloc() is the same as proper initialization. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 1d7fd9e4c..3b76d1fbf 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -794,6 +794,8 @@ hdr_cons(void *vbuf, void *unused, int kmflag)
refcount_create(&buf->b_refcnt);
cv_init(&buf->b_cv, NULL, CV_DEFAULT, NULL);
mutex_init(&buf->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL);
+ list_link_init(&buf->b_arc_node);
+ list_link_init(&buf->b_l2node);
arc_space_consume(sizeof (arc_buf_hdr_t), ARC_SPACE_HDRS);
return (0);
@@ -4537,6 +4539,7 @@ l2arc_add_vdev(spa_t *spa, vdev_t *vd)
adddev->l2ad_evict = adddev->l2ad_start;
adddev->l2ad_first = B_TRUE;
adddev->l2ad_writing = B_FALSE;
+ list_link_init(&adddev->l2ad_node);
ASSERT3U(adddev->l2ad_write, >, 0);
/*