All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] remove vote_obj_lock
Date: Mon Aug 30 08:41:49 2004	[thread overview]
Message-ID: <20040830134143.GA17497@lst.de> (raw)

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()
  *

                 reply	other threads:[~2004-08-30  8:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040830134143.GA17497@lst.de \
    --to=hch@lst.de \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.