
The ex_flavors[] array is indexed via gss_flavor_to_index() which maps a 
given pseudoflavor into an index. This allows for a no-search method of
checking if a request pseudoflavor is supported by the export, a high 
frequency task.

OP_SECINFO requires the server to return an export's supported pseudoflavors
in an order set by the server administrator which in our case is the order
the per-export pseudoflavors are declared in /etc/export stanza.

Add an integer to the exp_flavor_info structure to preserve the order 
expressed in /etc/exports to be used to order the pseudoflavors returned 
by OP_SECINFO.

Signed-off-by: Andy Adamson <andros@citi.umich.edu>
---

---

 linux-2.6.18-rc5-andros/fs/nfsd/export.c            |    2 ++
 linux-2.6.18-rc5-andros/include/linux/nfsd/export.h |    1 +
 2 files changed, 3 insertions(+)

diff -puN fs/nfsd/export.c~nfsd-secinfo-order fs/nfsd/export.c
--- linux-2.6.18-rc5/fs/nfsd/export.c~nfsd-secinfo-order	2006-10-11 17:36:48.000000000 -0400
+++ linux-2.6.18-rc5-andros/fs/nfsd/export.c	2006-10-11 17:36:48.000000000 -0400
@@ -468,6 +468,7 @@ static inline void secinfo_clearall(stru
 	for (i=0; i< MAX_SECINFO_LIST; i++) {
 		exp->ex_flavors[i].pseudoflavor = -1;
 		exp->ex_flavors[i].flags = 0;
+		exp->ex_flavors[i].order = -1;
 	}
 }
 
@@ -499,6 +500,7 @@ static int secinfo_parse(char **mesg, ch
 			return -EINVAL;
 		index = gss_flavor_to_index(flavor);
 		exp->ex_flavors[index].pseudoflavor = flavor;
+		exp->ex_flavors[index].order = i;
 		err = get_int(mesg, &exp->ex_flavors[index].flags);
 		if (err)
 			return err;
diff -puN include/linux/nfsd/export.h~nfsd-secinfo-order include/linux/nfsd/export.h
--- linux-2.6.18-rc5/include/linux/nfsd/export.h~nfsd-secinfo-order	2006-10-11 17:36:48.000000000 -0400
+++ linux-2.6.18-rc5-andros/include/linux/nfsd/export.h	2006-10-11 17:36:48.000000000 -0400
@@ -70,6 +70,7 @@ struct nfsd4_fs_locations {
 struct exp_flavor_info {
 	u32	pseudoflavor;
 	int	flags;
+	int	order;
 };
 
 struct svc_export {
_
