summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs.c
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2012-01-13 23:17:07 +0530
committerAnand Avati <avati@gluster.com>2012-01-20 05:06:15 -0800
commitbb1e07b7f42e7db415527852e98fcc1cbf2e1285 (patch)
treea434a1ff9983636e563bd1b8a16a5b11b8fd2347 /xlators/nfs/server/src/nfs.c
parent7e1f8e3bac201f88e2d9ef62fc69a044716dfced (diff)
nfs: changes for using nameless lookup and anonymous FDs
- Use gfid to create filehandle instead of encoding path components - Utilize nameless lookups of GFID for deep resolution instead of crawling the namespace with component hints - Use anonymous FDs for file based operations - Do away with fdcaching code for files and dirs Change-Id: Ic48fb23370b25d183f7e1fc1cc5dffa9d5bab3fb BUG: 781318 Reviewed-on: http://review.gluster.com/2645 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs.c')
-rw-r--r--xlators/nfs/server/src/nfs.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 2bc7f02fc..0862f0017 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -274,7 +274,7 @@ nfs_startup_subvolume (xlator_t *nfsx, xlator_t *xl)
goto err;
}
- ret = nfs_inode_loc_fill (xl->itable->root, &rootloc);
+ ret = nfs_root_loc_fill (xl->itable, &rootloc);
if (ret == -1) {
gf_log (GF_NFS, GF_LOG_CRITICAL, "Failed to init root loc");
goto err;
@@ -455,6 +455,23 @@ nfs_request_user_init (nfs_user_t *nfu, rpcsvc_request_t *req)
return;
}
+void
+nfs_request_primary_user_init (nfs_user_t *nfu, rpcsvc_request_t *req,
+ uid_t uid, gid_t gid)
+{
+ gid_t *gidarr = NULL;
+ int gids = 0;
+
+ if ((!req) || (!nfu))
+ return;
+
+ gidarr = rpcsvc_auth_unix_auxgids (req, &gids);
+ nfs_user_create (nfu, uid, gid, gidarr, gids);
+
+ return;
+}
+
+
int32_t
mem_acct_init (xlator_t *this)
{
@@ -792,22 +809,6 @@ fini (xlator_t *this)
int32_t
nfs_forget (xlator_t *this, inode_t *inode)
{
- int32_t ret = -1;
- uint64_t ctx = 0;
- struct inode_op_queue *inode_q = NULL;
-
- if (!inode || !this)
- return 0;
- ret = inode_ctx_del (inode, this, &ctx);
- if (!ret && ctx && !(IA_ISDIR (inode->ia_type))) {
- inode_q = (struct inode_op_queue *) (long) ctx;
- pthread_mutex_lock (&inode_q->qlock);
- {
- nfs3_flush_inode_queue (inode_q, NULL, 0);
- }
- pthread_mutex_unlock (&inode_q->qlock);
- }
-
return 0;
}