OSDN Git Service

nfsd: clean up and clarify the cache expiration code
authorJeff Layton <jlayton@redhat.com>
Mon, 28 Jan 2013 19:41:13 +0000 (14:41 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 4 Feb 2013 14:16:23 +0000 (09:16 -0500)
commitd1a0774de6cb908f5ba7806d09aaf86bb03fa182
treebe9d6cc9f4bd3ce0c7f3da6665ced8f91e752258
parent25e6b8b0e1a247747db5275b1b6b362f5acf2245
nfsd: clean up and clarify the cache expiration code

Add a preprocessor constant for the expiry time of cache entries, and
move the test for an expired entry into a function. Note that the current
code does not test for RC_INPROG. It just assumes that it won't take more
than 2 minutes to fill out an in-progress entry.

I'm not sure how valid that assumption is though, so let's just ensure
that we never consider an RC_INPROG entry to be expired.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/cache.h
fs/nfsd/nfscache.c