linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
To: " J. Bruce Fields" <bfields-vtMw8L3fJ9vSiEDVxGk4TQ@public.gmane.org>
Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	pnfs-6DNke4IJHB0gsBAKwltoeQ@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andy Adamson <andros-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
	Benny Halevy <bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH v2 08/35] pnfsd: add pnfs export option
Date: Mon,  7 Dec 2009 11:31:30 +0200	[thread overview]
Message-ID: <1260178290-14922-1-git-send-email-bhalevy@panasas.com> (raw)
In-Reply-To: <4B1CCA52.8020900-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>

From: Andy Adamson <andros-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>

This is a boolean for now. When more layouttypes are supported, this can
change to "pnfs=", similar to "sec=".

The ctl interface is not enhanced.

Signed-off-by: Andy Adamson <andros-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
[pnfsd: fix cosmetic checkpatch warnings]
[pnfsd: test pnfs export option in check_export]
Signed-off-by: Benny Halevy <bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
---
 fs/nfsd/export.c            |   21 ++++++++++++++++++---
 include/linux/nfsd/export.h |    1 +
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index f82ed90..ca745cc 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -356,7 +356,8 @@ static struct svc_export *svc_export_update(struct svc_export *new,
 					    struct svc_export *old);
 static struct svc_export *svc_export_lookup(struct svc_export *);
 
