summaryrefslogtreecommitdiff
path: root/fs/afs/fs_probe.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-04-25 16:26:50 +0300
committerDavid Howells <dhowells@redhat.com>2019-04-25 16:26:50 +0300
commit0b9bf3812ad1f0d937584e300826285694f53e2b (patch)
tree9c92ffe7329d7a563c182b8c4b7beb776683888c /fs/afs/fs_probe.c
parentcd8dead0c39457e58ec1d36db93aedca811d48f1 (diff)
downloadlinux-0b9bf3812ad1f0d937584e300826285694f53e2b.tar.xz
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 <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/fs_probe.c')
-rw-r--r--fs/afs/fs_probe.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/afs/fs_probe.c b/fs/afs/fs_probe.c
index 3a9eaec06756..5d3abde52a0f 100644
--- a/fs/afs/fs_probe.c
+++ b/fs/afs/fs_probe.c
@@ -141,8 +141,8 @@ static int afs_do_probe_fileserver(struct afs_net *net,
struct afs_addr_cursor ac = {
.index = 0,
};
+ struct afs_call *call;
bool in_progress = false;
- int err;
_enter("%pU", &server->uuid);
@@ -156,12 +156,13 @@ static int afs_do_probe_fileserver(struct afs_net *net,
server->probe.rtt = UINT_MAX;
for (ac.index = 0; ac.index < ac.alist->nr_addrs; ac.index++) {
- err = afs_fs_get_capabilities(net, server, &ac, key, server_index,
- true);
- if (err == -EINPROGRESS)
+ call = afs_fs_get_capabilities(net, server, &ac, key, 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)