Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41577
b: refs/heads/master
c: 4806126
h: refs/heads/master
i:
  41575: a4e5a34
v: v3
  • Loading branch information
Al Viro authored and David S. Miller committed Dec 3, 2006
1 parent 7e4d022 commit 2cf09ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a74ff7770f4795d7580392890fdf06821c78769
refs/heads/master: 4806126d78345ad8a99bca1367a8a39c08e19393
8 changes: 4 additions & 4 deletions trunk/net/sunrpc/svcauth_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ static void ip_map_put(struct kref *kref)
* IP addresses in reverse-endian (i.e. on a little-endian machine).
* So use a trivial but reliable hash instead
*/
static inline int hash_ip(unsigned long ip)
static inline int hash_ip(__be32 ip)
{
int hash = ip ^ (ip>>16);
int hash = (__force u32)ip ^ ((__force u32)ip>>16);
return (hash ^ (hash>>8)) & 0xff;
}
#endif
Expand Down Expand Up @@ -284,7 +284,7 @@ static struct ip_map *ip_map_lookup(char *class, struct in_addr addr)
ip.m_addr = addr;
ch = sunrpc_cache_lookup(&ip_map_cache, &ip.h,
hash_str(class, IP_HASHBITS) ^
hash_ip((unsigned long)addr.s_addr));
hash_ip(addr.s_addr));

if (ch)
return container_of(ch, struct ip_map, h);
Expand Down Expand Up @@ -313,7 +313,7 @@ static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t ex
ch = sunrpc_cache_update(&ip_map_cache,
&ip.h, &ipm->h,
hash_str(ipm->m_class, IP_HASHBITS) ^
hash_ip((unsigned long)ipm->m_addr.s_addr));
hash_ip(ipm->m_addr.s_addr));
if (!ch)
return -ENOMEM;
cache_put(ch, &ip_map_cache);
Expand Down

0 comments on commit 2cf09ab

Please sign in to comment.