diff options
author | Michal Marek <mmarek@suse.cz> | 2010-08-04 07:59:13 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-08-04 07:59:13 -0400 |
commit | 772320e84588dcbe1600ffb83e5f328f2209ac2a (patch) | |
tree | a7de21b79340aeaa17c58126f6b801b82c77b53a /fs/nfs/dns_resolve.c | |
parent | 1ce53adf13a54375d2a5c7cdbe341b2558389615 (diff) | |
parent | 9fe6206f400646a2322096b56c59891d530e8d51 (diff) |
Merge commit 'v2.6.35' into kbuild/kbuild
Conflicts:
arch/powerpc/Makefile
Diffstat (limited to 'fs/nfs/dns_resolve.c')
-rw-r--r-- | fs/nfs/dns_resolve.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 95e1ca765d47..76fd235d0024 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/hash.h> | 9 | #include <linux/hash.h> |
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/kmod.h> | 11 | #include <linux/kmod.h> |
12 | #include <linux/slab.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/socket.h> | 14 | #include <linux/socket.h> |
14 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
@@ -36,6 +37,19 @@ struct nfs_dns_ent { | |||
36 | }; | 37 | }; |
37 | 38 | ||
38 | 39 | ||
40 | static void nfs_dns_ent_update(struct cache_head *cnew, | ||
41 | struct cache_head *ckey) | ||
42 | { | ||
43 | struct nfs_dns_ent *new; | ||
44 | struct nfs_dns_ent *key; | ||
45 | |||
46 | new = container_of(cnew, struct nfs_dns_ent, h); | ||
47 | key = container_of(ckey, struct nfs_dns_ent, h); | ||
48 | |||
49 | memcpy(&new->addr, &key->addr, key->addrlen); | ||
50 | new->addrlen = key->addrlen; | ||
51 | } | ||
52 | |||
39 | static void nfs_dns_ent_init(struct cache_head *cnew, | 53 | static void nfs_dns_ent_init(struct cache_head *cnew, |
40 | struct cache_head *ckey) | 54 | struct cache_head *ckey) |
41 | { | 55 | { |
@@ -49,8 +63,7 @@ static void nfs_dns_ent_init(struct cache_head *cnew, | |||
49 | new->hostname = kstrndup(key->hostname, key->namelen, GFP_KERNEL); | 63 | new->hostname = kstrndup(key->hostname, key->namelen, GFP_KERNEL); |
50 | if (new->hostname) { | 64 | if (new->hostname) { |
51 | new->namelen = key->namelen; | 65 | new->namelen = key->namelen; |
52 | memcpy(&new->addr, &key->addr, key->addrlen); | 66 | nfs_dns_ent_update(cnew, ckey); |
53 | new->addrlen = key->addrlen; | ||
54 | } else { | 67 | } else { |
55 | new->namelen = 0; | 68 | new->namelen = 0; |
56 | new->addrlen = 0; | 69 | new->addrlen = 0; |
@@ -234,7 +247,7 @@ static struct cache_detail nfs_dns_resolve = { | |||
234 | .cache_show = nfs_dns_show, | 247 | .cache_show = nfs_dns_show, |
235 | .match = nfs_dns_match, | 248 | .match = nfs_dns_match, |
236 | .init = nfs_dns_ent_init, | 249 | .init = nfs_dns_ent_init, |
237 | .update = nfs_dns_ent_init, | 250 | .update = nfs_dns_ent_update, |
238 | .alloc = nfs_dns_ent_alloc, | 251 | .alloc = nfs_dns_ent_alloc, |
239 | }; | 252 | }; |
240 | 253 | ||