kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions. The main reason is that our having to use the MB_WAIT and MB_DONTWAIT flags was a recurring issue when porting drivers from FreeBSD because it tended to get forgotten and the code would compile anyway with the wrong constants. And since MB_WAIT and MB_DONTWAIT ended up as ocflags for an objcache_get() or objcache_reclaimlist call (which use M_WAITOK and M_NOWAIT), it was just one big converting back and forth with some sanitization in between. This commit allows M_* again for the mbuf functions and keeps the sanitizing as it was before: when M_WAITOK is among the passed flags, objcache functions will be called with M_WAITOK and when it is absent, they will be called with M_NOWAIT. All other flags are scrubbed by the MB_OCFLAG() macro which does the same as the former MBTOM(). Approved-by: dillon
NFS server: Import various fixes from FreeBSD. * Rev 228520: Honor NFSv3 commit call when count = 0. (delphij) * Rev 228185: Enhance sequential access heuristic used for readahead and reuse it for writes as well. * Use a prime number for sequential detection table * Factor our sequential detection code * Ramp up sequential heurstic quickly based on IO size. This patch differs from the FreeBSD version in that we rapidly decay the sequential heuristic as in the original code and don't attempt to deal with reordered RPCs. * Rev 159871: Size the NFS server dupreq cache on the basis of nmbclusters. This patch differs from the FreeBSD version in that we don't alter the desired cache size based on nmbcluster change events. * Rev 116789: Bug in nfsrv_read() that caused the replies to certain NFSv3 short read operations at the end of a file to not have the "eof" flag set. (iedowse)
kernel - Fix NFS client & server bugs * A very long standing bug in the server cache was finally whacked. The write-gather code was improperly returning the wrong mbuf for the server to reply with, causing client stalls. This behavior depends on the client doing burst asynchronous writes. Newer releases of DragonFly do burst asynchronous writes but older ones tended not to. * The server cache was not MPSAFE. Add a MP token to fix that. * Remove critical sectons from the server cache which are no longer needed. * Fix a potential client-side rpc request race where a request's NEEDSXMIT flag is not set until after the request possibly blocks, which can lead to issues if another thread picks up the request and then believes that it has already been transmitted when it has not. * Document a big problem with NFSv2 and HAMMER-served directories. NFSv2 only has 32-bit directory cookies. It is possible to work around the problem by using rdirplus (which is the default now). However, some servers may not be able to handle rdirplus with a NFSv2 mount. Users who need to serve out NFSv2 cannot serve HAMMER directories with NFSv2 unless the clients support rdirplus. Our defaults are NFSv3 and rdirplus and NFSv3 does NOT have this problem. Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
Remove NQNFS support. The mechanisms are too crude to co-exist with upcoming cache coherency management work and the original implementation hacked up the NFS code pretty severely. Move nqnfs_clientd() out of nfs_nqlease.c to a new file, nfs_kerb.c, and rename it nfs_clientd().
Remove the canwait argument to dup_sockaddr(). Callers of dup_sockaddr() all assume that it just works, so it really has to work. Since interrupts are now threads we can use M_INTWAIT. While it is possible that a memory deadlock issue exists here (e.g. if swapping over NFS), it isn't likely in this case.