diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2017-05-08 21:29:29 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2017-05-08 21:29:29 +0000 |
commit | 60b322ba95cfd0dbf6eb6dc81b6ae628c1323a93 (patch) | |
tree | f0940d48bc5cd45c5a8285590050b31ba21bca4e /sys/fs/nfs/nfsport.h | |
parent | 9bc82128d57d119fc66b19a41aac9c04e3729414 (diff) | |
download | FreeBSD-src-60b322ba95cfd0dbf6eb6dc81b6ae628c1323a93.zip FreeBSD-src-60b322ba95cfd0dbf6eb6dc81b6ae628c1323a93.tar.gz |
MFC: r317345
Make the NFSv4 client to use a write open for reading if allowed by the server.
An NFSv4 server has the option of allowing a Read to be done using a Write
Open. If this is not allowed, the server will return NFSERR_OPENMODE.
This patch attempts the read with a write open and then disables this
if the server replies NFSERR_OPENMODE.
This change will avoid some uses of the special stateids. This will be
useful for pNFS/DS Reads, since they cannot use special stateids.
It will also be useful for any NFSv4 server that does not support reading
via the special stateids. It has been tested against both types of NFSv4 server.
Diffstat (limited to 'sys/fs/nfs/nfsport.h')
-rw-r--r-- | sys/fs/nfs/nfsport.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 8c43f3f..8bd0f9e 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -899,6 +899,7 @@ int newnfs_realign(struct mbuf **, int); */ #define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier */ #define NFSSTA_GOTFSINFO 0x00100000 /* Got the fsinfo */ +#define NFSSTA_OPENMODE 0x00200000 /* Must use correct open mode */ #define NFSSTA_NOLAYOUTCOMMIT 0x04000000 /* Don't do LayoutCommit */ #define NFSSTA_SESSPERSIST 0x08000000 /* Has a persistent session */ #define NFSSTA_TIMEO 0x10000000 /* Experiencing a timeout */ @@ -929,6 +930,7 @@ int newnfs_realign(struct mbuf **, int); #define NFSHASNOLAYOUTCOMMIT(n) ((n)->nm_state & NFSSTA_NOLAYOUTCOMMIT) #define NFSHASSESSPERSIST(n) ((n)->nm_state & NFSSTA_SESSPERSIST) #define NFSHASPNFS(n) ((n)->nm_state & NFSSTA_PNFS) +#define NFSHASOPENMODE(n) ((n)->nm_state & NFSSTA_OPENMODE) #define NFSHASONEOPENOWN(n) (((n)->nm_flag & NFSMNT_ONEOPENOWN) != 0 && \ (n)->nm_minorvers > 0) |