aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index b8eda700584b..056138d45c11 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -88,6 +88,7 @@ enum {
88 Opt_sharecache, Opt_nosharecache, 88 Opt_sharecache, Opt_nosharecache,
89 Opt_resvport, Opt_noresvport, 89 Opt_resvport, Opt_noresvport,
90 Opt_fscache, Opt_nofscache, 90 Opt_fscache, Opt_nofscache,
91 Opt_migration, Opt_nomigration,
91 92
92 /* Mount options that take integer arguments */ 93 /* Mount options that take integer arguments */
93 Opt_port, 94 Opt_port,
@@ -147,6 +148,8 @@ static const match_table_t nfs_mount_option_tokens = {
147 { Opt_noresvport, "noresvport" }, 148 { Opt_noresvport, "noresvport" },
148 { Opt_fscache, "fsc" }, 149 { Opt_fscache, "fsc" },
149 { Opt_nofscache, "nofsc" }, 150 { Opt_nofscache, "nofsc" },
151 { Opt_migration, "migration" },
152 { Opt_nomigration, "nomigration" },
150 153
151 { Opt_port, "port=%s" }, 154 { Opt_port, "port=%s" },
152 { Opt_rsize, "rsize=%s" }, 155 { Opt_rsize, "rsize=%s" },
@@ -676,6 +679,9 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
676 if (nfss->options & NFS_OPTION_FSCACHE) 679 if (nfss->options & NFS_OPTION_FSCACHE)
677 seq_printf(m, ",fsc"); 680 seq_printf(m, ",fsc");
678 681
682 if (nfss->options & NFS_OPTION_MIGRATION)
683 seq_printf(m, ",migration");
684
679 if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) { 685 if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) {
680 if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE) 686 if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
681 seq_printf(m, ",lookupcache=none"); 687 seq_printf(m, ",lookupcache=none");
@@ -1243,6 +1249,12 @@ static int nfs_parse_mount_options(char *raw,
1243 kfree(mnt->fscache_uniq); 1249 kfree(mnt->fscache_uniq);
1244 mnt->fscache_uniq = NULL; 1250 mnt->fscache_uniq = NULL;
1245 break; 1251 break;
1252 case Opt_migration:
1253 mnt->options |= NFS_OPTION_MIGRATION;
1254 break;
1255 case Opt_nomigration:
1256 mnt->options &= NFS_OPTION_MIGRATION;
1257 break;
1246 1258
1247 /* 1259 /*
1248 * options that take numeric values 1260 * options that take numeric values
@@ -1535,6 +1547,10 @@ static int nfs_parse_mount_options(char *raw,
1535 if (mnt->minorversion && mnt->version != 4) 1547 if (mnt->minorversion && mnt->version != 4)
1536 goto out_minorversion_mismatch; 1548 goto out_minorversion_mismatch;
1537 1549
1550 if (mnt->options & NFS_OPTION_MIGRATION &&
1551 mnt->version != 4 && mnt->minorversion != 0)
1552 goto out_migration_misuse;
1553
1538 /* 1554 /*
1539 * verify that any proto=/mountproto= options match the address 1555 * verify that any proto=/mountproto= options match the address
1540 * familiies in the addr=/mountaddr= options. 1556 * familiies in the addr=/mountaddr= options.
@@ -1572,6 +1588,10 @@ out_minorversion_mismatch:
1572 printk(KERN_INFO "NFS: mount option vers=%u does not support " 1588 printk(KERN_INFO "NFS: mount option vers=%u does not support "
1573 "minorversion=%u\n", mnt->version, mnt->minorversion); 1589 "minorversion=%u\n", mnt->version, mnt->minorversion);
1574 return 0; 1590 return 0;
1591out_migration_misuse:
1592 printk(KERN_INFO
1593 "NFS: 'migration' not supported for this NFS version\n");
1594 return 0;
1575out_nomem: 1595out_nomem:
1576 printk(KERN_INFO "NFS: not enough memory to parse option\n"); 1596 printk(KERN_INFO "NFS: not enough memory to parse option\n");
1577 return 0; 1597 return 0;