nfscl: Add support for a NFSv4 AppendWrite RPC
For IO_APPEND VOP_WRITE()s, the code first does a Getattr RPC to acquire the file's size, before it can do the Write RPC. Although NFS does not have an append write operation, an NFSv4 compound can use a Verify operation to check that the client's notion of the file's size is correct before doing the Write operation. This patch prepares the NFSv4 client for such an RPC, which will be added in a future commit. This patch does not cause any semantics change.
This commit is contained in:
parent
79c4c4be96
commit
330aa8acde
@ -598,7 +598,7 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
|
||||
nfsstatsv1.biocache_readdirs;
|
||||
nfsstatsov1.readdir_bios =
|
||||
nfsstatsv1.readdir_bios;
|
||||
for (i = 0; i < NFSV42_NPROCS; i++)
|
||||
for (i = 0; i < NFSV42_OLDNPROCS; i++)
|
||||
nfsstatsov1.rpccnt[i] =
|
||||
nfsstatsv1.rpccnt[i];
|
||||
nfsstatsov1.rpcretries =
|
||||
|
@ -150,7 +150,7 @@ struct nfsv4_opflag nfsv4_opflag[NFSV42_NOPS] = {
|
||||
{ 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 }, /* Setattr */
|
||||
{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* SetClientID */
|
||||
{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* SetClientIDConfirm */
|
||||
{ 0, 1, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Verify */
|
||||
{ 0, 2, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Verify (AppWrite) */
|
||||
{ 0, 2, 1, 1, LK_EXCLUSIVE, 1, 0 }, /* Write */
|
||||
{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* ReleaseLockOwner */
|
||||
{ 0, 0, 0, 0, LK_EXCLUSIVE, 1, 1 }, /* Backchannel Ctrl */
|
||||
@ -215,7 +215,7 @@ static struct nfsrv_lughash *nfsgroupnamehash;
|
||||
static int nfs_bigreply[NFSV42_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 1, 0, 0, 0, 0 };
|
||||
1, 0, 0, 1, 0, 0, 0, 0, 0 };
|
||||
|
||||
/* local functions */
|
||||
static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep);
|
||||
@ -303,6 +303,7 @@ static struct {
|
||||
{ NFSV4OP_LOOKUP, 5, "LookupOpen", 10, },
|
||||
{ NFSV4OP_DEALLOCATE, 2, "Deallocate", 10, },
|
||||
{ NFSV4OP_LAYOUTERROR, 1, "LayoutError", 11, },
|
||||
{ NFSV4OP_VERIFY, 3, "AppendWrite", 11, },
|
||||
};
|
||||
|
||||
/*
|
||||
@ -312,7 +313,7 @@ static int nfs_bigrequest[NFSV42_NPROCS] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0
|
||||
0, 1
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -424,10 +424,16 @@
|
||||
/* Do an NFSv4.2 LayoutError. */
|
||||
#define NFSPROC_LAYOUTERROR 68
|
||||
|
||||
/* Do an NFSv4 Verify+Write. */
|
||||
#define NFSPROC_APPENDWRITE 69
|
||||
|
||||
/*
|
||||
* Must be defined as one higher than the last NFSv4.2 Proc# above.
|
||||
*/
|
||||
#define NFSV42_NPROCS 69
|
||||
#define NFSV42_NPROCS 70
|
||||
|
||||
/* Value of NFSV42_NPROCS for old nfsstats structure. (Always 69) */
|
||||
#define NFSV42_OLDNPROCS 69
|
||||
|
||||
#endif /* NFS_V3NPROCS */
|
||||
|
||||
@ -456,7 +462,7 @@ struct nfsstatsv1 {
|
||||
uint64_t readlink_bios;
|
||||
uint64_t biocache_readdirs;
|
||||
uint64_t readdir_bios;
|
||||
uint64_t rpccnt[NFSV42_NPROCS + 11];
|
||||
uint64_t rpccnt[NFSV42_NPROCS + 10];
|
||||
uint64_t rpcretries;
|
||||
uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15];
|
||||
uint64_t srvlayouts;
|
||||
@ -521,7 +527,7 @@ struct nfsstatsov1 {
|
||||
uint64_t readlink_bios;
|
||||
uint64_t biocache_readdirs;
|
||||
uint64_t readdir_bios;
|
||||
uint64_t rpccnt[NFSV42_NPROCS];
|
||||
uint64_t rpccnt[NFSV42_OLDNPROCS];
|
||||
uint64_t rpcretries;
|
||||
uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS];
|
||||
uint64_t reserved_0;
|
||||
|
@ -405,10 +405,13 @@
|
||||
/* Do an NFSv4.2 LayoutError. */
|
||||
#define NFSPROC_LAYOUTERROR 68
|
||||
|
||||
/* Do an NFSv4 Verify+Write. */
|
||||
#define NFSPROC_APPENDWRITE 69
|
||||
|
||||
/*
|
||||
* Must be defined as one higher than the last NFSv4.2 Proc# above.
|
||||
*/
|
||||
#define NFSV42_NPROCS 69
|
||||
#define NFSV42_NPROCS 70
|
||||
|
||||
#endif /* NFS_V3NPROCS */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user