diff options
author | David Howells <dhowells@redhat.com> | 2023-10-30 08:25:44 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2024-01-01 16:37:27 +0000 |
commit | d14cf8edd30678b5d1e3671466d458bf72a53e86 (patch) | |
tree | a97761eaadaf322290934a18ac4e93ce1a4129f8 /fs/afs/internal.h | |
parent | f94f70d39cc2d54079ebae934862198516315db2 (diff) | |
download | linux-stable-d14cf8edd30678b5d1e3671466d458bf72a53e86.tar.gz linux-stable-d14cf8edd30678b5d1e3671466d458bf72a53e86.tar.bz2 linux-stable-d14cf8edd30678b5d1e3671466d458bf72a53e86.zip |
afs: Mark address lists with configured priorities
Add a field to each address in an address list (afs_addr_list struct) that
records the current priority for that address according to the address
preference table. We don't want to do this every time we use an address
list, so the version number of the address preference table is recorded in
the address list too and we only re-mark the list when we see the version
change.
These numbers are then displayed through /proc/net/afs/servers.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r-- | fs/afs/internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 4445c734cdcd..9a1e151e77e7 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -97,6 +97,7 @@ struct afs_addr_preference_list { struct afs_address { struct rxrpc_peer *peer; short last_error; /* Last error from this address */ + u16 prio; /* Address priority */ }; /* @@ -107,6 +108,7 @@ struct afs_addr_list { refcount_t usage; u32 version; /* Version */ unsigned int debug_id; + unsigned int addr_pref_version; /* Version of address preference list */ unsigned char max_addrs; unsigned char nr_addrs; unsigned char preferred; /* Preferred address */ @@ -1010,6 +1012,8 @@ extern int afs_merge_fs_addr6(struct afs_net *net, struct afs_addr_list *addr, * addr_prefs.c */ int afs_proc_addr_prefs_write(struct file *file, char *buf, size_t size); +void afs_get_address_preferences_rcu(struct afs_net *net, struct afs_addr_list *alist); +void afs_get_address_preferences(struct afs_net *net, struct afs_addr_list *alist); /* * callback.c |