[Ocfs2-tools-devel] [PATCH 30/39] mount.ocfs2: Pass the cluster_stack= option for user stacks.

Sunil Mushran Sunil.Mushran at ORACLE.COM
Fri May 23 17:23:22 PDT 2008


Joel Becker wrote:
> If the filesystem is tagged for a userspace stack, pass the appropriate
> option to mount(2).
>
> Signed-off-by: Joel Becker <joel.becker at oracle.com>
>   

This is not a biggie but we will confuse people between mount
options, heartbeat=x and cluster_stack=x.

One solution, at the expense of longer mount opts, could be to
specify "heartbeat=user, cluster_stack=cman".

Thoughts?

> ---
>  mount.ocfs2/mount.ocfs2.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/mount.ocfs2/mount.ocfs2.c b/mount.ocfs2/mount.ocfs2.c
> index 975fc6a..ed84c9f 100644
> --- a/mount.ocfs2/mount.ocfs2.c
> +++ b/mount.ocfs2/mount.ocfs2.c
> @@ -24,6 +24,8 @@
>  
>  #include "mount.ocfs2.h"
>  
> +#define OCFS2_CLUSTER_STACK_ARG		"cluster_stack="
> +
>  int verbose = 0;
>  int mount_quiet = 0;
>  char *progname = NULL;
> @@ -259,6 +261,7 @@ int main(int argc, char **argv)
>  	char *extra = NULL;
>  	int dev_ro = 0;
>  	char *hbstr = NULL;
> +	char stackstr[strlen(OCFS2_CLUSTER_STACK_ARG) + OCFS2_STACK_LABEL_LEN + 1] = "";
>  	ocfs2_filesys *fs = NULL;
>  	struct o2cb_cluster_desc cluster;
>  	struct o2cb_region_desc desc;
> @@ -313,6 +316,9 @@ int main(int argc, char **argv)
>  				"while trying to determine cluster information");
>  			goto bail;
>  		}
> +		if (cluster.c_stack)
> +			snprintf(stackstr, sizeof(stackstr), "%s%s",
> +				 OCFS2_CLUSTER_STACK_ARG, cluster.c_stack);
>  
>  		ret = ocfs2_fill_heartbeat_desc(fs, &desc);
>  		if (ret) {
> @@ -354,6 +360,8 @@ int main(int argc, char **argv)
>  
>  	if (dev_ro || !clustered)
>  		hbstr = OCFS2_HB_NONE;
> +	else if (strlen(stackstr))
> +		hbstr = stackstr;
>  	else
>  		hbstr = OCFS2_HB_LOCAL;
>  
>   




More information about the Ocfs2-tools-devel mailing list