[openib-general] [PATCH v2] sa_query: require SA query registration

Sean Hefty sean.hefty at intel.com
Thu Aug 10 11:10:57 PDT 2006


>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




More information about the general mailing list