summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/nfs/nfs_export.c
diff options
context:
space:
mode:
authorThomas Haynes <Thomas.Haynes@Sun.COM>2010-04-06 12:51:45 -0500
committerThomas Haynes <Thomas.Haynes@Sun.COM>2010-04-06 12:51:45 -0500
commit3ccecb66974f295bbbd1add9d826bf4e9d10d829 (patch)
tree02fb325c29de8bcf05c870295142362441cd8f1c /usr/src/uts/common/fs/nfs/nfs_export.c
parent83ca9a11d102397d8307c76d5b733133f9841464 (diff)
downloadillumos-joyent-3ccecb66974f295bbbd1add9d826bf4e9d10d829.tar.gz
4799074 NFS authentication cache needs some sort of TTL
Diffstat (limited to 'usr/src/uts/common/fs/nfs/nfs_export.c')
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_export.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr/src/uts/common/fs/nfs/nfs_export.c b/usr/src/uts/common/fs/nfs/nfs_export.c
index 53f9f97294..ecb7e296ff 100644
--- a/usr/src/uts/common/fs/nfs/nfs_export.c
+++ b/usr/src/uts/common/fs/nfs/nfs_export.c
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -2535,9 +2534,8 @@ checkexport(fsid_t *fsid, fid_t *fid)
if (exi->exi_export.ex_flags & EX_PUBLIC) {
exi = exi_public;
}
- mutex_enter(&exi->exi_lock);
- exi->exi_count++;
- mutex_exit(&exi->exi_lock);
+
+ exi_hold(exi);
rw_exit(&exported_lock);
return (exi);
}
@@ -2675,6 +2673,14 @@ loadindex(struct exportdata *kex)
return (0);
}
+void
+exi_hold(struct exportinfo *exi)
+{
+ mutex_enter(&exi->exi_lock);
+ exi->exi_count++;
+ mutex_exit(&exi->exi_lock);
+}
+
/*
* When a thread completes using exi, it should call exi_rele().
* exi_rele() decrements exi_count. It releases exi if exi_count == 0, i.e.