[Ocfs2-devel] [PATCH 03/20] ocfs2: Add support for heartbeat=global mount option

Wengang Wang wen.gang.wang at oracle.com
Sat Sep 25 01:39:44 PDT 2010


On 10-09-14 15:50, Sunil Mushran wrote:
> Adds support for heartbeat=global mount option. It ensures that the heartbeat
> mode passed matches the one enabled on disk.
> 
> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
> ---
>  fs/ocfs2/ocfs2.h    |    4 ++-
>  fs/ocfs2/ocfs2_fs.h |    1 +
>  fs/ocfs2/super.c    |   55 ++++++++++++++++++++++++++++++++++++++-------------
>  3 files changed, 45 insertions(+), 15 deletions(-)
> 
> @@ -1291,6 +1301,7 @@ static int ocfs2_parse_options(struct super_block *sb,
>  {
>  	int status;
>  	char *p;
> +	u32 tmp;
>  
>  	mlog_entry("remount: %d, options: \"%s\"\n", is_remount,
>  		   options ? options : "(none)");
> @@ -1322,7 +1333,10 @@ static int ocfs2_parse_options(struct super_block *sb,
>  			mopt->mount_opt |= OCFS2_MOUNT_HB_LOCAL;
>  			break;
>  		case Opt_hb_none:
> -			mopt->mount_opt &= ~OCFS2_MOUNT_HB_LOCAL;
> +			mopt->mount_opt |= OCFS2_MOUNT_HB_NONE;
> +			break;
> +		case Opt_hb_global:
> +			mopt->mount_opt |= OCFS2_MOUNT_HB_GLOBAL;
>  			break;
>  		case Opt_barrier:
>  			if (match_int(&args[0], &option)) {
> @@ -1477,6 +1491,15 @@ static int ocfs2_parse_options(struct super_block *sb,
>  		}
>  	}
>  
> +	/* Ensure only one heartbeat mode */
> +	tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL |
> +				 OCFS2_MOUNT_HB_NONE);
> +	if (hweight32(tmp) != 1) {
> +		mlog(ML_ERROR, "Invalid heartbeat mount option: %s\n", options);

Coming here, the "options" doesn't hold orginal options yet.

regards,
wengang.



More information about the Ocfs2-devel mailing list