aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dbuf.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/dbuf.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/dbuf.c')
-rw-r--r--module/zfs/dbuf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
index 55326c498..d08359156 100644
--- a/module/zfs/dbuf.c
+++ b/module/zfs/dbuf.c
@@ -55,6 +55,7 @@ dbuf_cons(void *vdb, void *unused, int kmflag)
mutex_init(&db->db_mtx, NULL, MUTEX_DEFAULT, NULL);
cv_init(&db->db_changed, NULL, CV_DEFAULT, NULL);
refcount_create(&db->db_holds);
+ list_link_init(&db->db_link);
return (0);
}
@@ -1136,6 +1137,7 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx)
* transaction group won't leak out when we sync the older txg.
*/
dr = kmem_zalloc(sizeof (dbuf_dirty_record_t), KM_SLEEP);
+ list_link_init(&dr->dr_dirty_node);
if (db->db_level == 0) {
void *data_old = db->db_buf;