All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] dlm: constify a couple of DLM calls
Date: Fri, 13 Jun 2008 15:35:42 +0100	[thread overview]
Message-ID: <1213367742.4011.38.camel@quoit> (raw)


This patch adds some consts to the DLM in a few places. This means that
the interfaces to new lockspace and the lock commands can take const
pointers for the lock space name and lock name respectively. I noticed
that the lock name is a void * in the header file, but a char *
internally to DLM. Perhaps the interface and the internal type should be
changed to match?

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: David Teigland <teigland@redhat.com>
Cc: Christine Caulfield <ccaulfie@redhat.com>

diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c
diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 2d3d102..8ad51cc 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -330,7 +330,7 @@ static void queue_bast(struct dlm_rsb *r, struct dlm_lkb *lkb, int rqmode)
  * Basic operations on rsb's and lkb's
  */
 
-static struct dlm_rsb *create_rsb(struct dlm_ls *ls, char *name, int len)
+static struct dlm_rsb *create_rsb(struct dlm_ls *ls, const char *name, int len)
 {
 	struct dlm_rsb *r;
 
@@ -353,7 +353,7 @@ static struct dlm_rsb *create_rsb(struct dlm_ls *ls, char *name, int len)
 	return r;
 }
 
-static int search_rsb_list(struct list_head *head, char *name, int len,
+static int search_rsb_list(struct list_head *head, const char *name, int len,
 			   unsigned int flags, struct dlm_rsb **r_ret)
 {
 	struct dlm_rsb *r;
@@ -372,7 +372,7 @@ static int search_rsb_list(struct list_head *head, char *name, int len,
 	return error;
 }
 
-static int _search_rsb(struct dlm_ls *ls, char *name, int len, int b,
+static int _search_rsb(struct dlm_ls *ls, const char *name, int len, int b,
 		       unsigned int flags, struct dlm_rsb **r_ret)
 {
 	struct dlm_rsb *r;
@@ -407,7 +407,7 @@ static int _search_rsb(struct dlm_ls *ls, char *name, int len, int b,
 	return error;
 }
 
-static int search_rsb(struct dlm_ls *ls, char *name, int len, int b,
+static int search_rsb(struct dlm_ls *ls, const char *name, int len, int b,
 		      unsigned int flags, struct dlm_rsb **r_ret)
 {
 	int error;
@@ -431,7 +431,7 @@ static int search_rsb(struct dlm_ls *ls, char *name, int len, int b,
  * ref count of 1; when found on normal list the ref count is incremented.
  */
 
-static int find_rsb(struct dlm_ls *ls, char *name, int namelen,
+static int find_rsb(struct dlm_ls *ls, const char *name, int namelen,
 		    unsigned int flags, struct dlm_rsb **r_ret)
 {
 	struct dlm_rsb *r, *tmp;
@@ -2414,8 +2414,8 @@ static int _cancel_lock(struct dlm_rsb *r, struct dlm_lkb *lkb)
  * request_lock(), convert_lock(), unlock_lock(), cancel_lock()
  */
 
-static int request_lock(struct dlm_ls *ls, struct dlm_lkb *lkb, char *name,
-			int len, struct dlm_args *args)
+static int request_lock(struct dlm_ls *ls, struct dlm_lkb *lkb,
+			const char *name, int len, struct dlm_args *args)
 {
 	struct dlm_rsb *r;
 	int error;
@@ -2516,7 +2516,7 @@ int dlm_lock(dlm_lockspace_t *lockspace,
 	     int mode,
 	     struct dlm_lksb *lksb,
 	     uint32_t flags,
-	     void *name,
+	     const void *name,
 	     unsigned int namelen,
 	     uint32_t parent_lkid,
 	     void (*ast) (void *astarg),
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 499e167..4163834 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -246,7 +246,7 @@ static void dlm_scand_stop(void)
 	kthread_stop(scand_task);
 }
 
-static struct dlm_ls *dlm_find_lockspace_name(char *name, int namelen)
+static struct dlm_ls *dlm_find_lockspace_name(const char *name, int namelen)
 {
 	struct dlm_ls *ls;
 
@@ -377,7 +377,7 @@ static void threads_stop(void)
 	dlm_astd_stop();
 }
 
-static int new_lockspace(char *name, int namelen, void **lockspace,
+static int new_lockspace(const char *name, int namelen, void **lockspace,
 			 uint32_t flags, int lvblen)
 {
 	struct dlm_ls *ls;
@@ -579,7 +579,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
 	return error;
 }
 
-int dlm_new_lockspace(char *name, int namelen, void **lockspace,
+int dlm_new_lockspace(const char *name, int namelen, void **lockspace,
 		      uint32_t flags, int lvblen)
 {
 	int error = 0;
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
diff --git a/fs/dlm/main.c b/fs/dlm/main.c
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c
diff --git a/fs/dlm/netlink.c b/fs/dlm/netlink.c
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
diff --git a/fs/dlm/rcom.c b/fs/dlm/rcom.c
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c
diff --git a/fs/dlm/recoverd.c b/fs/dlm/recoverd.c
diff --git a/fs/dlm/requestqueue.c b/fs/dlm/requestqueue.c
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
diff --git a/fs/dlm/util.c b/fs/dlm/util.c
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 203a025..ef27f1a 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -78,8 +78,8 @@ struct dlm_lksb {
  * the cluster, the calling node joins it.
  */
 
-int dlm_new_lockspace(char *name, int namelen, dlm_lockspace_t **lockspace,
-		      uint32_t flags, int lvblen);
+int dlm_new_lockspace(const char *name, int namelen,
+		      dlm_lockspace_t **lockspace, uint32_t flags, int lvblen);
 
 /*
  * dlm_release_lockspace
@@ -130,7 +130,7 @@ int dlm_lock(dlm_lockspace_t *lockspace,
 	     int mode,
 	     struct dlm_lksb *lksb,
 	     uint32_t flags,
-	     void *name,
+	     const void *name,
 	     unsigned int namelen,
 	     uint32_t parent_lkid,
 	     void (*lockast) (void *astarg),




             reply	other threads:[~2008-06-13 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-13 14:35 Steven Whitehouse [this message]
2008-06-13 14:44 ` [Cluster-devel] Re: dlm: constify a couple of DLM calls David Teigland

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=1213367742.4011.38.camel@quoit \
    --to=swhiteho@redhat.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.