+/**
+ * Set a fileset on a nodemap.
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string, "<fileset>"
+ * \param[in] count \a buffer length
+ * \param[in] off unused
+ * \retval \a count on success
+ * \retval negative number on error
+ */
+static ssize_t
+nodemap_fileset_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
+{
+ struct seq_file *m = file->private_data;
+ char *nm_fileset;
+ int rc = 0;
+ ENTRY;
+
+ if (count == 0)
+ RETURN(0);
+
+ if (count > PATH_MAX)
+ RETURN(-EINVAL);
+
+ OBD_ALLOC(nm_fileset, count + 1);
+ /* OBD_ALLOC zero-fills the buffer */
+ if (nm_fileset == NULL)
+ RETURN(-ENOMEM);
+
+ if (copy_from_user(nm_fileset, buffer, count))
+ GOTO(out, rc = -EFAULT);
+
+ rc = nodemap_set_fileset(m->private, nm_fileset);
+ if (rc != 0)
+ GOTO(out, rc = -EINVAL);
+
+ rc = count;
+out:
+ OBD_FREE(nm_fileset, count + 1);
+
+ return rc;