summaryrefslogtreecommitdiff
path: root/kern/sref_i.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-09 23:39:44 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-10 22:47:34 +0100
commite82501678afa48d33ea6d45c31220bf6a42f3493 (patch)
treeb5f7d03d998f156619af87d220ad5dd1d5b9e09c /kern/sref_i.h
parent8168a2ba783cfd3d24b201e619d29c92d6621a1e (diff)
kern/sref: use an slist for review queues
Diffstat (limited to 'kern/sref_i.h')
-rw-r--r--kern/sref_i.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/kern/sref_i.h b/kern/sref_i.h
index 5b63857f..09dbbfa8 100644
--- a/kern/sref_i.h
+++ b/kern/sref_i.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017 Richard Braun.
+ * Copyright (c) 2014-2018 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
#include <stdint.h>
+#include <kern/slist.h>
#include <kern/spinlock.h>
#include <kern/work.h>
@@ -44,15 +45,17 @@ struct sref_weakref {
/*
* Scalable reference counter.
*
- * It's tempting to merge the flags into the next member, but since they're
+ * It's tempting to merge the flags into the node member, but since they're
* not protected by the same lock, store them separately.
+ *
+ * TODO Locking keys.
*/
struct sref_counter {
sref_noref_fn_t noref_fn;
union {
struct {
- struct sref_counter *next;
+ struct slist_node node;
struct spinlock lock;
int flags;
unsigned long value;