Skip to content

Commit e487f13

Browse files
metze-sambasmfrench
authored andcommitted
smb: smbdirect: introduce smbdirect_mr_io.{kref,mutex} and SMBDIRECT_MR_DISABLED
This will be used in the next commits in order to improve the client code. A broken connection can just disable the smbdirect_mr_io while keeping the memory arround for the caller. Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: 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>
1 parent 911063b commit e487f13

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

fs/smb/common/smbdirect/smbdirect_socket.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,13 +437,22 @@ enum smbdirect_mr_state {
437437
SMBDIRECT_MR_READY,
438438
SMBDIRECT_MR_REGISTERED,
439439
SMBDIRECT_MR_INVALIDATED,
440-
SMBDIRECT_MR_ERROR
440+
SMBDIRECT_MR_ERROR,
441+
SMBDIRECT_MR_DISABLED
441442
};
442443

443444
struct smbdirect_mr_io {
444445
struct smbdirect_socket *socket;
445446
struct ib_cqe cqe;
446447

448+
/*
449+
* We can have up to two references:
450+
* 1. by the connection
451+
* 2. by the registration
452+
*/
453+
struct kref kref;
454+
struct mutex mutex;
455+
447456
struct list_head list;
448457

449458
enum smbdirect_mr_state state;

0 commit comments

Comments
 (0)