* [Ocfs2-devel] [PATCH] remove vote_obj_lock
@ 2004-08-30 8:41 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2004-08-30 8:41 UTC (permalink / raw)
To: ocfs2-devel
ocfs_vote_obj.refcount is an atomic_t already so we don't need an
additional spinlock to protect it.
Index: src/vote.c
===================================================================
--- src/vote.c (revision 1398)
+++ src/vote.c (working copy)
@@ -64,26 +64,18 @@
static int ocfs_send_bcast (ocfs_super * osb, ocfs_node_map *votemap, ocfs_dlm_msg * dlm_msg);
static int ocfs_node_map_stringify(ocfs_node_map *map, char **str);
-static spinlock_t vote_obj_lock = SPIN_LOCK_UNLOCKED;
-
-
-static void ocfs_put_vote_obj (ocfs_vote_obj *obj)
+static void ocfs_put_vote_obj(ocfs_vote_obj *obj)
{
- spin_lock(&vote_obj_lock);
if (atomic_dec_and_test(&obj->refcount))
kfree(obj);
- spin_unlock(&vote_obj_lock);
}
-static void ocfs_get_vote_obj (ocfs_vote_obj *obj)
+static void ocfs_get_vote_obj(ocfs_vote_obj *obj)
{
- spin_lock(&vote_obj_lock);
atomic_inc(&obj->refcount);
- spin_unlock(&vote_obj_lock);
}
-
/*
* ocfs_recv_udp_msg()
*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-30 8:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-30 8:41 [Ocfs2-devel] [PATCH] remove vote_obj_lock Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.