+/**
+ * Set the nmf_readonly_mount flag to true or false.
+ * \param name nodemap name
+ * \param readonly_mount if true, forbid rw mount
+ * \retval 0 on success
+ *
+ */
+int nodemap_set_readonly_mount(const char *name, bool readonly_mount)
+{
+ struct lu_nodemap *nodemap = NULL;
+ int rc = 0;
+
+ mutex_lock(&active_config_lock);
+ nodemap = nodemap_lookup(name);
+ mutex_unlock(&active_config_lock);
+ if (IS_ERR(nodemap))
+ GOTO(out, rc = PTR_ERR(nodemap));
+
+ nodemap->nmf_readonly_mount = readonly_mount;
+ rc = nodemap_idx_nodemap_update(nodemap);
+
+ nm_member_revoke_locks(nodemap);
+ nodemap_putref(nodemap);
+out:
+ return rc;
+}
+EXPORT_SYMBOL(nodemap_set_readonly_mount);