From c4fd1cf7325972d8ff64ef3a2bea70edcf4f1085 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 31 Mar 2010 07:27:03 +0000 Subject: nfs: Add generic nfs translator Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 399 (NFS translator with Mount v3 and NFS v3 support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=399 --- xlators/nfs/server/src/nfs-common.h | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 xlators/nfs/server/src/nfs-common.h (limited to 'xlators/nfs/server/src/nfs-common.h') diff --git a/xlators/nfs/server/src/nfs-common.h b/xlators/nfs/server/src/nfs-common.h new file mode 100644 index 00000000000..20003aa7130 --- /dev/null +++ b/xlators/nfs/server/src/nfs-common.h @@ -0,0 +1,76 @@ +/* + Copyright (c) 2010 Gluster, Inc. + 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 + . +*/ + +#ifndef _NFS_COMMON_H_ +#define _NFS_COMMON_H_ + +#ifndef _CONFIG_H +#define _CONFIG_H +#include "config.h" +#endif + +#include + +#include "xlator.h" +#include "rpcsvc.h" +#include "iatt.h" + +#define NFS_PATH_MAX PATH_MAX +#define NFS_NAME_MAX NAME_MAX + +#define NFS_DEFAULT_CREATE_MODE 0644 + +extern xlator_t * +nfs_xlid_to_xlator (xlator_list_t *cl, uint8_t xlid); + +extern uint16_t +nfs_xlator_to_xlid (xlator_list_t *cl, xlator_t *xl); + +extern xlator_t * +nfs_path_to_xlator (xlator_list_t *cl, char *path); + +extern xlator_t * +nfs_mntpath_to_xlator (xlator_list_t *cl, char *path); + +extern int +nfs_zero_filled_stat (struct iatt *buf); + +extern void +nfs_loc_wipe (loc_t *loc); + +extern int +nfs_loc_copy (loc_t *dst, loc_t *src); + +extern int +nfs_loc_fill (loc_t *loc, inode_t *inode, inode_t *parent, char *path); + +#define NFS_RESOLVE_EXIST 1 +#define NFS_RESOLVE_CREATE 2 + +extern int +nfs_inode_loc_fill (inode_t *inode, loc_t *loc); + +extern int +nfs_ino_loc_fill (inode_table_t *itable, uint64_t ino, uint64_t gen, loc_t *l); + +extern int +nfs_entry_loc_fill (inode_table_t *itable, ino_t ino, uint64_t gen, char *entry, + loc_t *loc, int how); + +#endif -- cgit