From mboxrd@z Thu Jan 1 00:00:00 1970 From: Goldwyn Rodrigues Date: Wed, 26 Feb 2014 07:01:38 -0600 Subject: [Ocfs2-devel] [PATCH] Add dlm_recover_callback_support in sysfs In-Reply-To: <20140225122104.41fcc13a1debd979201c71a9@linux-foundation.org> References: <20140225152839.GA3714@shrek.hsd1.tn.comcast.net> <20140225122104.41fcc13a1debd979201c71a9@linux-foundation.org> Message-ID: <530DE5B2.1010301@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ocfs2-devel@oss.oracle.com On 02/25/2014 02:21 PM, Andrew Morton wrote: > On Tue, 25 Feb 2014 09:28:44 -0600 Goldwyn Rodrigues 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