[5/5] NFS: Combine nfs4_call_sync() with nfs4_call_sync_sequence()
diff mbox

Message ID 20180504202252.5862-6-Anna.Schumaker@Netapp.com
State New
Headers show

Commit Message

Anna Schumaker May 4, 2018, 8:22 p.m. UTC
From: Anna Schumaker <Anna.Schumaker@Netapp.com>

The nfs4_call_sync_sequence() version only hase a single user,
nfs4_call_sync(), so let's just add in a call to nfs4_init_sequence()
instead of needing to have another function just to do this.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 fs/nfs/nfs4proc.c | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

Comments

Trond Myklebust May 29, 2018, 1:45 p.m. UTC | #1
T24gRnJpLCAyMDE4LTA1LTA0IGF0IDE2OjIyIC0wNDAwLCBzY2h1bWFrZXIuYW5uYUBnbWFpbC5j
b20gd3JvdGU6DQo+IEZyb206IEFubmEgU2NodW1ha2VyIDxBbm5hLlNjaHVtYWtlckBOZXRhcHAu
Y29tPg0KPiANCj4gVGhlIG5mczRfY2FsbF9zeW5jX3NlcXVlbmNlKCkgdmVyc2lvbiBvbmx5IGhh
c2UgYSBzaW5nbGUgdXNlciwNCj4gbmZzNF9jYWxsX3N5bmMoKSwgc28gbGV0J3MganVzdCBhZGQg
aW4gYSBjYWxsIHRvIG5mczRfaW5pdF9zZXF1ZW5jZSgpDQo+IGluc3RlYWQgb2YgbmVlZGluZyB0
byBoYXZlIGFub3RoZXIgZnVuY3Rpb24ganVzdCB0byBkbyB0aGlzLg0KPiANCj4gU2lnbmVkLW9m
Zi1ieTogQW5uYSBTY2h1bWFrZXIgPEFubmEuU2NodW1ha2VyQE5ldGFwcC5jb20+DQo+IC0tLQ0K
PiAgZnMvbmZzL25mczRwcm9jLmMgfCAyNSArKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tDQo+ICAx
IGZpbGUgY2hhbmdlZCwgOCBpbnNlcnRpb25zKCspLCAxNyBkZWxldGlvbnMoLSkNCj4gDQo+IGRp
ZmYgLS1naXQg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IFRoYXQn
cyBhbG1vc3QgZGVzZXJ2aW5nIG9mIGl0cyBvd24NCnN0cnVjdHVyZS4uLg0KDQpMZXQncyBub3Qg
Z28gZG93biB0aGlzIHBhdGguIEl0J3MgZWFzaWVyIHRvIGluaXRpYWxpc2UgdGhlIHNlcXVlbmNl
DQphcmdzL3JlcyBmaXJzdCwgYW5kIHRoYXQgaXMgcHJlY2lzZWx5IHdoeSBJIGNob3NlIHRvIGRv
IHRoaW5ncyB0aGUgd2F5DQp0aGV5IGFyZSB0b2RheS4NCg0KLS0gDQpUcm9uZCBNeWtsZWJ1c3QN
CkNUTywgSGFtbWVyc3BhY2UgSW5jDQo0MzAwIEVsIENhbWlubyBSZWFsLCBTdWl0ZSAxMDUNCkxv
cyBBbHRvcywgQ0EgOTQwMjINCnd3dy5oYW1tZXIuc3BhY2UgaWQ9Ii14LWV2by1zZWxlY3Rpb24t
ZW5kLW1hcmtlciI+
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 505f605dcac2..99d77f6e7e40 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -993,11 +993,13 @@  static const struct rpc_call_ops nfs40_call_sync_ops = {
 	.rpc_call_done = nfs40_call_sync_done,
 };
 
-static int nfs4_call_sync_sequence(struct rpc_clnt *clnt,
-				   struct nfs_server *server,
-				   struct rpc_message *msg,
-				   struct nfs4_sequence_args *args,
-				   struct nfs4_sequence_res *res)
+int nfs4_call_sync(struct rpc_clnt *clnt,
+		   struct nfs_server *server,
+		   struct rpc_message *msg,
+		   struct nfs4_sequence_args *args,
+		   struct nfs4_sequence_res *res,
+		   int cache_reply,
+		   int privileged)
 {
 	int ret;
 	struct rpc_task *task;
@@ -1014,6 +1016,7 @@  static int nfs4_call_sync_sequence(struct rpc_clnt *clnt,
 		.callback_data = &data
 	};
 
+	nfs4_init_sequence(args, res, cache_reply, privileged);
 	task = rpc_run_task(&task_setup);
 	if (IS_ERR(task))
 		ret = PTR_ERR(task);
@@ -1024,18 +1027,6 @@  static int nfs4_call_sync_sequence(struct rpc_clnt *clnt,
 	return ret;
 }
 
-int nfs4_call_sync(struct rpc_clnt *clnt,
-		   struct nfs_server *server,
-		   struct rpc_message *msg,
-		   struct nfs4_sequence_args *args,
-		   struct nfs4_sequence_res *res,
-		   int cache_reply,
-		   int privileged)
-{
-	nfs4_init_sequence(args, res, cache_reply, privileged);
-	return nfs4_call_sync_sequence(clnt, server, msg, args, res);
-}
-
 static void update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo,
 		unsigned long timestamp)
 {