diff options
Diffstat (limited to 'include/linux/lockd')
-rw-r--r-- | include/linux/lockd/lockd.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0691efbd0b34..41d7a8e61cea 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -38,7 +38,8 @@ | |||
38 | */ | 38 | */ |
39 | struct nlm_host { | 39 | struct nlm_host { |
40 | struct hlist_node h_hash; /* doubly linked list */ | 40 | struct hlist_node h_hash; /* doubly linked list */ |
41 | struct sockaddr_in h_addr; /* peer address */ | 41 | struct sockaddr_storage h_addr; /* peer address */ |
42 | size_t h_addrlen; | ||
42 | struct sockaddr_in h_saddr; /* our address (optional) */ | 43 | struct sockaddr_in h_saddr; /* our address (optional) */ |
43 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ | 44 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ |
44 | char * h_name; /* remote hostname */ | 45 | char * h_name; /* remote hostname */ |
@@ -77,6 +78,19 @@ struct nsm_handle { | |||
77 | }; | 78 | }; |
78 | 79 | ||
79 | /* | 80 | /* |
81 | * Rigorous type checking on sockaddr type conversions | ||
82 | */ | ||
83 | static inline struct sockaddr_in *nlm_addr_in(const struct nlm_host *host) | ||
84 | { | ||
85 | return (struct sockaddr_in *)&host->h_addr; | ||
86 | } | ||
87 | |||
88 | static inline struct sockaddr *nlm_addr(const struct nlm_host *host) | ||
89 | { | ||
90 | return (struct sockaddr *)&host->h_addr; | ||
91 | } | ||
92 | |||
93 | /* | ||
80 | * Map an fl_owner_t into a unique 32-bit "pid" | 94 | * Map an fl_owner_t into a unique 32-bit "pid" |
81 | */ | 95 | */ |
82 | struct nlm_lockowner { | 96 | struct nlm_lockowner { |