summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2011-04-06 10:53:57 -0400
committerSteve Dickson <steved@redhat.com>2011-04-06 10:56:39 -0400
commit73840ef610accf4cf667427bc64805377c0d8394 (patch)
treefe52d6cdfcb35281f763b6d7432d10027049c8e3 /support
parent38e4c685410885a6d464ddd44eff4fd5e7f8459f (diff)
downloadnfs-utils-73840ef610accf4cf667427bc64805377c0d8394.tar.gz
nfs-utils-73840ef610accf4cf667427bc64805377c0d8394.tar.xz
nfs-utils-73840ef610accf4cf667427bc64805377c0d8394.zip
exports: add a configurable time-to-live for the kernel cache entries
From: Trond Myklebust <Trond.Myklebust@netapp.com> The fedfs ldap server will specify a ttl for its entries. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> This is a refactoring change only. There should be no change in behavior. Original patch had updates to utils/mountd/junctions.c, which no longer exists. These are not included here. Create a macro for the default cache TTL, which is used in several places besides the export cache. Make e_ttl unsigned. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r--support/include/exportfs.h1
-rw-r--r--support/include/nfslib.h1
-rw-r--r--support/nfs/exports.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index 3cf1ee8..01e87dd 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -100,6 +100,7 @@ typedef struct mexport {
} nfs_export;
#define HASH_TABLE_SIZE 1021
+#define DEFAULT_TTL (30 * 60)
typedef struct _exp_hash_entry {
nfs_export * p_first;
diff --git a/support/include/nfslib.h b/support/include/nfslib.h
index cee826b..73f3c20 100644
--- a/support/include/nfslib.h
+++ b/support/include/nfslib.h
@@ -95,6 +95,7 @@ struct exportent {
char * e_fslocdata;
char * e_uuid;
struct sec_entry e_secinfo[SECFLAVOR_COUNT+1];
+ unsigned int e_ttl;
};
struct rmtabent {
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index 1744ed6..6acb2b6 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -107,6 +107,7 @@ static void init_exportent (struct exportent *ee, int fromkernel)
ee->e_nsquids = 0;
ee->e_nsqgids = 0;
ee->e_uuid = NULL;
+ ee->e_ttl = DEFAULT_TTL;
}
struct exportent *