/* Match the requested auth flavors with the list returned by the server. Returns zero and sets the mount's authentication flavor on success; returns -EACCES if server does not support the requested flavor.  */
static int nfs_walk_authlist(struct nfs_parsed_mount_data *args, struct nfs_mount_request *request)
/* Match the requested auth flavors with the list returned by the server. Returns zero and sets the mount's authentication flavor on success; returns -EACCES if server does not support the requested flavor.  */
static int nfs_walk_authlist(struct nfs_parsed_mount_data *args, struct nfs_mount_request *request)
{
	unsigned int i, j, server_authlist_len = *(request->auth_flav_len);
	if (server_authlist_len == 0)
		return 0;
	for (i = 0; i < args->auth_flavor_len; i++)
		for (j = 0; j < server_authlist_len; j++)
			if (args->auth_flavors[i] == request->auth_flavs[j]) {
				dfprintk(MOUNT, "NFS: using auth flavor %d\n",
					request->auth_flavs[j]);
				args->auth_flavors[0] = request->auth_flavs[j];
				return 0;
			}
	dfprintk(MOUNT, "NFS: server does not support requested auth flavor\n");
	nfs_umount(request);
	return -EACCES;
}