>I think I agree with Michael that having ib_sa_register_client()
>allocate the structure is going to far in the name of encapsulation.
>How about making the structure public, but providing a macro
>DEFINE_IB_SA_CLIENT() to wrap up the initialization?  (Similar to
>DEFINE_MUTEX, DEFINE_IDR, etc)

Currently what I have is:

struct ib_sa_client {
        atomic_t users;
        struct completion comp;
};

I tried not to change it too much from what Michael had, but I haven't added
canceling of requests yet either.  Canceling requests isn't strictly needed; we
just end up waiting longer for deregister to complete.  But doing so should only
add a list_head to the structure.  So, yes, I can move the definition back to
being public.

>If we want to allow for dynamic allocation of clients, then we can
>have a ib_sa_init_client(struct ib_sa_client *client) function, but I
>don't see a need for that right now.

I do use dynamic allocation for userspace support.

- Sean

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to