[PATCH 3/3] afs: Rename fs_addresses list to fs_peers

Jeffrey E Altman jaltman at auristor.com
Fri Feb 16 12:43:05 PST 2024


On 2/16/2024 2:37 PM, Marc Dionne wrote:
> Rename the list to better reflect that it is now a list of peer
> pointers rather than addresses.
>
> Signed-off-by: Marc Dionne <marc.dionne at auristor.com>
> ---
>   fs/afs/internal.h |  6 +++---
>   fs/afs/main.c     |  4 ++--
>   fs/afs/server.c   | 20 ++++++++++----------
>   3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/fs/afs/internal.h b/fs/afs/internal.h
> index 6ce5a612937c..c8292494dd46 100644
> --- a/fs/afs/internal.h
> +++ b/fs/afs/internal.h
> @@ -321,8 +321,8 @@ struct afs_net {
>   	struct list_head	fs_probe_slow;	/* List of afs_server to probe at 5m intervals */
>   	struct hlist_head	fs_proc;	/* procfs servers list */
>   
> -	struct hlist_head	fs_addresses;	/* afs_server (by lowest IPv6 addr) */
> -	seqlock_t		fs_addr_lock;	/* For fs_addresses[46] */
> +	struct hlist_head	fs_peers;
> +	seqlock_t		fs_peers_lock;	/* For fs_peers */
>   
>   	struct work_struct	fs_manager;
>   	struct timer_list	fs_timer;
> @@ -560,7 +560,7 @@ struct afs_server {
>   	struct afs_server __rcu	*uuid_next;	/* Next server with same UUID */
>   	struct afs_server	*uuid_prev;	/* Previous server with same UUID */
>   	struct list_head	probe_link;	/* Link in net->fs_probe_list */
> -	struct hlist_node	addr_link;	/* Link in net->fs_addresses6 */
> +	struct hlist_node	peer_link;	/* Link in net->fs_peers */
>   	struct hlist_node	proc_link;	/* Link in net->fs_proc */
>   	struct list_head	volumes;	/* RCU list of afs_server_entry objects */
>   	struct afs_server	*gc_next;	/* Next server in manager's list */
> diff --git a/fs/afs/main.c b/fs/afs/main.c
> index a14f6013e316..b93222959235 100644
> --- a/fs/afs/main.c
> +++ b/fs/afs/main.c
> @@ -90,8 +90,8 @@ static int __net_init afs_net_init(struct net *net_ns)
>   	INIT_LIST_HEAD(&net->fs_probe_slow);
>   	INIT_HLIST_HEAD(&net->fs_proc);
>   
> -	INIT_HLIST_HEAD(&net->fs_addresses);
> -	seqlock_init(&net->fs_addr_lock);
> +	INIT_HLIST_HEAD(&net->fs_peers);
> +	seqlock_init(&net->fs_peers_lock);
>   
>   	INIT_WORK(&net->fs_manager, afs_manage_servers);
>   	timer_setup(&net->fs_timer, afs_servers_timer, 0);
> diff --git a/fs/afs/server.c b/fs/afs/server.c
> index 038f9d0ae3af..5a46402a6b90 100644
> --- a/fs/afs/server.c
> +++ b/fs/afs/server.c
> @@ -36,9 +36,9 @@ struct afs_server *afs_find_server(struct afs_net *net, const struct rxrpc_peer
>   			afs_unuse_server_notime(net, server, afs_server_trace_put_find_rsq);
>   		server = NULL;
>   		seq++; /* 2 on the 1st/lockless path, otherwise odd */
> -		read_seqbegin_or_lock(&net->fs_addr_lock, &seq);
> +		read_seqbegin_or_lock(&net->fs_peers_lock, &seq);
>   
> -		hlist_for_each_entry_rcu(server, &net->fs_addresses, addr_link) {
> +		hlist_for_each_entry_rcu(server, &net->fs_peers, peer_link) {
>   			estate = rcu_dereference(server->endpoint_state);
>   			alist = estate->addresses;
>   			for (i = 0; i < alist->nr_addrs; i++)
> @@ -51,9 +51,9 @@ struct afs_server *afs_find_server(struct afs_net *net, const struct rxrpc_peer
>   	found:
>   		server = afs_maybe_use_server(server, afs_server_trace_get_by_addr);
>   
> -	} while (need_seqretry(&net->fs_addr_lock, seq));
> +	} while (need_seqretry(&net->fs_peers_lock, seq));
>   
> -	done_seqretry(&net->fs_addr_lock, seq);
> +	done_seqretry(&net->fs_peers_lock, seq);
>   
>   	rcu_read_unlock();
>   	return server;
> @@ -164,9 +164,9 @@ static struct afs_server *afs_install_server(struct afs_cell *cell,
>   	hlist_add_head_rcu(&server->proc_link, &net->fs_proc);
>   
>   added_dup:
> -	write_seqlock(&net->fs_addr_lock);
> +	write_seqlock(&net->fs_peers_lock);
>   	estate = rcu_dereference_protected(server->endpoint_state,
> -					   lockdep_is_held(&net->fs_addr_lock.lock));
> +					   lockdep_is_held(&net->fs_peers_lock.lock));
>   	alist = estate->addresses;
>   
>   	/* Secondly, if the server has any IPv4 and/or IPv6 addresses, install
> @@ -178,9 +178,9 @@ static struct afs_server *afs_install_server(struct afs_cell *cell,
>   	 * intensive.
>   	 */
>   	if (alist->nr_addrs > 0)
> -		hlist_add_head_rcu(&server->addr_link, &net->fs_addresses);
> +		hlist_add_head_rcu(&server->peer_link, &net->fs_peers);
>   
> -	write_sequnlock(&net->fs_addr_lock);
> +	write_sequnlock(&net->fs_peers_lock);
>   
>   exists:
>   	afs_get_server(server, afs_server_trace_get_install);
> @@ -509,8 +509,8 @@ static void afs_gc_servers(struct afs_net *net, struct afs_server *gc_list)
>   
>   			list_del(&server->probe_link);
>   			hlist_del_rcu(&server->proc_link);
> -			if (!hlist_unhashed(&server->addr_link))
> -				hlist_del_rcu(&server->addr_link);
> +			if (!hlist_unhashed(&server->peer_link))
> +				hlist_del_rcu(&server->peer_link);
>   		}
>   		write_sequnlock(&net->fs_lock);
Reviewed-by: Jeffrey E Altman <jaltman at auristor.com>
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4039 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20240216/9ecea708/attachment-0001.p7s>


More information about the linux-afs mailing list