All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil Mushran <sunil.mushran@oracle.com>
To: Joel Becker <joel.becker@oracle.com>
Cc: ocfs2-devel@oss.oracle.com, mfasheh@suse.com,
	linux-kernel@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH 11/11] ocfs2_dlmfs: Enable the use of user cluster stacks.
Date: Mon, 01 Mar 2010 16:08:31 -0800	[thread overview]
Message-ID: <4B8C56FF.6030509@oracle.com> (raw)
In-Reply-To: <1265794074-19539-12-git-send-email-joel.becker@oracle.com>

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>


Joel Becker wrote:
> Unlike ocfs2, dlmfs has no permanent storage.  It can't store off a
> cluster stack it is supposed to be using.  So it can't specify the stack
> name in ocfs2_cluster_connect().
>
> Instead, we create ocfs2_cluster_connect_agnostic(), which simply uses
> the stack that is currently enabled.  This is find for dlmfs, which will
> rely on the stack initialization.
>
> We add the "stackglue" capability to dlmfs's capability list.  This lets
> userspace know dlmfs can be used with all cluster stacks.
>
> Signed-off-by: Joel Becker <joel.becker@oracle.com>
> ---
>  fs/ocfs2/dlmfs/dlmfs.c      |    2 +-
>  fs/ocfs2/dlmfs/userdlm.c    |    8 ++++----
>  fs/ocfs2/ocfs2_lockingver.h |    2 ++
>  fs/ocfs2/stackglue.c        |   18 ++++++++++++++++++
>  fs/ocfs2/stackglue.h        |   11 +++++++++++
>  5 files changed, 36 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
> index 8697366..1b0de15 100644
> --- a/fs/ocfs2/dlmfs/dlmfs.c
> +++ b/fs/ocfs2/dlmfs/dlmfs.c
> @@ -87,7 +87,7 @@ struct workqueue_struct *user_dlm_worker;
>   * - bast	: POLLIN against the file descriptor of a held lock
>   *		  signifies a bast fired on the lock.
>   */
> -#define DLMFS_CAPABILITIES "bast"
> +#define DLMFS_CAPABILITIES "bast stackglue"
>  extern int param_set_dlmfs_capabilities(const char *val,
>  					struct kernel_param *kp)
>  {
> diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c
> index c1b6a56..2858ee6 100644
> --- a/fs/ocfs2/dlmfs/userdlm.c
> +++ b/fs/ocfs2/dlmfs/userdlm.c
> @@ -666,10 +666,10 @@ struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name)
>  	int rc;
>  	struct ocfs2_cluster_connection *conn;
>  
> -	rc = ocfs2_cluster_connect("o2cb", name->name, name->len,
> -				   &user_dlm_lproto,
> -				   user_dlm_recovery_handler_noop,
> -				   NULL, &conn);
> +	rc = ocfs2_cluster_connect_agnostic(name->name, name->len,
> +					    &user_dlm_lproto,
> +					    user_dlm_recovery_handler_noop,
> +					    NULL, &conn);
>  	if (rc)
>  		mlog_errno(rc);
>  
> diff --git a/fs/ocfs2/ocfs2_lockingver.h b/fs/ocfs2/ocfs2_lockingver.h
> index 82d5eea..2e45c8d 100644
> --- a/fs/ocfs2/ocfs2_lockingver.h
> +++ b/fs/ocfs2/ocfs2_lockingver.h
> @@ -23,6 +23,8 @@
>  /*
>   * The protocol version for ocfs2 cluster locking.  See dlmglue.c for
>   * more details.
> + *
> + * 1.0 - Initial locking version from ocfs2 1.4.
>   */
>  #define OCFS2_LOCKING_PROTOCOL_MAJOR 1
>  #define OCFS2_LOCKING_PROTOCOL_MINOR 0
> diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
> index 31db2e8..39abf89 100644
> --- a/fs/ocfs2/stackglue.c
> +++ b/fs/ocfs2/stackglue.c
> @@ -373,6 +373,24 @@ out:
>  }
>  EXPORT_SYMBOL_GPL(ocfs2_cluster_connect);
>  
> +/* The caller will ensure all nodes have the same cluster stack */
> +int ocfs2_cluster_connect_agnostic(const char *group,
> +				   int grouplen,
> +				   struct ocfs2_locking_protocol *lproto,
> +				   void (*recovery_handler)(int node_num,
> +							    void *recovery_data),
> +				   void *recovery_data,
> +				   struct ocfs2_cluster_connection **conn)
> +{
> +	char *stack_name = NULL;
> +
> +	if (cluster_stack_name[0])
> +		stack_name = cluster_stack_name;
> +	return ocfs2_cluster_connect(stack_name, group, grouplen, lproto,
> +				     recovery_handler, recovery_data, conn);
> +}
> +EXPORT_SYMBOL_GPL(ocfs2_cluster_connect_agnostic);
> +
>  /* If hangup_pending is 0, the stack driver will be dropped */
>  int ocfs2_cluster_disconnect(struct ocfs2_cluster_connection *conn,
>  			     int hangup_pending)
> diff --git a/fs/ocfs2/stackglue.h b/fs/ocfs2/stackglue.h
> index b1981ba..8ce7398 100644
> --- a/fs/ocfs2/stackglue.h
> +++ b/fs/ocfs2/stackglue.h
> @@ -246,6 +246,17 @@ int ocfs2_cluster_connect(const char *stack_name,
>  						   void *recovery_data),
>  			  void *recovery_data,
>  			  struct ocfs2_cluster_connection **conn);
> +/*
> + * Used by callers that don't store their stack name.  They must ensure
> + * all nodes have the same stack.
> + */
> +int ocfs2_cluster_connect_agnostic(const char *group,
> +				   int grouplen,
> +				   struct ocfs2_locking_protocol *lproto,
> +				   void (*recovery_handler)(int node_num,
> +							    void *recovery_data),
> +				   void *recovery_data,
> +				   struct ocfs2_cluster_connection **conn);
>  int ocfs2_cluster_disconnect(struct ocfs2_cluster_connection *conn,
>  			     int hangup_pending);
>  void ocfs2_cluster_hangup(const char *group, int grouplen);
>   