-static int check_export(struct inode *inode, int flags, unsigned char *uuid)
+static int check_export(struct inode *inode, int flags, unsigned char *uuid,
+			bool ex_pnfs)
 {
 
 	/*
@@ -388,6 +389,14 @@ static int check_export(struct inode *inode, int flags, unsigned char *uuid)
 		return -EINVAL;
 	}
 
+	dprintk("%s: s_pnfs_op %p ex_pnfs %d\n", __func__,
+		inode->i_sb->s_pnfs_op, ex_pnfs);
+
+	if (!ex_pnfs) {
+		inode->i_sb->s_pnfs_op = NULL;
+		return 0;
+	}
+
 	return 0;
 
 }
@@ -579,6 +588,8 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
 					if (exp.ex_uuid == NULL)
 						err = -ENOMEM;
 				}
+			} else if (strcmp(buf, "pnfs") == 0) {
+				exp.ex_pnfs = 1;
 			} else if (strcmp(buf, "secinfo") == 0)
 				err = secinfo_parse(&mesg, buf, &exp);
 			else
@@ -592,7 +603,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
 		}
 
 		err = check_export(exp.ex_path.dentry->d_inode, exp.ex_flags,
-				   exp.ex_uuid);
+				   exp.ex_uuid, exp.ex_pnfs);
 		if (err)
 			goto out4;
 	}
@@ -653,6 +664,8 @@ static int svc_export_show(struct seq_file *m,
 				seq_printf(m, "%02x", exp->ex_uuid[i]);
 			}
 		}
+		if (exp->ex_pnfs)
+			seq_puts(m, ",pnfs");
 		show_secinfo(m, exp);
 	}
 	seq_puts(m, ")\n");
@@ -680,6 +693,7 @@ static void svc_export_init(struct cache_head *cnew, struct cache_head *citem)
 	new->ex_fslocs.locations = NULL;
 	new->ex_fslocs.locations_count = 0;
 	new->ex_fslocs.migrated = 0;
+	new->ex_pnfs = 0;
 }
 
 static void export_update(struct cache_head *cnew, struct cache_head *citem)
@@ -692,6 +706,7 @@ static void export_update(struct cache_head *cnew, struct cache_head *citem)
 	new->ex_anon_uid = item->ex_anon_uid;
 	new->ex_anon_gid = item->ex_anon_gid;
 	new->ex_fsid = item->ex_fsid;
+	new->ex_pnfs = item->ex_pnfs;
 	new->ex_uuid = item->ex_uuid;
 	item->ex_uuid = NULL;
 	new->ex_pathname = item->ex_pathname;
@@ -1030,7 +1045,7 @@ exp_export(struct nfsctl_export *nxp)
 		goto finish;
 	}
 
-	err = check_export(path.dentry->d_inode, nxp->ex_flags, NULL);
+	err = check_export(path.dentry->d_inode, nxp->ex_flags, NULL, false);
 	if (err) goto finish;
 
 	err = -ENOMEM;
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 3f17228..268391e 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -98,6 +98,7 @@ struct svc_export {
 	uid_t			ex_anon_uid;
 	gid_t			ex_anon_gid;
 	int			ex_fsid;
+	int			ex_pnfs;
 	unsigned char *		ex_uuid; /* 16 byte fsid */
 	struct nfsd4_fs_locations ex_fslocs;
 	int			ex_nflavors;
-- 
1.6.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-12-07  9:31 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07  9:26 [PATCH v2 0/35] Initial pnfsd file layout support Benny Halevy
2009-12-07  9:30 ` [PATCH v2 04/35] pnfsd: return pnfs flags on exchange_id Benny Halevy
     [not found]   ` <1260178237-14780-1-git-send-email-bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-07 19:51     `  J. Bruce Fields
2009-12-08 14:46       ` Benny Halevy
2009-12-07  9:31 ` [PATCH v2 07/35] pnfsd: define pnfs_export_operations Benny Halevy
2009-12-07  9:31 ` [PATCH v2 09/35] pnfsd: layout verify Benny Halevy
2009-12-07  9:32 ` [PATCH v2 12/35] pnfsd: filelayout: get device list/info Benny Halevy
2009-12-07  9:32 ` [PATCH v2 14/35] pnfsd: filelayout: layout encoding Benny Halevy
2009-12-07  9:33 ` [PATCH v2 16/35] pnfsd: helper function for stateid checking Benny Halevy
2009-12-07  9:33 ` [PATCH v2 17/35] pnfsd: process the layout stateid Benny Halevy
     [not found] ` <4B1CCA52.8020900-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-07  9:29   ` [PATCH v2 01/35] pnfsd: Define CONFIG_PNFSD Benny Halevy
2009-12-07  9:30   ` [PATCH v2 02/35] pnfsd: define NFSDDBG_PNFS Benny Halevy
2009-12-07  9:30   ` [PATCH v2 03/35] pnfsd, pnfs: protocol level pnfs constants Benny Halevy
     [not found]     ` <1260178224-14745-1-git-send-email-bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-07 19:25       `  J. Bruce Fields
2009-12-08 14:31         ` Benny Halevy
2009-12-07  9:30   ` [PATCH v2 05/35] pnfsd: don't set up back channel on create_session for ds Benny Halevy
2009-12-07 20:10     `  J. Bruce Fields
2009-12-08 14:50       ` Benny Halevy
2009-12-07  9:31   ` [PATCH v2 06/35] pnfsd: introduce pnfsd header files Benny Halevy
2009-12-07  9:31   ` Benny Halevy [this message]
2009-12-07  9:31   ` [PATCH v2 10/35] pnfsd: introduce exp_xdr.h Benny Halevy
2009-12-07  9:32   ` [PATCH v2 11/35] pnfsd: get device list/info Benny Halevy
     [not found]     ` <1260178330-15032-1-git-send-email-bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-10 17:30       `  J. Bruce Fields
2009-12-10 18:53         ` Benny Halevy
     [not found]           ` <4B214394.4030808-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-10 19:04             ` J. Bruce Fields
     [not found]               ` <20091210190402.GA12559-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2009-12-10 19:21                 ` Benny Halevy
     [not found]                   ` <4B214A3A.8090306-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-10 19:43                     ` J. Bruce Fields
2009-12-07  9:32   ` [PATCH v2 13/35] pnfsd: layout get Benny Halevy
2009-12-07  9:33   ` [PATCH v2 15/35] pnfsd: Helper functions for layout stateid processing Benny Halevy
2009-12-07  9:33   ` [PATCH v2 18/35] pnfsd: add helper functions for identifying DS stateids Benny Halevy
2009-12-07  9:33   ` [PATCH v2 19/35] pnfsd: accept all ds stateids Benny Halevy
2009-12-07  9:34   ` [PATCH v2 20/35] pnfsd: LAYOUTGET layout stateid processing Benny Halevy
2009-12-07  9:34   ` [PATCH v2 23/35] pnfsd: per block device dlm data server list cache Benny Halevy
2009-12-07  9:35   ` [PATCH v2 24/35] pnfsd: new nfsd filesystem file: pnfs_dlm_device Benny Halevy
2009-12-07  9:35   ` [PATCH v2 26/35] pnfsd: nfsd4_pnfs_dlm_getdevinfo Benny Halevy
2009-12-07  9:35   ` [PATCH v2 27/35] pnfsd: nfsd4_pnfs_dlm_layoutget Benny Halevy
2009-12-07  9:36   ` [PATCH v2 30/35] pnfsd: gfs2: use generic file layout pnfs operations vector Benny Halevy
2009-12-07  9:36   ` [PATCH v2 31/35] posix_acl: resolve compile dependency in posix_acl.h Benny Halevy
2009-12-07  9:36   ` [PATCH v2 32/35] nfs: resolve compile dependency in nfs_xdr.h Benny Halevy
2009-12-07  9:37   ` [PATCH v2 33/35] pnfsd: layout commit Benny Halevy
2009-12-07  9:37   ` [PATCH v2 34/35] pnfsd: layout return Benny Halevy
2009-12-07  9:54   ` [pnfs] [PATCH v2 0/35] Initial pnfsd file layout support Benny Halevy
2009-12-09 10:24   ` [PATCH 0/9] fixes to Initial pnfsd file layout support v2, comments {3,4,5}/35 Benny Halevy
     [not found]     ` <4B1F7AF6.2080305-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-09 10:27       ` [PATCH 1/3] SQUASHME: pnfsd: unify enum pnfs_layout{return,recall}_type Benny Halevy
2009-12-09 10:27       ` [PATCH 2/3] SQUASHME: pnfsd: always set both MDS and DS exchangeid capability flags Benny Halevy
2009-12-09 18:54         `  J. Bruce Fields
2009-12-09 10:27       ` [PATCH 3/3] SQUASHME: pnfsd: define a is_ds_only_session helper Benny Halevy
2009-12-09 10:27       ` [PATCH 4/4] SQUASHME: pnfsd: use only RETURN_* constants Benny Halevy
2009-12-09 10:27       ` [PATCH 5/5] SQUASHME: spnfs: " Benny Halevy
2009-12-09 10:28       ` [PATCH 6/6] SQUASHME: spnfs-block: " Benny Halevy
2009-12-09 10:28       ` [PATCH 7/7] SQUASHME: pnfsd-exofs: use only pnfs_layoutreturn_type Benny Halevy
2009-12-09 10:28       ` [PATCH 8/9] SQUASHME: pnfs: " Benny Halevy
2009-12-09 10:28     ` [PATCH 9/9] SQUASHME: pnfs: filelayout: mask out server's MDS capability flag for DSs Benny Halevy
     [not found]       ` <1260354530-12578-1-git-send-email-bhalevy-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2009-12-09 22:21         ` [pnfs] " Benny Halevy
2009-12-07  9:34 ` [PATCH v2 21/35] pnfsd: destroy layout on expire_client Benny Halevy
2009-12-07  9:34 ` [PATCH v2 22/35] pnfsd: support layout_type attribute Benny Halevy
2009-12-07  9:35 ` [PATCH v2 25/35] pnfsd: nfsd4_pnfs_dlm_getdeviter Benny Halevy
2009-12-07  9:36 ` [PATCH v2 28/35] pnfsd: add dlm file layout layout-type Benny Halevy
2009-12-07  9:36 ` [PATCH v2 29/35] pnfsd: dlm pnfs_export_operations Benny Halevy
2009-12-07  9:37 ` [PATCH v2 35/35] pnfsd: layoutreturn stateid processing Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1260178290-14922-1-git-send-email-bhalevy@panasas.com \
    --to=bhalevy-c4p08nqkorlbdgjk7y7tuq@public.gmane.org \
    --cc=andros-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
    --cc=bfields-vtMw8L3fJ9vSiEDVxGk4TQ@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pnfs-6DNke4IJHB0gsBAKwltoeQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).