提交 47c8c52d 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

call rcu_end_read

上级 d065f375
...@@ -95,6 +95,7 @@ bget(uint dev, uint sector) ...@@ -95,6 +95,7 @@ bget(uint dev, uint sector)
cv_sleep(&b->cv, &b->lock); cv_sleep(&b->cv, &b->lock);
release(&b->lock); release(&b->lock);
rcu_end_read();
goto loop; goto loop;
} }
rcu_end_read(); rcu_end_read();
......
...@@ -111,6 +111,7 @@ ns_lookup(struct ns *ns, uint key) ...@@ -111,6 +111,7 @@ ns_lookup(struct ns *ns, uint key)
while (e != NULL) { while (e != NULL) {
if (e->key == key) { if (e->key == key) {
rcu_end_read();
return e->val; return e->val;
} }
e = e->next; e = e->next;
...@@ -172,8 +173,10 @@ ns_enumerate(struct ns *ns, void *(*f)(uint, void *)) ...@@ -172,8 +173,10 @@ ns_enumerate(struct ns *ns, void *(*f)(uint, void *))
struct elem *e = ns->table[i].chain; struct elem *e = ns->table[i].chain;
while (e != NULL) { while (e != NULL) {
void *r = (*f)(e->key, e->val); void *r = (*f)(e->key, e->val);
if (r) if (r) {
rcu_end_read();
return r; return r;
}
e = e->next; e = e->next;
} }
} }
...@@ -190,9 +193,11 @@ ns_enumerate_key(struct ns *ns, uint key, void *(*f)(void *)) ...@@ -190,9 +193,11 @@ ns_enumerate_key(struct ns *ns, uint key, void *(*f)(void *))
while (e) { while (e) {
if (e->key == key) { if (e->key == key) {
void *r = (*f)(e->val); void *r = (*f)(e->val);
if (r) if (r) {
rcu_end_read();
return r; return r;
} }
}
e = e->next; e = e->next;
} }
rcu_end_read(); rcu_end_read();
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论