summaryrefslogtreecommitdiff
path: root/net/ceph/string_table.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-07-30 03:38:26 +0300
committerIlya Dryomov <idryomov@gmail.com>2016-08-08 22:41:42 +0300
commit864364a29c26ed83b3eeca5fa278468dc3ae9ed4 (patch)
tree110b270984da9ac18f315281db430aa1cfbb1585 /net/ceph/string_table.c
parentf52ec33cbd848632559c87c9305a70fb6eb97f18 (diff)
downloadlinux-864364a29c26ed83b3eeca5fa278468dc3ae9ed4.tar.xz
libceph: using kfree_rcu() to simplify the code
The callback function of call_rcu() just calls a kfree(), so we can use kfree_rcu() instead of call_rcu() + callback function. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/string_table.c')
-rw-r--r--net/ceph/string_table.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/net/ceph/string_table.c b/net/ceph/string_table.c
index ca53c8319209..22fb96efcf34 100644
--- a/net/ceph/string_table.c
+++ b/net/ceph/string_table.c
@@ -84,12 +84,6 @@ retry:
}
EXPORT_SYMBOL(ceph_find_or_create_string);
-static void ceph_free_string(struct rcu_head *head)
-{
- struct ceph_string *cs = container_of(head, struct ceph_string, rcu);
- kfree(cs);
-}
-
void ceph_release_string(struct kref *ref)
{
struct ceph_string *cs = container_of(ref, struct ceph_string, kref);
@@ -101,7 +95,7 @@ void ceph_release_string(struct kref *ref)
}
spin_unlock(&string_tree_lock);
- call_rcu(&cs->rcu, ceph_free_string);
+ kfree_rcu(cs, rcu);
}
EXPORT_SYMBOL(ceph_release_string);