示例#1
0
static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size)
{
	char *mesg = buf;
	char *recdir;
	int len, status;

	if (size > 0) {
		if (nfsd_serv)
			return -EBUSY;
		if (size > PATH_MAX || buf[size-1] != '\n')
			return -EINVAL;
		buf[size-1] = 0;

		recdir = mesg;
		len = qword_get(&mesg, recdir, size);
		if (len <= 0)
			return -EINVAL;

		status = nfs4_reset_recoverydir(recdir);
		if (status)
			return status;
	}

	return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%s\n",
							nfs4_recoverydir());
}
示例#2
0
static ssize_t write_recoverydir(struct file *file, char *buf, size_t size)
{
	char *mesg = buf;
	char *recdir;
	int len, status;

	if (size > PATH_MAX || buf[size-1] != '\n')
		return -EINVAL;
	buf[size-1] = 0;

	recdir = mesg;
	len = qword_get(&mesg, recdir, size);
	if (len <= 0)
		return -EINVAL;

	status = nfs4_reset_recoverydir(recdir);
	return strlen(buf);
}