[Ocfs2-devel] [PATCH] Add dlm_recover_callback_support in sysfs
Goldwyn Rodrigues
rgoldwyn at suse.de
Wed Feb 26 05:01:38 PST 2014
On 02/25/2014 02:21 PM, Andrew Morton wrote:
> On Tue, 25 Feb 2014 09:28:44 -0600 Goldwyn Rodrigues <rgoldwyn at suse.de> wrote:
>
>> This is a part of the nocontrold feature which was incorporated sometime
>> back.
>>
>> This is required for backward compatibility of the tools, specifically the
>> scenario where the tools with recovery callback is used with a kernel
>> not using the recovery callbacks (older kernel + newer tools). The tools
>> look for this file to understand if the kernel supports DLM recovery
>> callbacks.
>>
>> For kernels which support recovery callbacks but will miss this patch,
>> ocfs2 will continue to use the older API and would still be able to
>> mount the filesystem.
>>
>> ...
>>
>> +static ssize_t ocfs2_dlm_recover_show(struct kobject *kobj,
>> + struct kobj_attribute *attr,
>> + char *buf)
>> +{
>> + ssize_t ret;
>> + ret = snprintf(buf, PAGE_SIZE, "1\n");
>> + return ret;
>> +}
>
> That's a bit long-winded. What's wrong with
>
> static ssize_t ocfs2_dlm_recover_show(struct kobject *kobj,
> struct kobj_attribute *attr,
> char *buf)
> {
> return snprintf(buf, PAGE_SIZE, "1\n");
> }
>
> ?
>
Nothing. Rather, it is much better.
Thanks for the review.
--
Goldwyn
More information about the Ocfs2-devel
mailing list