Skip to content

Commit ed3350f

Browse files
metze-sambasmfrench
authored andcommitted
smb: smbdirect: introduce smbdirect_socket.mr_io.*
This will be used by the client and will allow us to move to common code... Cc: Steve French <[email protected]> Cc: Tom Talpey <[email protected]> Cc: Long Li <[email protected]> Acked-by: Namjae Jeon <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Stefan Metzmacher <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 41e5086 commit ed3350f

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

fs/smb/common/smbdirect/smbdirect_socket.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,44 @@ struct smbdirect_socket {
206206
} reassembly;
207207
} recv_io;
208208

209+
/*
210+
* The state for Memory registrations on the client
211+
*/
212+
struct {
213+
enum ib_mr_type type;
214+
215+
/*
216+
* The list of free smbdirect_mr_io
217+
* structures
218+
*/
219+
struct {
220+
struct list_head list;
221+
spinlock_t lock;
222+
} all;
223+
224+
/*
225+
* The number of available MRs ready for memory registration
226+
*/
227+
struct {
228+
atomic_t count;
229+
wait_queue_head_t wait_queue;
230+
} ready;
231+
232+
/*
233+
* The number of used MRs
234+
*/
235+
struct {
236+
atomic_t count;
237+
} used;
238+
239+
struct work_struct recovery_work;
240+
241+
/* Used by transport to wait until all MRs are returned */
242+
struct {
243+
wait_queue_head_t wait_queue;
244+
} cleanup;
245+
} mr_io;
246+
209247
/*
210248
* The state for RDMA read/write requests on the server
211249
*/
@@ -269,6 +307,13 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
269307

270308
atomic_set(&sc->rw_io.credits.count, 0);
271309
init_waitqueue_head(&sc->rw_io.credits.wait_queue);
310+
311+
spin_lock_init(&sc->mr_io.all.lock);
312+
INIT_LIST_HEAD(&sc->mr_io.all.list);
313+
atomic_set(&sc->mr_io.ready.count, 0);
314+
init_waitqueue_head(&sc->mr_io.ready.wait_queue);
315+
atomic_set(&sc->mr_io.used.count, 0);
316+
init_waitqueue_head(&sc->mr_io.cleanup.wait_queue);
272317
}
273318

274319
struct smbdirect_send_io {

0 commit comments

Comments
 (0)