diff options
author | David Howells <dhowells@redhat.com> | 2018-10-04 09:32:27 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-10-04 09:32:27 +0100 |
commit | 68eb64c3d2fd558c606dcff6d3e8a2701388a80f (patch) | |
tree | 9d2f967c9ccd47dd73e2a730a1f6f1d020f6fe58 /fs/afs/internal.h | |
parent | b3cfb6f567be00450d33b68f743c066af017a012 (diff) | |
download | linux-68eb64c3d2fd558c606dcff6d3e8a2701388a80f.tar.bz2 |
afs: Do better max capacity handling on address lists
Note the maximum allocated capacity in an afs_addr_list struct and discard
addresses that would exceed it in afs_merge_fs_addr{4,6}().
Also, since the current maximum capacity is less than 255, reduce the
relevant members to bytes.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r-- | fs/afs/internal.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 871a228d7f37..8ae4e2ebb99a 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -73,12 +73,14 @@ struct afs_addr_list { struct rcu_head rcu; /* Must be first */ refcount_t usage; u32 version; /* Version */ - unsigned short nr_addrs; - unsigned short index; /* Address currently in use */ - unsigned short nr_ipv4; /* Number of IPv4 addresses */ + unsigned char max_addrs; + unsigned char nr_addrs; + unsigned char index; /* Address currently in use */ + unsigned char nr_ipv4; /* Number of IPv4 addresses */ unsigned long probed; /* Mask of servers that have been probed */ unsigned long yfs; /* Mask of servers that are YFS */ struct sockaddr_rxrpc addrs[]; +#define AFS_MAX_ADDRESSES ((unsigned int)(sizeof(unsigned long) * 8)) }; /* |