@@ -998,6 +998,9 @@ static int nfs4_server_common_setup(struct nfs_server *server,
server->caps |= server->nfs_client->cl_mvops->init_caps;
if (server->flags & NFS_MOUNT_NORDIRPLUS)
server->caps &= ~NFS_CAP_READDIRPLUS;
+ if (server->options & NFS_OPTION_NO_READ_PLUS)
+ server->caps &= ~NFS_CAP_READ_PLUS;
+
/*
* Don't use NFS uid/gid mapping if we're using AUTH_SYS or lower
* authentication.
@@ -90,6 +90,7 @@ enum {
Opt_resvport, Opt_noresvport,
Opt_fscache, Opt_nofscache,
Opt_migration, Opt_nomigration,
+ Opt_readplus, Opt_noreadplus,
/* Mount options that take integer arguments */
Opt_port,
@@ -151,6 +152,8 @@ static const match_table_t nfs_mount_option_tokens = {
{ Opt_nofscache, "nofsc" },
{ Opt_migration, "migration" },
{ Opt_nomigration, "nomigration" },
+ { Opt_readplus, "readplus" },
+ { Opt_noreadplus, "noreadplus" },
{ Opt_port, "port=%s" },
{ Opt_rsize, "rsize=%s" },
@@ -690,6 +693,11 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
if (nfss->options & NFS_OPTION_MIGRATION)
seq_printf(m, ",migration");
+ if (nfss->options & NFS_OPTION_NO_READ_PLUS)
+ seq_printf(m,",noreadplus");
+ else
+ seq_printf(m,",readplus");
+
if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) {
if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
seq_printf(m, ",lookupcache=none");
@@ -1324,6 +1332,12 @@ static int nfs_parse_mount_options(char *raw,
case Opt_nomigration:
mnt->options &= ~NFS_OPTION_MIGRATION;
break;
+ case Opt_readplus:
+ mnt->options &= ~NFS_OPTION_NO_READ_PLUS;
+ break;
+ case Opt_noreadplus:
+ mnt->options |= NFS_OPTION_NO_READ_PLUS;
+ break;
/*
* options that take numeric values
@@ -1626,6 +1640,9 @@ static int nfs_parse_mount_options(char *raw,
if (mnt->options & NFS_OPTION_MIGRATION &&
(mnt->version != 4 || mnt->minorversion != 0))
goto out_migration_misuse;
+ if (mnt->options & NFS_OPTION_NO_READ_PLUS &&
+ (mnt->version != 4 || mnt->minorversion < 2))
+ goto out_noreadplus_misuse;
/*
* verify that any proto=/mountproto= options match the address
@@ -1668,6 +1685,10 @@ static int nfs_parse_mount_options(char *raw,
printk(KERN_INFO
"NFS: 'migration' not supported for this NFS version\n");
return 0;
+out_noreadplus_misuse:
+ printk(KERN_INFO
+ "NFS: 'noreadplus' not supported for this NFS version\n");
+ return 0;
out_nomem:
printk(KERN_INFO "NFS: not enough memory to parse option\n");
return 0;
@@ -535,10 +535,10 @@ enum {
NFSPROC4_CLNT_LAYOUTSTATS,
NFSPROC4_CLNT_CLONE,
NFSPROC4_CLNT_COPY,
- NFSPROC4_CLNT_OFFLOAD_CANCEL,
- NFSPROC4_CLNT_READ_PLUS,
NFSPROC4_CLNT_LOOKUPP,
+ NFSPROC4_CLNT_OFFLOAD_CANCEL,
+ NFSPROC4_CLNT_READ_PLUS,
};
/* nfs41 types */
@@ -157,6 +157,7 @@ struct nfs_server {
unsigned int clone_blksize; /* granularity of a CLONE operation */
#define NFS_OPTION_FSCACHE 0x00000001 /* - local caching enabled */
#define NFS_OPTION_MIGRATION 0x00000002 /* - NFSv4 migration enabled */
+#define NFS_OPTION_NO_READ_PLUS 0x00000004 /* - NFSv4.2 READ_PLUS enabled */
struct nfs_fsid fsid;
__u64 maxfilesize; /* maximum file size */