Esempio n. 1
0
static int hook_bind(struct fid *fid, struct fid *bfid, uint64_t flags)
{
	struct fid *hfid, *hbfid;

	hfid = hook_to_hfid(fid);
	hbfid = hook_to_hfid(bfid);
	if (!hfid || !hbfid)
		return -FI_EINVAL;

	return hfid->ops->bind(hfid, hbfid, flags);
}
Esempio n. 2
0
static int hook_control(struct fid *fid, int command, void *arg)
{
	struct fid *hfid;

	hfid = hook_to_hfid(fid);
	if (!hfid)
		return -FI_EINVAL;

	return hfid->ops->control(hfid, command, arg);
}
Esempio n. 3
0
static int hook_ops_open(struct fid *fid, const char *name,
			 uint64_t flags, void **ops, void *context)
{
	struct fid *hfid;

	hfid = hook_to_hfid(fid);
	if (!hfid)
		return -FI_EINVAL;

	return hfid->ops->ops_open(hfid, name, flags, ops, context);
}
Esempio n. 4
0
static int hook_close(struct fid *fid)
{
	struct fid *hfid;
	int ret;

	hfid = hook_to_hfid(fid);
	if (!hfid)
		return -FI_EINVAL;

	ret = hfid->ops->close(hfid);
	if (!ret)
		free(fid);
	return ret;
}
Esempio n. 5
0
static int hook_getname(fid_t fid, void *addr, size_t *addrlen)
{
	return fi_getname(hook_to_hfid(fid), addr, addrlen);
}