From a8ef67630c48dfec336cc2088ac78cb29074022c Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 15 Jun 2010 00:39:25 +0000 Subject: nfs: Support directory level exports nfsx has followed traditional approach of exporting whole volumes as NFS exports. The Platform requires and some users have approached us for introducing exports of only specific directories instead of full Gluster volumes. This commit introduces this support through two nfsx options: Option 1: ========= option nfs3..export-dir ,,.. export-dir will allow the export of a particular dir as a single export by itself. For eg.: volume posix type storage/posix option directory /export/ end-volume volume posix-ac type features/access-control subvolumes posix end-volume volume nfs type nfs/server subvolumes posix-ac option rpc-auth.addr.allow * option nfs3.posix-ac.export-dir /homes/shehjart end-volume A comma separate list of sub-directories will set up those dirs as separated exports. At the nfs client, the mount command will be: $ mount :/posix-ac/homes/shehjart /mnt Option 2: ========= option nfs3..export-volumes There can be situations where users only want the directory level exports and require that volume exports be completely disabled. The above option allows us to do this. By default, volume exports are enabled. From the earlier example, replacing with posix-ac, will disable mounting of the posix-ac volume as a whole. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 989 (Support directory exports in nfsx) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=989 --- xlators/nfs/server/src/nfs3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/nfs/server/src/nfs3.c') diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index fda6d6413..131596e8f 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -903,7 +903,7 @@ nfs3svc_lookup_parentdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, nfs3_fh_build_parent_fh (&cs->fh, buf, &newfh); else newfh = nfs3_fh_build_root_fh (cs->nfs3state->exportslist, - cs->vol, *buf); + cs->vol); xmit_res: nfs3_log_newfh_res (rpcsvc_request_xid (cs->req), "LOOKUP", status, -- cgit