[Ocfs2-tools-devel] [PATCH 1/1] Add a new method for exclusive option check in tunefs.ocfs2.

Joel Becker Joel.Becker at oracle.com
Tue Nov 6 22:41:07 PST 2007


On Wed, Nov 07, 2007 at 01:41:26PM +0800, tao.ma wrote:
> Joel Becker wrote:
>> if (opts.exclusive) 	error("Cannot combine operations %s and %s", 
>> opts.exclusive,
>> 	      this_opt_name);
>> else
>> 	opts.exclusive = this_opt_name;
>>   
> This is good, but there are some situations that can't be solved.
> Considering  we use "list-sparse" combined with "-L label". It can't be 
> judged since "-L" isn't exclusive.

	Oh, it won't solve all conflicting options.  It's only good for
catching conflicting exclusive operations.  You could fill it with
a special non-exclusive string when you see the first non-exclusive
option.  Probably best to wrap this in a function seen_opt(opts,
this_opt_name).  You'd just pass a generic "that are non-exclusive" as
this_opt_name when the operation isn't exclusive.
	Even with that, there are going to be other checks required to
make sure all the option combinations work.

Joel

-- 

"Hey mister if you're gonna walk on water,
 Could you drop a line my way?"

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list