WARNING: multiple messages have this Message-ID (diff)
From: Sunil Mushran <sunil.mushran@oracle.com>
To: Joel Becker <joel.becker@oracle.com>
Cc: ocfs2-devel@oss.oracle.com, mfasheh@suse.com,
	linux-kernel@vger.kernel.org
Subject: Re: [Ocfs2-devel] [PATCH 11/11] ocfs2_dlmfs: Enable the use of user cluster stacks.
Date: Mon, 01 Mar 2010 16:08:31 -0800	[thread overview]
Message-ID: <4B8C56FF.6030509@oracle.com> (raw)
In-Reply-To: <1265794074-19539-12-git-send-email-joel.becker@oracle.com>

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>


Joel Becker wrote:
> Unlike ocfs2, dlmfs has no permanent storage.  It can't store off a
> cluster stack it is supposed to be using.  So it can't specify the stack
> name in ocfs2_cluster_connect().
>
> Instead, we create ocfs2_cluster_connect_agnostic(), which simply uses
> the stack that is currently enabled.  This is find for dlmfs, which will
> rely on the stack initialization.
>
> We add the "stackglue" capability to dlmfs's capability list.  This lets
> userspace know dlmfs can be used with all cluster stacks.
>
> Signed-off-by: Joel Becker <joel.becker@oracle.com>
> ---
>  fs/ocfs2/dlmfs/dlmfs.c      |    2 +-
>  fs/ocfs2/dlmfs/userdlm.c    |    8 ++++----
>  fs/ocfs2/ocfs2_lockingver.h |    2 ++
>  fs/ocfs2/stackglue.c        |   18 ++++++++++++++++++
>  fs/ocfs2/stackglue.h        |   11 +++++++++++
>  5 files changed, 36 insertions(+), 5 deletions(-)
>
> diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
> index 8697366..1b0de15 100644
> --- a/fs/ocfs2/dlmfs/dlmfs.c
> +++ b/fs/ocfs2/dlmfs/dlmfs.c
> @@ -87,7 +87,7 @@ struct workqueue_struct *user_dlm_worker;
>   * - bast	: POLLIN against the file descriptor of a held lock
>   *		  signifies a bast fired on the lock.
>   */
> -#define DLMFS_CAPABILITIES "bast"
> +#define DLMFS_CAPABILITIES "bast stackglue"
>  extern int param_set_dlmfs_capabilities(const char *val,
>  					struct kernel_param *kp)
>  {
> diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c
> index c1b6a56..2858ee6 100644
> --- a/fs/ocfs2/dlmfs/userdlm.c
> +++ b/fs/ocfs2/dlmfs/userdlm.c
> @@ -666,10 +666,10 @@ struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name)
>  	int rc;
>  	struct ocfs2_cluster_connection *conn;
>  
> -	rc = ocfs2_cluster_connect("o2cb", name->name, name->len,
> -				   &user_dlm_lproto,
> -				   user_dlm_recovery_handler_noop,
> -				   NULL, &conn);
> +	rc = ocfs2_cluster_connect_agnostic(name->name, name->len,
> +					    &user_dlm_lproto,
> +					    user_dlm_recovery_handler_noop,
> +					    NULL, &conn);
>  	if (rc)
>  		mlog_errno(rc);
>  
> diff --git a/fs/ocfs2/ocfs2_lockingver.h b/fs/ocfs2/ocfs2_lockingver.h
> index 82d5eea..2e45c8d 100644
> --- a/fs/ocfs2/ocfs2_lockingver.h
> +++ b/fs/ocfs2/ocfs2_lockingver.h
> @@ -23,6 +23,8 @@
>  /*
>   * The protocol version for ocfs2 cluster locking.  See dlmglue.c for
>   * more details.
> + *
> + * 1.0 - Initial locking version from ocfs2 1.4.
>   */
>  #define OCFS2_LOCKING_PROTOCOL_MAJOR 1
>  #define OCFS2_LOCKING_PROTOCOL_MINOR 0
> diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
> index 31db2e8..39abf89 100644
> --- a/fs/ocfs2/stackglue.c
> +++ b/fs/ocfs2/stackglue.c
> @@ -373,6 +373,24 @@ out:
>  }
>  EXPORT_SYMBOL_GPL(ocfs2_cluster_connect);
>  
> +/* The caller will ensure all nodes have the same cluster stack */
> +int ocfs2_cluster_connect_agnostic(const char *group,
> +				   int grouplen,
> +				   struct ocfs2_locking_protocol *lproto,
> +				   void (*recovery_handler)(int node_num,
> +							    void *recovery_data),
> +				   void *recovery_data,
> +				   struct ocfs2_cluster_connection **conn)
> +{
> +	char *stack_name = NULL;
> +
> +	if (cluster_stack_name[0])
> +		stack_name = cluster_stack_name;
> +	return ocfs2_cluster_connect(stack_name, group, grouplen, lproto,
> +				     recovery_handler, recovery_data, conn);
> +}
> +EXPORT_SYMBOL_GPL(ocfs2_cluster_connect_agnostic);
> +
>  /* If hangup_pending is 0, the stack driver will be dropped */
>  int ocfs2_cluster_disconnect(struct ocfs2_cluster_connection *conn,
>  			     int hangup_pending)
> diff --git a/fs/ocfs2/stackglue.h b/fs/ocfs2/stackglue.h
> index b1981ba..8ce7398 100644
> --- a/fs/ocfs2/stackglue.h
> +++ b/fs/ocfs2/stackglue.h
> @@ -246,6 +246,17 @@ int ocfs2_cluster_connect(const char *stack_name,
>  						   void *recovery_data),
>  			  void *recovery_data,
>  			  struct ocfs2_cluster_connection **conn);
> +/*
> + * Used by callers that don't store their stack name.  They must ensure
> + * all nodes have the same stack.
> + */
> +int ocfs2_cluster_connect_agnostic(const char *group,
> +				   int grouplen,
> +				   struct ocfs2_locking_protocol *lproto,
> +				   void (*recovery_handler)(int node_num,
> +							    void *recovery_data),
> +				   void *recovery_data,
> +				   struct ocfs2_cluster_connection **conn);
>  int ocfs2_cluster_disconnect(struct ocfs2_cluster_connection *conn,
>  			     int hangup_pending);
>  void ocfs2_cluster_hangup(const char *group, int grouplen);
>   


  reply	other threads:[~2010-03-02  0:08 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10  9:27 [Ocfs2-devel] [0/11] ocfs2_dlmfs improvements v2 Joel Becker
2010-02-10  9:27 ` Joel Becker
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 01/11] ocfs2_dlmfs: Add capabilities parameter Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-11 20:41   ` [Ocfs2-devel] " Sunil Mushran
2010-02-11 20:41     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 02/11] ocfs2_dlmfs: Use poll() to signify BASTs Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 03/11] ocfs2_dlmfs: Move to its own directory Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-11 21:12   ` [Ocfs2-devel] " Sunil Mushran
2010-02-11 21:12     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 04/11] ocfs2: Pass lksbs back from stackglue ast/bast functions Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-11 21:20   ` [Ocfs2-devel] " Sunil Mushran
2010-02-11 21:20     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 05/11] ocfs2: Attach the connection to the lksb Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-12 23:57   ` [Ocfs2-devel] " Sunil Mushran
2010-02-12 23:57     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 06/11] ocfs2: Hang the locking proto on the cluster conn and use it in asts Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-12 23:59   ` [Ocfs2-devel] " Sunil Mushran
2010-02-12 23:59     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 07/11] ocfs2: Remove the ast pointers from ocfs2_stack_plugins Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-13  1:10   ` [Ocfs2-devel] " Sunil Mushran
2010-02-13  1:10     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 08/11] ocfs2: Pass the locking protocol into ocfs2_cluster_connect() Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-27  0:09   ` [Ocfs2-devel] " Sunil Mushran
2010-02-27  0:09     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 09/11] ocfs2_dlmfs: Don't honor truncate. The size of a dlmfs file is LVB_LEN Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-27  0:11   ` [Ocfs2-devel] " Sunil Mushran
2010-02-27  0:11     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 10/11] ocfs2_dlmfs: Use the stackglue Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-02-27  0:27   ` [Ocfs2-devel] " Sunil Mushran
2010-02-27  0:27     ` Sunil Mushran
2010-02-10  9:27 ` [Ocfs2-devel] [PATCH 11/11] ocfs2_dlmfs: Enable the use of user cluster stacks Joel Becker
2010-02-10  9:27   ` Joel Becker
2010-03-02  0:08   ` Sunil Mushran [this message]
2010-03-02  0:08     ` [Ocfs2-devel] " Sunil Mushran

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=4B8C56FF.6030509@oracle.com \
    --to=sunil.mushran@oracle.com \
    --cc=joel.becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --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.