[Ocfs2-tools-devel] [PATCH 3/6] O2info: Add --coherency option for o2info.

tristan tristan.ye at oracle.com
Sun Apr 25 19:46:38 PDT 2010


Sunil Mushran wrote:
> Call the option --coherent.
>
> Also, shouldn't the handler set it to 1. As in,
> cluster_coherent = 0 should mean no coherency, right?

Ok, that's fine. I originally set the OCFS2_INFO_FILLED_FLAG to 
cluster_coherent as default, which means no cluster-coherent.
and set cluster_coherent to 0 as cluster-coherent since I simply pass 
the cluster_coherent to ioctl(2) as a flag. that's confusing somehow;)

I'll make that more straightforward like:

default:
cluster_coherent = 0;

if --coherent option is specified:
cluster_coherent = 1;


if (cluster_coherent)
flag = 0;
else
flag |= OCFS2_INFO_FILLED_FLAG;


o2info_fill_request(..., flag);

>
> Tristan Ye wrote:
>> Default will be no cluster-in-coherency.
>>
>> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
>> ---
>> o2info/o2info.c | 22 ++++++++++++++++++++++
>> 1 files changed, 22 insertions(+), 0 deletions(-)
>>
>> diff --git a/o2info/o2info.c b/o2info/o2info.c
>> index 6aaeb46..28601dd 100644
>> --- a/o2info/o2info.c
>> +++ b/o2info/o2info.c
>> @@ -51,6 +51,13 @@ static int version_handler(struct o2info_option 
>> *opt, char *arg)
>> exit(0);
>> }
>>
>> +static int coherency_handler(struct o2info_option *opt, char *arg)
>> +{
>> + cluster_coherent = 0;
>> +
>> + return 0;
>> +}
>> +
>> static struct o2info_option help_option = {
>> .opt_option = {
>> .name = "help",
>> @@ -77,9 +84,24 @@ static struct o2info_option version_option = {
>> .opt_private = NULL,
>> };
>>
>> +static struct o2info_option coherency_option = {
>> + .opt_option = {
>> + .name = "coherency",
>> + .val = 'C',
>> + .has_arg = 0,
>> + .flag = NULL,
>> + },
>> + .opt_help =
>> + "-C|--coherency",
>> + .opt_handler = coherency_handler,
>> + .opt_op = NULL,
>> + .opt_private = NULL,
>> +};
>> +
>> static struct o2info_option *options[] = {
>> &help_option,
>> &version_option,
>> + &coherency_option,
>> NULL,
>> };
>>
>




More information about the Ocfs2-tools-devel mailing list