aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/cache.h3
-rw-r--r--net/sunrpc/svcauth_unix.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 6950c981882d..c2aebe8eeffd 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -255,10 +255,13 @@ static inline time_t get_expiry(char **bpp)
255 return rv - boot.tv_sec; 255 return rv - boot.tv_sec;
256} 256}
257 257
258#ifdef CONFIG_NFSD_DEPRECATED
258static inline void sunrpc_invalidate(struct cache_head *h, 259static inline void sunrpc_invalidate(struct cache_head *h,
259 struct cache_detail *detail) 260 struct cache_detail *detail)
260{ 261{
261 h->expiry_time = seconds_since_boot() - 1; 262 h->expiry_time = seconds_since_boot() - 1;
262 detail->nextcheck = seconds_since_boot(); 263 detail->nextcheck = seconds_since_boot();
263} 264}
265#endif /* CONFIG_NFSD_DEPRECATED */
266
264#endif /* _LINUX_SUNRPC_CACHE_H_ */ 267#endif /* _LINUX_SUNRPC_CACHE_H_ */
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 59a7c524a8b1..30916b06c12b 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -30,7 +30,9 @@
30 30
31struct unix_domain { 31struct unix_domain {
32 struct auth_domain h; 32 struct auth_domain h;
33#ifdef CONFIG_NFSD_DEPRECATED
33 int addr_changes; 34 int addr_changes;
35#endif /* CONFIG_NFSD_DEPRECATED */
34 /* other stuff later */ 36 /* other stuff later */
35}; 37};
36 38
@@ -64,7 +66,9 @@ struct auth_domain *unix_domain_find(char *name)
64 return NULL; 66 return NULL;
65 } 67 }
66 new->h.flavour = &svcauth_unix; 68 new->h.flavour = &svcauth_unix;
69#ifdef CONFIG_NFSD_DEPRECATED
67 new->addr_changes = 0; 70 new->addr_changes = 0;
71#endif /* CONFIG_NFSD_DEPRECATED */
68 rv = auth_domain_lookup(name, &new->h); 72 rv = auth_domain_lookup(name, &new->h);
69 } 73 }
70} 74}
@@ -91,7 +95,9 @@ struct ip_map {
91 char m_class[8]; /* e.g. "nfsd" */ 95 char m_class[8]; /* e.g. "nfsd" */
92 struct in6_addr m_addr; 96 struct in6_addr m_addr;
93 struct unix_domain *m_client; 97 struct unix_domain *m_client;
98#ifdef CONFIG_NFSD_DEPRECATED
94 int m_add_change; 99 int m_add_change;
100#endif /* CONFIG_NFSD_DEPRECATED */
95}; 101};
96 102
97static void ip_map_put(struct kref *kref) 103static void ip_map_put(struct kref *kref)
@@ -145,7 +151,9 @@ static void update(struct cache_head *cnew, struct cache_head *citem)
145 151
146 kref_get(&item->m_client->h.ref); 152 kref_get(&item->m_client->h.ref);
147 new->m_client = item->m_client; 153 new->m_client = item->m_client;
154#ifdef CONFIG_NFSD_DEPRECATED
148 new->m_add_change = item->m_add_change; 155 new->m_add_change = item->m_add_change;
156#endif /* CONFIG_NFSD_DEPRECATED */
149} 157}
150static struct cache_head *ip_map_alloc(void) 158static struct cache_head *ip_map_alloc(void)
151{ 159{
@@ -330,6 +338,7 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
330 ip.h.flags = 0; 338 ip.h.flags = 0;
331 if (!udom) 339 if (!udom)
332 set_bit(CACHE_NEGATIVE, &ip.h.flags); 340 set_bit(CACHE_NEGATIVE, &ip.h.flags);
341#ifdef CONFIG_NFSD_DEPRECATED
333 else { 342 else {
334 ip.m_add_change = udom->addr_changes; 343 ip.m_add_change = udom->addr_changes;
335 /* if this is from the legacy set_client system call, 344 /* if this is from the legacy set_client system call,
@@ -338,6 +347,7 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
338 if (expiry == NEVER) 347 if (expiry == NEVER)
339 ip.m_add_change++; 348 ip.m_add_change++;
340 } 349 }
350#endif /* CONFIG_NFSD_DEPRECATED */
341 ip.h.expiry_time = expiry; 351 ip.h.expiry_time = expiry;
342 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h, 352 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h,
343 hash_str(ipm->m_class, IP_HASHBITS) ^ 353 hash_str(ipm->m_class, IP_HASHBITS) ^
@@ -357,6 +367,7 @@ static inline int ip_map_update(struct net *net, struct ip_map *ipm,
357 return __ip_map_update(sn->ip_map_cache, ipm, udom, expiry); 367 return __ip_map_update(sn->ip_map_cache, ipm, udom, expiry);
358} 368}
359 369
370#ifdef CONFIG_NFSD_DEPRECATED
360int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom) 371int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom)
361{ 372{
362 struct unix_domain *udom; 373 struct unix_domain *udom;
@@ -411,6 +422,7 @@ struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr)
411 return rv; 422 return rv;
412} 423}
413EXPORT_SYMBOL_GPL(auth_unix_lookup); 424EXPORT_SYMBOL_GPL(auth_unix_lookup);
425#endif /* CONFIG_NFSD_DEPRECATED */
414 426
415void svcauth_unix_purge(void) 427void svcauth_unix_purge(void)
416{ 428{