summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/nfs
diff options
context:
space:
mode:
authorPavel Filipensky <Pavel.Filipensky@Sun.COM>2010-06-06 13:20:55 +0200
committerPavel Filipensky <Pavel.Filipensky@Sun.COM>2010-06-06 13:20:55 +0200
commitf932e4e7f553e8ba4e6125a39681b70e62f50af2 (patch)
treeede96dee09c2b3999036a8d8fddc12f68f71d507 /usr/src/uts/common/nfs
parentd669963431730ebd1423ef63416091cc1e628a2c (diff)
downloadillumos-joyent-f932e4e7f553e8ba4e6125a39681b70e62f50af2.tar.gz
6930814 share/unshare issues
6931194 exportfs() uses exportinfo_t after dropping exported_lock and without doing exi_count++ 6836258 exportinfo 16-way hash is too small 6953045 Put implementation of the Pearson's hashing algorithm into a separate file
Diffstat (limited to 'usr/src/uts/common/nfs')
-rw-r--r--usr/src/uts/common/nfs/export.h20
-rw-r--r--usr/src/uts/common/nfs/nfs4_idmap_impl.h13
2 files changed, 18 insertions, 15 deletions
diff --git a/usr/src/uts/common/nfs/export.h b/usr/src/uts/common/nfs/export.h
index 5d6072c2f7..56d8e2b0de 100644
--- a/usr/src/uts/common/nfs/export.h
+++ b/usr/src/uts/common/nfs/export.h
@@ -419,7 +419,13 @@ typedef struct treenode {
/* Root of nfs pseudo namespace */
extern treenode_t *ns_root;
-#define EXPTABLESIZE 16
+#define EXPTABLESIZE 256
+
+struct exp_hash {
+ struct exportinfo *prev; /* ptr to the previous exportinfo */
+ struct exportinfo *next; /* ptr to the next exportinfo */
+ struct exportinfo **bckt; /* backpointer to the hash bucket */
+};
/*
* A node associated with an export entry on the
@@ -441,7 +447,8 @@ struct exportinfo {
struct exportdata exi_export;
fsid_t exi_fsid;
struct fid exi_fid;
- struct exportinfo *exi_hash;
+ struct exp_hash fid_hash;
+ struct exp_hash path_hash;
struct treenode *exi_tree;
fhandle_t exi_fh;
krwlock_t exi_cache_lock;
@@ -505,6 +512,7 @@ struct exp_visible {
typedef struct exp_visible exp_visible_t;
#define PSEUDO(exi) ((exi)->exi_export.ex_flags & EX_PSEUDO)
+#define EXP_LINKED(exi) ((exi)->fid_hash.bckt != NULL)
#define EQFSID(fsidp1, fsidp2) \
(((fsidp1)->val[0] == (fsidp2)->val[0]) && \
@@ -533,7 +541,6 @@ extern int nfsauth4_access(struct exportinfo *, vnode_t *,
struct svc_req *);
extern int nfsauth4_secinfo_access(struct exportinfo *,
struct svc_req *, int, int);
-extern int nfs_fhhash(fsid_t *, fid_t *);
extern int nfs_fhbcmp(char *, char *, int);
extern int nfs_exportinit(void);
extern void nfs_exportfini(void);
@@ -555,8 +562,7 @@ extern struct exportinfo *nfs_vptoexi(vnode_t *, vnode_t *, cred_t *, int *,
extern int nfs_check_vpexi(vnode_t *, vnode_t *, cred_t *,
struct exportinfo **);
extern void export_link(struct exportinfo *);
-extern int export_unlink(fsid_t *, fid_t *, vnode_t *,
- struct exportinfo **);
+extern void export_unlink(struct exportinfo *);
extern vnode_t *untraverse(vnode_t *);
extern int vn_is_nfs_reparse(vnode_t *, cred_t *);
extern int client_is_downrev(struct svc_req *);
@@ -573,8 +579,8 @@ extern int nfs_visible_inode(struct exportinfo *, ino64_t, int *);
extern int has_visible(struct exportinfo *, vnode_t *);
extern void free_visible(struct exp_visible *);
extern int nfs_exported(struct exportinfo *, vnode_t *);
-extern int pseudo_exportfs(vnode_t *, struct exp_visible *,
- struct exportdata *, struct exportinfo **);
+extern struct exportinfo *pseudo_exportfs(vnode_t *, fid_t *,
+ struct exp_visible *, struct exportdata *);
extern int vop_fid_pseudo(vnode_t *, fid_t *fidp);
extern int nfs4_vget_pseudo(struct exportinfo *, vnode_t **, fid_t *);
/*
diff --git a/usr/src/uts/common/nfs/nfs4_idmap_impl.h b/usr/src/uts/common/nfs/nfs4_idmap_impl.h
index 344e98213a..f0f166688d 100644
--- a/usr/src/uts/common/nfs/nfs4_idmap_impl.h
+++ b/usr/src/uts/common/nfs/nfs4_idmap_impl.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,17 +19,15 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _NFS4_IDMAP_IMPL_H
#define _NFS4_IDMAP_IMPL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/list.h>
#include <sys/door.h>
+#include <sys/pkp_hash.h>
/*
* This is a private header file. Applications should not directly include
@@ -44,7 +41,7 @@ extern "C" {
/*
* Cache Entry Definitions
*/
-#define NFSID_CACHE_ANCHORS 256
+#define NFSID_CACHE_ANCHORS PKP_HASH_SIZE
typedef struct nfsidmap {
struct nfsidmap *id_chain[2]; /* must be first */