Skip to content

Commit

Permalink
IB/uverbs: Remove struct uverbs_root_spec and all supporting code
Browse files Browse the repository at this point in the history
Everything now uses the uverbs_uapi data structure.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Jason Gunthorpe committed Aug 13, 2018
1 parent 3a86357 commit 51d0a2b
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 833 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ib_ucm-y := ucm.o

ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_marshall.o \
rdma_core.o uverbs_std_types.o uverbs_ioctl.o \
uverbs_ioctl_merge.o uverbs_std_types_cq.o \
uverbs_std_types_cq.o \
uverbs_std_types_flow_action.o uverbs_std_types_dm.o \
uverbs_std_types_mr.o uverbs_std_types_counters.o \
uverbs_uapi.o
45 changes: 0 additions & 45 deletions drivers/infiniband/core/rdma_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,51 +42,6 @@
#include "core_priv.h"
#include "rdma_core.h"

int uverbs_ns_idx(u16 *id, unsigned int ns_count)
{
int ret = (*id & UVERBS_ID_NS_MASK) >> UVERBS_ID_NS_SHIFT;

if (ret >= ns_count)
return -EINVAL;

*id &= ~UVERBS_ID_NS_MASK;
return ret;
}

const struct uverbs_object_spec *uverbs_get_object(struct ib_uverbs_file *ufile,
uint16_t object)
{
const struct uverbs_root_spec *object_hash = ufile->device->specs_root;
const struct uverbs_object_spec_hash *objects;
int ret = uverbs_ns_idx(&object, object_hash->num_buckets);

if (ret < 0)
return NULL;

objects = object_hash->object_buckets[ret];

if (object >= objects->num_objects)
return NULL;

return objects->objects[object];
}

const struct uverbs_method_spec *uverbs_get_method(const struct uverbs_object_spec *object,
uint16_t method)
{
const struct uverbs_method_spec_hash *methods;
int ret = uverbs_ns_idx(&method, object->num_buckets);

if (ret < 0)
return NULL;

methods = object->method_buckets[ret];
if (method >= methods->num_methods)
return NULL;

return methods->methods[method];
}

void uverbs_uobject_get(struct ib_uobject *uobject)
{
kref_get(&uobject->ref);
Expand Down
6 changes: 0 additions & 6 deletions drivers/infiniband/core/rdma_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@

struct ib_uverbs_device;

int uverbs_ns_idx(u16 *id, unsigned int ns_count);
const struct uverbs_object_spec *uverbs_get_object(struct ib_uverbs_file *ufile,
uint16_t object);
const struct uverbs_method_spec *uverbs_get_method(const struct uverbs_object_spec *object,
uint16_t method);

void uverbs_destroy_ufile_hw(struct ib_uverbs_file *ufile,
enum rdma_remove_reason reason);

Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/core/uverbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ struct ib_uverbs_device {
struct mutex lists_mutex; /* protect lists */
struct list_head uverbs_file_list;
struct list_head uverbs_events_file_list;
struct uverbs_root_spec *specs_root;
struct uverbs_api *uapi;
};

Expand Down
Loading

0 comments on commit 51d0a2b

Please sign in to comment.