summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-01-28nfsd: cstate->session->se_client -> cstate->clpJ. Bruce Fields2-11/+10
I'm not sure why we're writing this out the hard way in so many places. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-28nfsd: simplify nfsd4_check_open_reclaimJ. Bruce Fields3-19/+5
The set_client() was already taken care of by process_open1(). The comments here are mostly redundant with the code. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-28nfsd: remove unused set_client argumentJ. Bruce Fields1-13/+10
Every caller is setting this argument to false, so we don't need it. Also cut this comment a bit and remove an unnecessary warning. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: find_cpntf_state cleanupJ. Bruce Fields1-8/+14
I think this unusual use of struct compound_state could cause confusion. It's not that much more complicated just to open-code this stateid lookup. The only change in behavior should be a different error return in the case the copy is using a source stateid that is a revoked delegation, but I doubt that matters. Signed-off-by: J. Bruce Fields <bfields@redhat.com> [ cel: squashed in fix reported by Coverity ] Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: refactor set_clientJ. Bruce Fields1-16/+16
This'll be useful elsewhere. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: rename lookup_clientid->set_clientJ. Bruce Fields1-10/+8
I think this is a better name, and I'm going to reuse elsewhere the code that does the lookup itself. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: simplify nfsd_renewJ. Bruce Fields1-6/+3
You can take the single-exit thing too far, I think. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: simplify process_lockJ. Bruce Fields1-4/+0
Similarly, this STALE_CLIENTID check is already handled by: nfs4_preprocess_confirmed_seqid_op()-> nfs4_preprocess_seqid_op()-> nfsd4_lookup_stateid()-> set_client()-> STALE_CLIENTID() (This may cause it to return a different error in some cases where there are multiple things wrong; pynfs test SEQ10 regressed on this commit because of that, but I think that's the test's fault, and I've fixed it separately.) Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd4: simplify process_lookup1J. Bruce Fields1-2/+0
This STALE_CLIENTID check is redundant with the one in lookup_clientid(). There's a difference in behavior is in case of memory allocation failure, which I think isn't a big deal. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25SUNRPC: Correct a commentChuck Lever1-1/+1
Clean up: The rq_argpages field was removed from struct svc_rqst in the pre-git era. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25svcrdma: DMA-sync the receive buffer in svc_rdma_recvfrom()Chuck Lever1-3/+3
The Receive completion handler doesn't look at the contents of the Receive buffer. The DMA sync isn't terribly expensive but it's one less thing that needs to be done by the Receive completion handler, which is single-threaded (per svc_xprt). This helps scalability. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2021-01-25svcrdma: Reduce Receive doorbell rateChuck Lever2-39/+44
This is similar to commit e340c2d6ef2a ("xprtrdma: Reduce the doorbell rate (Receive)") which added Receive batching to the client. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25svcrdma: Deprecate stat variables that are no longer usedChuck Lever2-62/+27
Clean up. We are not permitted to remove old proc files. Instead, convert these variables to stubs that are only ever allowed to display a value of zero. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25svcrdma: Restore read and write statsChuck Lever3-10/+22
Now that we have an efficient mechanism to update these two stats, let's start maintaining them again. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25svcrdma: Convert rdma_stat_sq_starve to a per-CPU counterChuck Lever4-6/+12
Avoid the overhead of a memory bus lock cycle for counting a value that is hardly every used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25svcrdma: Convert rdma_stat_recv to a per-CPU counterChuck Lever3-7/+54
Receives are frequent events. Avoid the overhead of a memory bus lock cycle for counting a value that is hardly every used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25svcrdma: Refactor svc_rdma_init() and svc_rdma_clean_up()Chuck Lever1-7/+23
Setting up the proc variables is about to get more complicated. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: report per-export statsAmir Goldstein7-16/+92
Collect some nfsd stats per export in addition to the global stats. A new nfsdfs export_stats file is created. It uses the same ops as the exports file to iterate the export entries and we use the file's name to determine the reported info per export. For example: $ cat /proc/fs/nfsd/export_stats # Version 1.1 # Path Client Start-time # Stats /test localhost 92 fh_stale: 0 io_read: 9 io_write: 1 Every export entry reports the start time when stats collection started, so stats collecting scripts can know if stats where reset between samples. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: protect concurrent access to nfsd stats countersAmir Goldstein8-53/+192
nfsd stats counters can be updated by concurrent nfsd threads without any protection. Convert some nfsd_stats and nfsd_net struct members to use percpu counters. The longest_chain* members of struct nfsd_net remain unprotected. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25nfsd: remove unused stats countersAmir Goldstein2-35/+16
Commit 501cb1849f86 ("nfsd: rip out the raparms cache") removed the code that updates read-ahead cache stats counters, commit 8bbfa9f3889b ("knfsd: remove the nfsd thread busy histogram") removed code that updates the thread busy stats counters back in 2009 and code that updated filehandle cache stats was removed back in 2002. Remove the unused stats counters from nfsd_stats struct and print hardcoded zeros in /proc/net/rpc/nfsd. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Clean up after updating NFSv3 ACL decodersChuck Lever2-22/+0
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 SETACL argument decoder to use struct xdr_streamChuck Lever1-18/+13
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv3 GETACL argument decoder to use struct xdr_streamChuck Lever3-6/+17
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Clean up after updating NFSv2 ACL decodersChuck Lever2-19/+0
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 ACL ACCESS argument decoder to use struct xdr_streamChuck Lever1-5/+6
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 ACL GETATTR argument decoder to use struct xdr_streamChuck Lever1-11/+1
Since the ACL GETATTR procedure is the same as the normal GETATTR procedure, simply re-use nfssvc_decode_fhandleargs. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 SETACL argument decoder to use struct xdr_streamChuck Lever2-18/+13
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Add an xdr_stream-based decoder for NFSv2/3 ACLsChuck Lever2-0/+55
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 GETACL argument decoder to use struct xdr_streamChuck Lever4-7/+17
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Remove argument length checking in nfsd_dispatch()Chuck Lever1-34/+0
Now that the argument decoders for NFSv2 and NFSv3 use the xdr_stream mechanism, the version-specific length checking logic in nfsd_dispatch() is no longer necessary. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 SYMLINK argument decoder to use struct xdr_streamChuck Lever1-103/+10
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 CREATE argument decoder to use struct xdr_streamChuck Lever1-6/+4
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 SETATTR argument decoder to use struct xdr_streamChuck Lever1-6/+76
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 LINK argument decoder to use struct xdr_streamChuck Lever1-6/+4
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 RENAME argument decoder to use struct xdr_streamChuck Lever1-7/+5
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update NFSv2 diropargs decoding to use struct xdr_streamChuck Lever1-5/+34
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 READDIR argument decoder to use struct xdr_streamChuck Lever1-5/+7
As an additional clean up, move code not related to XDR decoding into readdir's .pc_func call out. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Add helper to set up the pages where the dirlist is encodedChuck Lever3-14/+18
Add a helper similar to nfsd3_init_dirlist_pages(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 READLINK argument decoder to use struct xdr_streamChuck Lever3-23/+5
If the code that sets up the sink buffer for nfsd_readlink() is moved adjacent to the nfsd_readlink() call site that uses it, then the only argument is a file handle, and the fhandle decoder can be used instead. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 WRITE argument decoder to use struct xdr_streamChuck Lever1-31/+21
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 READ argument decoder to use struct xdr_streamChuck Lever3-39/+30
The code that sets up rq_vec is refactored so that it is now adjacent to the nfsd_read() call site where it is used. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv2 GETATTR argument decoder to use struct xdr_streamChuck Lever3-9/+23
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the MKNOD3args decoder to use struct xdr_streamChuck Lever1-72/+35
This commit removes the last usage of the original decode_sattr3(), so it is removed as a clean-up. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the SYMLINK3args decoder to use struct xdr_streamChuck Lever1-13/+16
Similar to the WRITE decoder, code that checks the sanity of the payload size is re-wired to work with xdr_stream infrastructure. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the MKDIR3args decoder to use struct xdr_streamChuck Lever1-6/+4
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the CREATE3args decoder to use struct xdr_streamChuck Lever1-10/+10
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the SETATTR3args decoder to use struct xdr_streamChuck Lever2-17/+127
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the LINK3args decoder to use struct xdr_streamChuck Lever1-6/+4
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the RENAME3args decoder to use struct xdr_streamChuck Lever1-7/+5
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2021-01-25NFSD: Update the NFSv3 DIROPargs decoder to use struct xdr_streamChuck Lever1-5/+35
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>