[Ocfs2-tools-devel] [PATCH 1/5] Move feature string parsing out of mkfs.ocfs2, take 1

Tao Ma tao.ma at oracle.com
Wed Oct 17 17:02:13 PDT 2007


Mark Fasheh Wrote:
> On Wed, Oct 17, 2007 at 05:21:42PM +0800, tao.ma wrote:
>   
>> tunfs.ocfs2 now also have to parse the feature-strings,
>> so move the feature string parsing out of mkfs.ocfs2 and create
>> a new file named feature_string.c in libocfs2 to handle this work.
>> Now tunefs.ocfs2 can also use it.
>>     
>
> Generally, that all looks good - I'm glad we're putting that in the library.
> Can you explain to me whether you changed any code when moving it into
> libocfs2? It's hard to tell from the patch if there were any functional
> changes.
> 	--Mark
>   
I don't change the main mechanism of the feature string parsing. So just 
some caller is modified to erase the usage of State and progname in mkfs.
So the main change is:
here

 		case FEATURE_LEVEL:
-			parse_feature_level_opts(progname, optarg,
-						 &index);
+			ret = parse_feature_level(optarg, &index);
+			if (ret) {
+				com_err(progname, ret,
+					"when parsing fs-feature-level string");
+				exit(1);
+			}
here 
-			parse_feature_opts(progname, optarg,
-					      &feature_flags,
-					      &reverse_flags);
+			ret = parse_feature(optarg,
+					    &feature_flags,
+					    &reverse_flags);
+			if (ret) {
+				com_err(progname, ret,
+					"when parsing fs-features string");
+				exit(1);
+			}

and

-	if(!merge_feature_flags_with_level(s, &feature_level_defaults[index],
+	if(!merge_feature_flags_with_level(&s->feature_flags,
+					   index,

FYI.




More information about the Ocfs2-tools-devel mailing list