summaryrefslogtreecommitdiff
path: root/fs/aufs/dynop.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/aufs/dynop.c')
-rw-r--r--fs/aufs/dynop.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/fs/aufs/dynop.c b/fs/aufs/dynop.c
index dfb3a718d..1deb54077 100644
--- a/fs/aufs/dynop.c
+++ b/fs/aufs/dynop.c
@@ -14,17 +14,17 @@
* How large will these lists be?
* Usually just a few elements, 20-30 at most for each, I guess.
*/
-static struct au_splhead dynop[AuDyLast];
+static struct au_sphlhead dynop[AuDyLast];
-static struct au_dykey *dy_gfind_get(struct au_splhead *spl, const void *h_op)
+static struct au_dykey *dy_gfind_get(struct au_sphlhead *sphl, const void *h_op)
{
struct au_dykey *key, *tmp;
- struct list_head *head;
+ struct hlist_head *head;
key = NULL;
- head = &spl->head;
+ head = &sphl->head;
rcu_read_lock();
- list_for_each_entry_rcu(tmp, head, dk_list)
+ hlist_for_each_entry_rcu(tmp, head, dk_hnode)
if (tmp->dk_op.dy_hop == h_op) {
key = tmp;
kref_get(&key->dk_kref);
@@ -71,24 +71,24 @@ static struct au_dykey *dy_bradd(struct au_branch *br, struct au_dykey *key)
}
/* kref_get() if @key is already added */
-static struct au_dykey *dy_gadd(struct au_splhead *spl, struct au_dykey *key)
+static struct au_dykey *dy_gadd(struct au_sphlhead *sphl, struct au_dykey *key)
{
struct au_dykey *tmp, *found;
- struct list_head *head;
+ struct hlist_head *head;
const void *h_op = key->dk_op.dy_hop;
found = NULL;
- head = &spl->head;
- spin_lock(&spl->spin);
- list_for_each_entry(tmp, head, dk_list)
+ head = &sphl->head;
+ spin_lock(&sphl->spin);
+ hlist_for_each_entry(tmp, head, dk_hnode)
if (tmp->dk_op.dy_hop == h_op) {
kref_get(&tmp->dk_kref);
found = tmp;
break;
}
if (!found)
- list_add_rcu(&key->dk_list, head);
- spin_unlock(&spl->spin);
+ hlist_add_head_rcu(&key->dk_hnode, head);
+ spin_unlock(&sphl->spin);
if (!found)
DyPrSym(key);
@@ -101,17 +101,17 @@ static void dy_free_rcu(struct rcu_head *rcu)
key = container_of(rcu, struct au_dykey, dk_rcu);
DyPrSym(key);
- kfree(key);
+ kfree(key); /* not delayed */
}
static void dy_free(struct kref *kref)
{
struct au_dykey *key;
- struct au_splhead *spl;
+ struct au_sphlhead *sphl;
key = container_of(kref, struct au_dykey, dk_kref);
- spl = dynop + key->dk_op.dy_type;
- au_spl_del_rcu(&key->dk_list, spl);
+ sphl = dynop + key->dk_op.dy_type;
+ au_sphl_del_rcu(&key->dk_hnode, sphl);
call_rcu(&key->dk_rcu, dy_free_rcu);
}
@@ -196,7 +196,7 @@ static void dy_bug(struct kref *kref)
static struct au_dykey *dy_get(struct au_dynop *op, struct au_branch *br)
{
struct au_dykey *key, *old;
- struct au_splhead *spl;
+ struct au_sphlhead *sphl;
struct op {
unsigned int sz;
void (*set)(struct au_dykey *key, const void *h_op,
@@ -210,8 +210,8 @@ static struct au_dykey *dy_get(struct au_dynop *op, struct au_branch *br)
};
const struct op *p;
- spl = dynop + op->dy_type;
- key = dy_gfind_get(spl, op->dy_hop);
+ sphl = dynop + op->dy_type;
+ key = dy_gfind_get(sphl, op->dy_hop);
if (key)
goto out_add; /* success */
@@ -225,9 +225,9 @@ static struct au_dykey *dy_get(struct au_dynop *op, struct au_branch *br)
key->dk_op.dy_hop = op->dy_hop;
kref_init(&key->dk_kref);
p->set(key, op->dy_hop, au_br_sb(br));
- old = dy_gadd(spl, key);
+ old = dy_gadd(sphl, key);
if (old) {
- kfree(key);
+ au_delayed_kfree(key);
key = old;
}
@@ -322,16 +322,16 @@ int au_dy_irefresh(struct inode *inode)
void au_dy_arefresh(int do_dx)
{
- struct au_splhead *spl;
- struct list_head *head;
+ struct au_sphlhead *sphl;
+ struct hlist_head *head;
struct au_dykey *key;
- spl = dynop + AuDy_AOP;
- head = &spl->head;
- spin_lock(&spl->spin);
- list_for_each_entry(key, head, dk_list)
+ sphl = dynop + AuDy_AOP;
+ head = &sphl->head;
+ spin_lock(&sphl->spin);
+ hlist_for_each_entry(key, head, dk_hnode)
dy_adx((void *)key, do_dx);
- spin_unlock(&spl->spin);
+ spin_unlock(&sphl->spin);
}
/* ---------------------------------------------------------------------- */
@@ -344,7 +344,7 @@ void __init au_dy_init(void)
BUILD_BUG_ON(offsetof(struct au_dyaop, da_key));
for (i = 0; i < AuDyLast; i++)
- au_spl_init(dynop + i);
+ au_sphl_init(dynop + i);
}
void au_dy_fin(void)
@@ -352,5 +352,5 @@ void au_dy_fin(void)
int i;
for (i = 0; i < AuDyLast; i++)
- WARN_ON(!list_empty(&dynop[i].head));
+ WARN_ON(!hlist_empty(&dynop[i].head));
}