mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 20:22:08 +02:00
smb: smbdirect: introduce smbdirect_socket_init()
This will make it easier to keep the initialization in a single place. For now it's an __always_inline function as we only share the header files. Once move to common functions we'll have a dedicated smbdirect.ko that exports functions... Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
371d3ab51c
commit
17e1d07430
|
|
@ -136,6 +136,24 @@ struct smbdirect_socket {
|
|||
} recv_io;
|
||||
};
|
||||
|
||||
static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
|
||||
{
|
||||
/*
|
||||
* This also sets status = SMBDIRECT_SOCKET_CREATED
|
||||
*/
|
||||
BUILD_BUG_ON(SMBDIRECT_SOCKET_CREATED != 0);
|
||||
memset(sc, 0, sizeof(*sc));
|
||||
|
||||
init_waitqueue_head(&sc->status_wait);
|
||||
|
||||
INIT_LIST_HEAD(&sc->recv_io.free.list);
|
||||
spin_lock_init(&sc->recv_io.free.lock);
|
||||
|
||||
INIT_LIST_HEAD(&sc->recv_io.reassembly.list);
|
||||
spin_lock_init(&sc->recv_io.reassembly.lock);
|
||||
init_waitqueue_head(&sc->recv_io.reassembly.wait_queue);
|
||||
}
|
||||
|
||||
struct smbdirect_send_io {
|
||||
struct smbdirect_socket *socket;
|
||||
struct ib_cqe cqe;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user