summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/mount3.h
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-03-31 07:27:04 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-31 07:44:06 -0700
commite63053803dca86b4283b71bc4ef4cb180ec72d89 (patch)
tree05702e5e62f1596250106e3668e3d1062a0472b5 /xlators/nfs/server/src/mount3.h
parentc4fd1cf7325972d8ff64ef3a2bea70edcf4f1085 (diff)
nfs: Add MOUNTv3 protocol support
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 399 (NFS translator with Mount v3 and NFS v3 support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=399
Diffstat (limited to 'xlators/nfs/server/src/mount3.h')
-rw-r--r--xlators/nfs/server/src/mount3.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/mount3.h b/xlators/nfs/server/src/mount3.h
new file mode 100644
index 000000000..7cfd2b0cb
--- /dev/null
+++ b/xlators/nfs/server/src/mount3.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com>
+ This file is part of GlusterFS.
+
+ GlusterFS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ GlusterFS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _MOUNT3_H_
+#define _MOUNT3_H_
+
+#ifndef _CONFIG_H
+#define _CONFIG_H
+#include "config.h"
+#endif
+
+#include "rpcsvc.h"
+#include "dict.h"
+#include "xlator.h"
+#include "iobuf.h"
+#include "nfs.h"
+#include "list.h"
+#include "xdr-nfs3.h"
+#include "locking.h"
+
+/* Registered with portmap */
+#define GF_MOUNTV3_PORT 38465
+#define GF_MOUNTV3_IOB (2 * GF_UNIT_KB)
+#define GF_MOUNTV3_IOBPOOL (GF_MOUNTV3_IOB * 50)
+
+#define GF_MOUNTV1_PORT 38466
+#define GF_MNT GF_NFS"-mount"
+
+extern rpcsvc_program_t *
+mnt3svc_init (xlator_t *nfsx);
+
+extern rpcsvc_program_t *
+mnt1svc_init (xlator_t *nfsx);
+
+/* Data structureused to store the list of mounts points currently
+ * in use by NFS clients.
+ */
+struct mountentry {
+ /* Links to mount3_state->mountlist. */
+ struct list_head mlist;
+
+ /* The export name */
+ char exname[MNTPATHLEN];
+ char hostname[MNTPATHLEN];
+};
+
+struct mount3_state {
+ xlator_t *nfsx;
+
+ /* The buffers for all network IO are got from this pool. */
+ struct iobuf_pool *iobpool;
+ xlator_list_t *exports;
+
+ /* List of current mount points over all the exports from this
+ * server.
+ */
+ struct list_head mountlist;
+
+ /* Used to protect the mountlist. */
+ gf_lock_t mountlock;
+};
+#endif