summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/hashfn.c
Commit message (Expand)AuthorAgeFilesLines
* build: do not #include "config.h" in each fileNiels de Vos2015-05-291-5/+0
* license: dual license under GPLV2 and LGPLV3+Kaleb KEITHLEY2012-05-101-14/+5
* Change Copyright current yearPranith Kumar K2011-08-101-1/+1
* LICENSE: s/GNU Affero General Public/GNU General Public/Pranith Kumar K2011-08-061-3/+3
* libglusterfs/src/*.c: whitespace cleanupAmar Tumballi2011-03-171-137/+137
* Copyright changesVijay Bellur2010-10-111-1/+1
* Change GNU GPL to GNU AGPLPranith K2010-10-041-3/+3
* Changed occurrences of Z Research to Gluster.Vijay Bellur2009-10-071-1/+1
* libglusterfs: fix SuperFastHash function used in dicitionaries in fact it alw...smyczek2009-07-271-7/+0
* libglusterfsclient: Fake a fsid for every VMPShehjar Tikoo2009-07-201-0/+11
* moved dht_hashfn_tea() to libglusterfs/hashfn.c as gf_dm_hashfn() (dm - davie...Basavanagowda Kanur2009-02-271-0/+103
* updated copyright header to extend copyright upto 2009Basavanagowda Kanur2009-02-261-1/+1
* Added all filesVikas Gorur2009-02-181-0/+89
e don't have nfs xlator pointer to dereference it. But thats OK
+ */
+
+struct nfs3_fh *
+nfs3_rootfh (char* path)
+{
+ struct mount3_state *ms = NULL;
+ struct nfs3_fh *fh = NULL;
+ struct mnt3_export *exp = NULL;
+ inode_t *inode = NULL;
+ char *tmp = NULL;
+
+ ms = mnt3prog.private;
+ exp = mnt3_mntpath_to_export (ms, path);
+ if (exp == NULL)
+ goto err;
+
+ tmp = (char *)path;
+ tmp = strchr (tmp, '/');
+ if (tmp == NULL)
+ tmp = "/";
+
+ inode = inode_from_path (exp->vol->itable, tmp);
+ if (inode == NULL)
+ goto err;
+
+ fh = GF_CALLOC (1, sizeof(*fh), gf_nfs_mt_nfs3_fh);
+ if (fh == NULL)
+ goto err;
+ nfs3_build_fh (inode, exp->volumeid, fh);
+
+err:
+ if (inode)
+ inode_unref (inode);
+ return fh;
+}
+
+int
+mount3udp_add_mountlist (char *host, dirpath *expname)
+{
+ struct mountentry *me = NULL;
+ struct mount3_state *ms = NULL;
+ char *export = NULL;
+
+ ms = mnt3prog.private;
+ me = GF_CALLOC (1, sizeof (*me), gf_nfs_mt_mountentry);
+ if (!me)
+ return -1;
+ export = (char *)expname;
+ while (*export == '/')
+ export++;
+
+ strcpy (me->exname, export);
+ strcpy (me->hostname, host);
+ INIT_LIST_HEAD (&me->mlist);
+ LOCK (&ms->mountlock);
+ {
+ list_add_tail (&me->mlist, &ms->mountlist);
+ }
+ UNLOCK (&ms->mountlock);
+ return 0;
+}
+
+int
+mount3udp_delete_mountlist (char *hostname, dirpath *expname)
+{
+ struct mount3_state *ms = NULL;
+ char *export = NULL;
+
+ ms = mnt3prog.private;
+ export = (char *)expname;
+ while (*export == '/')
+ export++;
+ __mnt3svc_umount (ms, export, hostname);
+ return 0;
+}
+
struct mnt3_export *
mnt3_init_export_ent (struct mount3_state *ms, xlator_t *xl, char *exportpath,
@@ -1785,6 +1869,7 @@ rpcsvc_program_t mnt3prog = {
};
+
rpcsvc_program_t *
mnt3svc_init (xlator_t *nfsx)
{
@@ -1793,6 +1878,7 @@ mnt3svc_init (xlator_t *nfsx)
dict_t *options = NULL;
char *portstr = NULL;
int ret = -1;
+ pthread_t udp_thread;
if (!nfsx || !nfsx->private)
return NULL;
@@ -1842,6 +1928,9 @@ mnt3svc_init (xlator_t *nfsx)
goto err;
}
+ if (nfs->mount_udp) {
+ pthread_create (&udp_thread, NULL, mount3udp_thread, NULL);
+ }
return &mnt3prog;
err:
return NULL;
@@ -1930,5 +2019,3 @@ mnt1svc_init (xlator_t *nfsx)
err:
return NULL;
}
-
-