From 086aa2c5b81b0bf6af86a136f295bca6aad70680 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 22 Aug 2004 23:00:59 -0700 Subject: [PATCH] nfsd: simplify auth_domain_lookup The interface between the auth_domain and the cache code is messy; the auth_domain code is the only real user of the full 11-argument DefineCacheLookup, and does weird stuff with it (like passing in through one of the arguments a bit of code with a conditional return). We could further parametrize DefineCacheLookup, but I think it's already too complicated. My solution is to just ignore DefineCacheLookup and write the auth_domain_lookup function from scratch. It's actually a pretty short function (much simpler than DefineCacheLookup itself), and it's much easier to read this short function than it is to read some special-cased DefineCacheLookup to verify that it does what it says it does.... Signed-off-by: J. Bruce Fields Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sunrpc/cache.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux') diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index a98b1981fc0a..04ac3afcc6a9 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -161,6 +161,10 @@ struct cache_deferred_req { * INIT copies key information from "item" to "new" * UPDATE copies content information from "item" to "tmp" * INPLACE is true if updates can happen inplace rather than allocating a new structure + * + * WARNING: any substantial changes to this must be reflected in + * net/sunrpc/svcauth.c(auth_domain_lookup) + * which is a similar routine that is open-coded. */ #define DefineCacheLookup(RTN,MEMBER,FNAME,ARGS,SETUP,DETAIL,HASHFN,TEST,INIT,UPDATE,INPLACE) \ RTN *FNAME ARGS \ -- cgit v1.2.3