From 0b9bf3812ad1f0d937584e300826285694f53e2b Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 25 Apr 2019 14:26:50 +0100 Subject: afs: Split wait from afs_make_call() Split the call to afs_wait_for_call_to_complete() from afs_make_call() to make it easier to handle asynchronous calls and to make it easier to convert a synchronous call to an asynchronous one in future, for instance when someone tries to interrupt an operation by pressing Ctrl-C. Signed-off-by: David Howells --- fs/afs/vl_probe.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'fs/afs/vl_probe.c') diff --git a/fs/afs/vl_probe.c b/fs/afs/vl_probe.c index f402ee8171a1..b05e0de04f42 100644 --- a/fs/afs/vl_probe.c +++ b/fs/afs/vl_probe.c @@ -141,8 +141,8 @@ static bool afs_do_probe_vlserver(struct afs_net *net, struct afs_addr_cursor ac = { .index = 0, }; + struct afs_call *call; bool in_progress = false; - int err; _enter("%s", server->name); @@ -156,12 +156,14 @@ static bool afs_do_probe_vlserver(struct afs_net *net, server->probe.rtt = UINT_MAX; for (ac.index = 0; ac.index < ac.alist->nr_addrs; ac.index++) { - err = afs_vl_get_capabilities(net, &ac, key, server, - server_index, true); - if (err == -EINPROGRESS) + call = afs_vl_get_capabilities(net, &ac, key, server, + server_index); + if (!IS_ERR(call)) { + afs_put_call(call); in_progress = true; - else - afs_prioritise_error(_e, err, ac.abort_code); + } else { + afs_prioritise_error(_e, PTR_ERR(call), ac.abort_code); + } } if (!in_progress) -- cgit v1.2.1