Esempio n. 1
0
/*
 * Handlers for polling a FAF open file.
 * @author Louis Rilling
 */
static void faf_poll_notify_node(kerrighed_node_t node, unsigned long dvfs_id)
{
	int err;

	err = rpc_async(RPC_FAF_POLL_NOTIFY, node, &dvfs_id, sizeof(dvfs_id));
	if (err)
		printk(KERN_WARNING "faf_poll_notify_node: "
		       "failed to notify node %d for %lu\n",
		       node, dvfs_id);
}
Esempio n. 2
0
static void rpc_worker(struct work_struct *data)
{
	static unsigned long l = 0;
	krgnodemask_t n;
	int r;

	r = 0;
	l++;
	
	krgnodes_clear(n);
	krgnode_set(0, n);

	r = rpc_async(RPC_PINGPONG, 0, &l, sizeof(l));
	if(r<0)
		return;
	
}
Esempio n. 3
0
/** Check if we are closing the last FAF client file.
 *  @author Renaud Lottiaux
 *
 *  @param file         The file attached to the DVFS struct.
 *  @param dvfs_file    The DVFS file struct being put.
 */
void check_last_faf_client_close(struct file *file,
				 struct dvfs_file_struct *dvfs_file)
{
	faf_client_data_t *data;
	struct faf_notify_msg msg;

	if(!(file->f_flags & O_FAF_CLT))
		return;

	/* If DVFS count == 1, there is no more FAF clients, the last count
	 * being for the FAF server node. In this case, notify the FAF server
	 * to let it check if it should close the FAF file or not.
	 */
	if (dvfs_file->count == 1) {
		data = file->private_data;
		msg.server_fd = data->server_fd;
		msg.objid = file->f_objid;

		rpc_async(RPC_FAF_NOTIFY_CLOSE, data->server_id,
			  &msg, sizeof(msg));
	}

	free_faf_file_private_data(file);
}
Esempio n. 4
0
void local_add_done(struct rpc_desc *desc)
{
	rpc_async(NODE_ADD_ACK, desc->comm, rpc_desc_get_client(desc), NULL, 0);
}
Esempio n. 5
0
static int do_nodes_add(struct hotplug_context *ctx)
{
	struct rpc_communicator *comm;
	char *page;
	kerrighed_node_t node;
	int ret;

	ret = hotplug_start_request(ctx);
	if (ret)
		goto out;

	mutex_lock(&hotplug_mutex);

	ret = check_add_req(ctx);
	if (ret)
		goto out_finish;

	ret = -ENOMEM;
	page = (char *)__get_free_page(GFP_KERNEL);
	if (!page)
		goto out_finish;

	ret = krgnodelist_scnprintf(page, PAGE_SIZE, ctx->node_set.v);
	BUG_ON(ret >= PAGE_SIZE);
	printk("kerrighed: [ADD] Adding nodes %s ...\n", page);

	free_page((unsigned long)page);

	comm = ctx->ns->rpc_comm;
	ret = rpc_connect_mask(comm, &ctx->node_set.v);
	if (ret)
		goto out_finish;

	atomic_set(&nr_to_wait,
		   num_online_krgnodes() + krgnodes_weight(ctx->node_set.v));

	/*
	 * Send request to all new members
	 * Current limitation: only not-started nodes can be added to a
	 * running cluster (ie: a node can't move from a subcluster to another one)
	 */
	ret = do_cluster_start(ctx);
	if (ret)
		goto err_close;

	/* Send request to all members of the current cluster */
	for_each_online_krgnode(node)
		rpc_async(NODE_ADD, comm, node,
			  &ctx->node_set, sizeof(ctx->node_set));

	wait_event(all_added_wqh, atomic_read(&nr_to_wait) == 0);
	printk("kerrighed: [ADD] Adding nodes succeeded.\n");

out_finish:
	mutex_unlock(&hotplug_mutex);
	hotplug_finish_request(ctx);
out:
	if (ret)
		printk(KERN_ERR "kerrighed: [ADD] Adding nodes failed! err=%d\n",
		       ret);
	return ret;

err_close:
	rpc_close_mask(comm, &ctx->node_set.v);
	goto out_finish;
}