aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2007-07-17 07:04:49 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:08 -0400
commit91fe39d35ebd6adaece4e090f6b1a3e4b6a59c97 (patch)
treef76c9129068fdb96408295ddb1c53491cf663389
parentac34cdb03dfdb8cdc824f41f577434c5c2521155 (diff)
knfsd: nfsd: display export secinfo information
Add secinfo information to the display in proc/net/sunrpc/nfsd.export/content. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/nfsd/export.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 06d5cd4a52c4..c7bbf460b009 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -641,6 +641,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
641 641
642static void exp_flags(struct seq_file *m, int flag, int fsid, 642static void exp_flags(struct seq_file *m, int flag, int fsid,
643 uid_t anonu, uid_t anong, struct nfsd4_fs_locations *fslocs); 643 uid_t anonu, uid_t anong, struct nfsd4_fs_locations *fslocs);
644static void show_secinfo(struct seq_file *m, struct svc_export *exp);
644 645
645static int svc_export_show(struct seq_file *m, 646static int svc_export_show(struct seq_file *m,
646 struct cache_detail *cd, 647 struct cache_detail *cd,
@@ -670,6 +671,7 @@ static int svc_export_show(struct seq_file *m,
670 seq_printf(m, "%02x", exp->ex_uuid[i]); 671 seq_printf(m, "%02x", exp->ex_uuid[i]);
671 } 672 }
672 } 673 }
674 show_secinfo(m, exp);
673 } 675 }
674 seq_puts(m, ")\n"); 676 seq_puts(m, ")\n");
675 return 0; 677 return 0;
@@ -1467,6 +1469,33 @@ static void show_expflags(struct seq_file *m, int flags, int mask)
1467 } 1469 }
1468} 1470}
1469 1471
1472static void show_secinfo_flags(struct seq_file *m, int flags)
1473{
1474 seq_printf(m, ",");
1475 show_expflags(m, flags, NFSEXP_SECINFO_FLAGS);
1476}
1477
1478static void show_secinfo(struct seq_file *m, struct svc_export *exp)
1479{
1480 struct exp_flavor_info *f;
1481 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
1482 int lastflags = 0, first = 0;
1483
1484 if (exp->ex_nflavors == 0)
1485 return;
1486 for (f = exp->ex_flavors; f < end; f++) {
1487 if (first || f->flags != lastflags) {
1488 if (!first)
1489 show_secinfo_flags(m, lastflags);
1490 seq_printf(m, ",sec=%d", f->pseudoflavor);
1491 lastflags = f->flags;
1492 } else {
1493 seq_printf(m, ":%d", f->pseudoflavor);
1494 }
1495 }
1496 show_secinfo_flags(m, lastflags);
1497}
1498
1470static void exp_flags(struct seq_file *m, int flag, int fsid, 1499static void exp_flags(struct seq_file *m, int flag, int fsid,
1471 uid_t anonu, uid_t anong, struct nfsd4_fs_locations *fsloc) 1500 uid_t anonu, uid_t anong, struct nfsd4_fs_locations *fsloc)
1472{ 1501{