Skip to contentSkip to conversation

nfs4.1: add BIND_CONN_TO_SESSION operation

PATCH In review Weston Andros Adamson 2 participants 2 messages May 24, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 nfs4.1: add BIND_CONN_TO_SESSION operation

This patch adds the BIND_CONN_TO_SESSION operation which is needed for upcoming SP4_MACH_CRED work and useful for recovering from broken connections without destroying the session.

---
Reposted with changes addressing Chuck's comments.

 fs/nfs/nfs4_fs.h        |    1 +
 fs/nfs/nfs4proc.c       |   54 ++++++++++++++++++++++++++
 fs/nfs/nfs4xdr.c        |   95 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/nfs4.h    |    5 ++
 include/linux/nfs_xdr.h |    6 +++
 5 files changed, 161 insertions(+), 0 deletions(-)
fs/nfs/nfs4_fs.h +1 -0
index edeef71..ad90bc7 100644
@@ -215,6 +215,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
 extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, struct rpc_cred *, struct nfs4_setclientid_res *);
 extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct nfs4_setclientid_res *arg, struct rpc_cred *);
 extern int nfs4_proc_get_rootfh(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *);
+extern int nfs4_proc_bind_conn_to_session(struct nfs_client *);
 extern int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred);
 extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *);
 extern int nfs41_init_clientid(struct nfs_client *, struct rpc_cred *);
fs/nfs/nfs4proc.c +54 -0

60 lines not on this page · raw message

fs/nfs/nfs4xdr.c +95 -0

137 lines not on this page · raw message

include/linux/nfs4.h +5 -0
index 0987146..5b1a504 100644
@@ -69,6 +69,10 @@
 #define NFS4_CDFC4_FORE_OR_BOTH 0x3
 #define NFS4_CDFC4_BACK_OR_BOTH 0x7
 
+#define NFS4_CDFS4_FORE 0x1
+#define NFS4_CDFS4_BACK 0x2
+#define NFS4_CDFS4_BOTH 0x3
+
 #define NFS4_SET_TO_SERVER_TIME	0
 #define NFS4_SET_TO_CLIENT_TIME	1
 
@@ -582,6 +586,7 @@ enum {
 	NFSPROC4_CLNT_SECINFO,
 
 	/* nfs41 */
+	NFSPROC4_CLNT_BIND_CONN_TO_SESSION,
 	NFSPROC4_CLNT_EXCHANGE_ID,
 	NFSPROC4_CLNT_CREATE_SESSION,
 	NFSPROC4_CLNT_DESTROY_SESSION,
include/linux/nfs_xdr.h +6 -0
index 2e53a3f..aa2a3bb 100644
@@ -1115,6 +1115,12 @@ struct nfs41_impl_id {
 	struct nfstime4			date;
 };
 
+struct nfs41_bind_conn_to_session_res {
+	struct nfs4_session		*session;
+	u32				dir;
+	bool				use_conn_in_rdma_mode;
+};
+
 struct nfs41_exchange_id_res {
 	struct nfs_client		*client;
 	u32				flags;
Signature · 1 line
1.7.4.4
#1 lore raw

T24gVGh1LCAyMDEyLTA1LTI0IGF0IDEzOjIyIC0wNDAwLCBXZXN0b24gQW5kcm9zIEFkYW1zb24g d3JvdGU6DQo+IFRoaXMgcGF0Y2ggYWRkcyB0aGUgQklORF9DT05OX1RPX1NFU1NJT04gb3BlcmF0 aW9uIHdoaWNoIGlzIG5lZWRlZCBmb3INCj4gdXBjb21pbmcgU1A0X01BQ0hfQ1JFRCB3b3JrIGFu ZCB1c2VmdWwgZm9yIHJlY292ZXJpbmcgZnJvbSBicm9rZW4gY29ubmVjdGlvbnMNCj4gd2l0aG91 dCBkZXN0cm95aW5nIHRoZSBzZXNzaW9uLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogV2VzdG9uIEFu ZHJvcyBBZGFtc29uIDxkcm9zQG5ldGFwcC5jb20+DQo+IC0tLQ0KPiBSZXBvc3RlZCB3aXRoIGNo YW5nZXMgYWRkcmVzc2luZyBDaHVjaydzIGNvbW1lbnRzLg0KPiANCg0KQ29tbWl0dGVkIGFmdGVy IGNoYW5naW5nIHRoZSBhbGxvY2F0aW9uIG1vZGUgdG8gR0ZQX05PRlMuIEdGUF9LRVJORUwNCmFs bG9jYXRpb25zIG1heSBlbmQgdXAgZGVhZGxvY2tpbmcgaW4gYSByZWNvdmVyeSBzaXR1YXRpb24g aWYgdGhleQ0KcmVzdWx0IGluIGFuIGF0dGVtcHQgdG8gd3JpdGUgYmFjayBkaXJ0eSBORlMgcGFn ZXMuDQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xpZW50IG1haW50YWluZXIN Cg0KTmV0QXBwDQpUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbQ0Kd3d3Lm5ldGFwcC5jb20NCg0K