Beispiel #1
0
static ssize_t lprocfs_elc_seq_write(struct file *file, const char *buffer,
				 size_t count, loff_t *off)
{
	struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
	unsigned int supp = -1;
	int rc;

	rc = lprocfs_wr_uint(file, buffer, count, &supp);
	if (rc < 0)
		return rc;

	if (supp == 0)
		ns->ns_connect_flags &= ~OBD_CONNECT_CANCELSET;
	else if (ns->ns_orig_connect_flags & OBD_CONNECT_CANCELSET)
		ns->ns_connect_flags |= OBD_CONNECT_CANCELSET;
	return count;
}
static int lprocfs_wr_elc(struct file *file, const char *buffer,
			       unsigned long count, void *data)
{
	struct ldlm_namespace *ns = data;
	unsigned int supp = -1;
	int rc;

	rc = lprocfs_wr_uint(file, buffer, count, &supp);
	if (rc < 0)
		return rc;

	if (supp == 0)
		ns->ns_connect_flags &= ~OBD_CONNECT_CANCELSET;
	else if (ns->ns_orig_connect_flags & OBD_CONNECT_CANCELSET)
		ns->ns_connect_flags |= OBD_CONNECT_CANCELSET;
	return count;
}