FreeBSD/sys/ofed/drivers/infiniband/core/peer_mem.c
/* This code uses the sysfs which is not supporeted by the FreeBSD.
 * Will be added in future to the sysctl */
This code uses the sysfs which is not supporeted by the FreeBSD.
Will be added in future to the sysctl
This code uses the sysfs which is not supporeted by the FreeBSD . Will be added in future to the sysctl
static int create_peer_sysfs(struct ib_peer_memory_client *ib_peer_client)
{
	int ret;
	if (!num_registered_peers) {
		peers_kobj = kobject_create_and_add("memory_peers", mm_kobj);
		if (!peers_kobj)
			return -ENOMEM;
	}
	ib_peer_client->peer_mem_attr_group.attrs = peer_mem_attrs;
	ib_peer_client->peer_mem_attr_group.name =  NULL;
	ib_peer_client->kobj = kobject_create_and_add(ib_peer_client->peer_mem->name,
		peers_kobj);
	if (!ib_peer_client->kobj) {
		ret = -EINVAL;
		goto free;
	}
	ret = sysfs_create_group(ib_peer_client->kobj,
				&ib_peer_client->peer_mem_attr_group);
	if (ret)
		goto peer_free;
	return 0;
peer_free:
	kobject_put(ib_peer_client->kobj);
free:
	if (!num_registered_peers)
		kobject_put(peers_kobj);
	return ret;
}
static int create_peer_sysfs ( struct ib_peer_memory_client * ib_peer_client ) { int ret ; if ( ! num_registered_peers ) { peers_kobj = kobject_create_and_add ( " " , mm_kobj ) ; if ( ! peers_kobj ) return - ENOMEM ; } ib_peer_client -> peer_mem_attr_group . attrs = peer_mem_attrs ; ib_peer_client -> peer_mem_attr_group . name = NULL ; ib_peer_client -> kobj = kobject_create_and_add ( ib_peer_client -> peer_mem -> name , peers_kobj ) ; if ( ! ib_peer_client -> kobj ) { ret = - EINVAL ; goto free ; } ret = sysfs_create_group ( ib_peer_client -> kobj , & ib_peer_client -> peer_mem_attr_group ) ; if ( ret ) goto peer_free ; return 0 ; peer_free : kobject_put ( ib_peer_client -> kobj ) ; free : if ( ! num_registered_peers ) kobject_put ( peers_kobj ) ; return ret ; }
This code uses the sysfs which is not supporeted by the FreeBSD.
This code uses the sysfs which is not supporeted by the FreeBSD .
/* creating under /sys/kernel/mm */ /* Dir alreday was created explicitly to get its kernel object for further usage */ /* Create the files associated with this kobject */