summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/mount3.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-04-02 04:32:30 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-02 04:14:32 -0700
commitd9b34f3f2c5de8cdde6dd8c24fade839b7727ab2 (patch)
tree70281f962fd742b099a10b8ad5ce7bbcc3f1ce5f /xlators/nfs/server/src/mount3.c
parent8d2342b19c715f2d6ecb024eace8102e2c5e3a29 (diff)
nfs: Redesign fop argument passing to support single volfile use
The current design of the interaction between the generic NFS layer and the protocol handlers like mount3 and nfs3 is such that it does not allow using a single volume file which contains the nfs/server and the protocol/server. This is because the common nfs-fops layer assumes that ctx->top is always the nfs/server. This is wrong. The fops layer needs access to top because top or rather the generic NFS xlator's private state has a mem-pool. The fops layer needs this mem-pool to get memory for storing per-fop state. Since the fops layer cannot anymore take ctx->top be the nfs/server, all layers need to start passing the nfs/server xlator_t right down to the fops layer. I am also taking this chance to remove the synchronous equivalents of the fops and also remove the dirent caching directory operations. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 770 (NFS Xlator - Crash when both GlusterFS server/NFS Server are in the same file) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=770
Diffstat (limited to 'xlators/nfs/server/src/mount3.c')
-rw-r--r--xlators/nfs/server/src/mount3.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index dc8805085..db4a88e3d 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -219,7 +219,6 @@ mnt3svc_lookup_mount_cbk (call_frame_t *frame, void *cookie,
rpcsvc_request_t *req = NULL;
struct nfs3_fh fh = {{0}, };
struct mount3_state *ms = NULL;
- xlator_t *exportxl = NULL;
mountstat3 status = 0;
int autharr[10];
int autharrlen = 0;
@@ -243,15 +242,13 @@ mnt3svc_lookup_mount_cbk (call_frame_t *frame, void *cookie,
if (status != MNT3_OK)
goto xmit_res;
- exportxl = (xlator_t *)cookie;
- fh = nfs3_fh_build_root_fh (ms->nfsx->children, exportxl, *buf);
- mnt3svc_update_mountlist (ms, req, exportxl);
+ fh = nfs3_fh_build_root_fh (ms->nfsx->children, this, *buf);
+ mnt3svc_update_mountlist (ms, req, this);
xmit_res:
gf_log (GF_MNT, GF_LOG_DEBUG, "Mount reply status: %d", status);
if (op_ret == 0) {
svc = rpcsvc_request_service (req);
- autharrlen = rpcsvc_auth_array (svc, exportxl->name, autharr,
- 10);
+ autharrlen = rpcsvc_auth_array (svc, this->name, autharr, 10);
}
res = mnt3svc_set_mountres3 (status, &fh, autharr, autharrlen);
@@ -263,7 +260,7 @@ xmit_res:
int
-mnt3svc_mount (rpcsvc_request_t *req, xlator_t * xl)
+mnt3svc_mount (rpcsvc_request_t *req, xlator_t *nfsx, xlator_t * xl)
{
loc_t oploc = {0, };
int ret = -1;
@@ -279,7 +276,7 @@ mnt3svc_mount (rpcsvc_request_t *req, xlator_t * xl)
* used to build the root fh sent to the client.
*/
nfs_request_user_init (&nfu, req);
- ret = nfs_lookup (xl, &nfu, &oploc, mnt3svc_lookup_mount_cbk,
+ ret = nfs_lookup (nfsx, xl, &nfu, &oploc, mnt3svc_lookup_mount_cbk,
(void *)req);
nfs_loc_wipe (&oploc);
@@ -346,7 +343,7 @@ mnt3svc_mnt (rpcsvc_request_t *req)
goto rpcerr;
}
- mnt3svc_mount (req, targetxl);
+ mnt3svc_mount (req, ms->nfsx, targetxl);
mnterr:
if (ret == -1) {
mnt3svc_mnt_error_reply (req, mntstat);