aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/export.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 323cbdcc9bfd..06d5cd4a52c4 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1453,28 +1453,35 @@ static struct flags {
1453 { 0, {"", ""}} 1453 { 0, {"", ""}}
1454}; 1454};
1455 1455
1456static void exp_flags(struct seq_file *m, int flag, int fsid, 1456static void show_expflags(struct seq_file *m, int flags, int mask)
1457 uid_t anonu, uid_t anong, struct nfsd4_fs_locations *fsloc)
1458{ 1457{
1459 int first = 0;
1460 struct flags *flg; 1458 struct flags *flg;
1459 int state, first = 0;
1461 1460
1462 for (flg = expflags; flg->flag; flg++) { 1461 for (flg = expflags; flg->flag; flg++) {
1463 int state = (flg->flag & flag)?0:1; 1462 if (flg->flag & ~mask)
1463 continue;
1464 state = (flg->flag & flags) ? 0 : 1;
1464 if (*flg->name[state]) 1465 if (*flg->name[state])
1465 seq_printf(m, "%s%s", first++?",":"", flg->name[state]); 1466 seq_printf(m, "%s%s", first++?",":"", flg->name[state]);
1466 } 1467 }
1468}
1469
1470static void exp_flags(struct seq_file *m, int flag, int fsid,
1471 uid_t anonu, uid_t anong, struct nfsd4_fs_locations *fsloc)
1472{
1473 show_expflags(m, flag, NFSEXP_ALLFLAGS);
1467 if (flag & NFSEXP_FSID) 1474 if (flag & NFSEXP_FSID)
1468 seq_printf(m, "%sfsid=%d", first++?",":"", fsid); 1475 seq_printf(m, ",fsid=%d", fsid);
1469 if (anonu != (uid_t)-2 && anonu != (0x10000-2)) 1476 if (anonu != (uid_t)-2 && anonu != (0x10000-2))
1470 seq_printf(m, "%sanonuid=%d", first++?",":"", anonu); 1477 seq_printf(m, ",sanonuid=%d", anonu);
1471 if (anong != (gid_t)-2 && anong != (0x10000-2)) 1478 if (anong != (gid_t)-2 && anong != (0x10000-2))
1472 seq_printf(m, "%sanongid=%d", first++?",":"", anong); 1479 seq_printf(m, ",sanongid=%d", anong);
1473 if (fsloc && fsloc->locations_count > 0) { 1480 if (fsloc && fsloc->locations_count > 0) {
1474 char *loctype = (fsloc->migrated) ? "refer" : "replicas"; 1481 char *loctype = (fsloc->migrated) ? "refer" : "replicas";
1475 int i; 1482 int i;
1476 1483
1477 seq_printf(m, "%s%s=", first++?",":"", loctype); 1484 seq_printf(m, ",%s=", loctype);
1478 seq_escape(m, fsloc->locations[0].path, ",;@ \t\n\\"); 1485 seq_escape(m, fsloc->locations[0].path, ",;@ \t\n\\");
1479 seq_putc(m, '@'); 1486 seq_putc(m, '@');
1480 seq_escape(m, fsloc->locations[0].hosts, ",;@ \t\n\\"); 1487 seq_escape(m, fsloc->locations[0].hosts, ",;@ \t\n\\");