.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* AFS client file system |
---|
2 | 3 | * |
---|
3 | 4 | * Copyright (C) 2002,5 Red Hat, Inc. All Rights Reserved. |
---|
4 | 5 | * Written by David Howells (dhowells@redhat.com) |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public License |
---|
8 | | - * as published by the Free Software Foundation; either version |
---|
9 | | - * 2 of the License, or (at your option) any later version. |
---|
10 | 6 | */ |
---|
11 | 7 | |
---|
12 | 8 | #include <linux/module.h> |
---|
.. | .. |
---|
22 | 18 | MODULE_DESCRIPTION("AFS Client File System"); |
---|
23 | 19 | MODULE_AUTHOR("Red Hat, Inc."); |
---|
24 | 20 | MODULE_LICENSE("GPL"); |
---|
| 21 | +MODULE_IMPORT_NS(ANDROID_GKI_VFS_EXPORT_ONLY); |
---|
25 | 22 | |
---|
26 | 23 | unsigned afs_debug; |
---|
27 | 24 | module_param_named(debug, afs_debug, uint, S_IWUSR | S_IRUGO); |
---|
.. | .. |
---|
82 | 79 | mutex_init(&net->socket_mutex); |
---|
83 | 80 | |
---|
84 | 81 | net->cells = RB_ROOT; |
---|
85 | | - seqlock_init(&net->cells_lock); |
---|
| 82 | + init_rwsem(&net->cells_lock); |
---|
86 | 83 | INIT_WORK(&net->cells_manager, afs_manage_cells); |
---|
87 | 84 | timer_setup(&net->cells_timer, afs_cells_timer, 0); |
---|
88 | 85 | |
---|
| 86 | + mutex_init(&net->cells_alias_lock); |
---|
89 | 87 | mutex_init(&net->proc_cells_lock); |
---|
90 | 88 | INIT_HLIST_HEAD(&net->proc_cells); |
---|
91 | 89 | |
---|
92 | 90 | seqlock_init(&net->fs_lock); |
---|
93 | 91 | net->fs_servers = RB_ROOT; |
---|
94 | | - INIT_LIST_HEAD(&net->fs_updates); |
---|
| 92 | + INIT_LIST_HEAD(&net->fs_probe_fast); |
---|
| 93 | + INIT_LIST_HEAD(&net->fs_probe_slow); |
---|
95 | 94 | INIT_HLIST_HEAD(&net->fs_proc); |
---|
96 | 95 | |
---|
97 | 96 | INIT_HLIST_HEAD(&net->fs_addresses4); |
---|
.. | .. |
---|
100 | 99 | |
---|
101 | 100 | INIT_WORK(&net->fs_manager, afs_manage_servers); |
---|
102 | 101 | timer_setup(&net->fs_timer, afs_servers_timer, 0); |
---|
| 102 | + INIT_WORK(&net->fs_prober, afs_fs_probe_dispatcher); |
---|
| 103 | + timer_setup(&net->fs_probe_timer, afs_fs_probe_timer, 0); |
---|
| 104 | + atomic_set(&net->servers_outstanding, 1); |
---|
103 | 105 | |
---|
104 | 106 | ret = -ENOMEM; |
---|
105 | 107 | sysnames = kzalloc(sizeof(*sysnames), GFP_KERNEL); |
---|
.. | .. |
---|
130 | 132 | |
---|
131 | 133 | error_open_socket: |
---|
132 | 134 | net->live = false; |
---|
| 135 | + afs_fs_probe_cleanup(net); |
---|
133 | 136 | afs_cell_purge(net); |
---|
134 | 137 | afs_purge_servers(net); |
---|
135 | 138 | error_cell_init: |
---|
.. | .. |
---|
150 | 153 | struct afs_net *net = afs_net(net_ns); |
---|
151 | 154 | |
---|
152 | 155 | net->live = false; |
---|
| 156 | + afs_fs_probe_cleanup(net); |
---|
153 | 157 | afs_cell_purge(net); |
---|
154 | 158 | afs_purge_servers(net); |
---|
155 | 159 | afs_close_socket(net); |
---|