Lines Matching +full:test2 +full:. +full:zeros

5  *	The Regents of the University of California.  All rights reserved.
8 * Rick Macklem at The University of Guelph.
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
20 * without specific prior written permission.
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 * SUCH DAMAGE.
36 #include <sys/cdefs.h>
39 * the nfs op functions. They do things like create the rpc header and
40 * copy data between mbuf chains and uio lists.
42 #include "opt_inet.h"
43 #include "opt_inet6.h"
45 #include <fs/nfs/nfsport.h>
46 #include <fs/nfsclient/nfsmount.h>
48 #include <sys/extattr.h>
50 #include <security/mac/mac_framework.h>
52 #include <vm/vm_param.h>
115 * non-idempotent Ops.
116 * Define it here, since it is used by both the client and server.
214 * reply. This is used by nfs_reply() to decide whether or not an mbuf
215 * cluster should be allocated. (If a cluster is required by an RPC
217 * efficiently.)
313 * NFS RPCS that have large request message size.
323 * Start building a request. Mostly just put the first file handle in
324 * place.
337 * First, fill in some of the fields of nd. in nfscl_reqstart()
365 * Get the first mbuf for the request. in nfscl_reqstart()
375 /* For NFSPROC_NULL, there are no arguments. */ in nfscl_reqstart()
380 * And fill the first file handle into the request. in nfscl_reqstart()
383 opcnt = nfsv4_opmap[procnum].opcnt + in nfscl_reqstart()
384 nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh; in nfscl_reqstart()
386 opcnt += nfsv4_opflag[nfsv4_opmap[procnum].op].needsseq; in nfscl_reqstart()
390 * Sequence Op. in nfscl_reqstart()
398 * Write/Commit. in nfscl_reqstart()
405 (void) nfsm_strtom(nd, nfsv4_opmap[procnum].tag, in nfscl_reqstart()
406 nfsv4_opmap[procnum].taglen); in nfscl_reqstart()
418 nfsv4_opflag[nfsv4_opmap[procnum].op].needsseq > 0) { in nfscl_reqstart()
419 if (nfsv4_opflag[nfsv4_opmap[procnum].op].loopbadsess > in nfscl_reqstart()
428 * slots. If the caller does not want this in nfscl_reqstart()
430 * be passed in as NULL. in nfscl_reqstart()
438 if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh > 0) { in nfscl_reqstart()
442 if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh in nfscl_reqstart()
449 * attributes, so we can load the name cache. in nfscl_reqstart()
457 /* For AppendWrite, get the size. */ in nfscl_reqstart()
469 *tl = txdr_unsigned(nfsv4_opmap[procnum].op); in nfscl_reqstart()
476 NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); in nfscl_reqstart()
480 * Put a state Id in the mbuf list.
512 * Fill in the setable attributes. The full argument indicates whether
513 * to fill in them all or just mode and time.
583 if (vap->va_atime.tv_sec != VNOVAL) { in nfscl_fillsattr()
596 if (vap->va_mtime.tv_sec != VNOVAL) { in nfscl_fillsattr()
617 NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, in nfscl_fillsattr()
630 if (vap->va_atime.tv_sec != VNOVAL) in nfscl_fillsattr()
632 if (vap->va_mtime.tv_sec != VNOVAL) in nfscl_fillsattr()
636 * the "vp" argument is for an NFS vnode. in nfscl_fillsattr()
638 if (vap->va_birthtime.tv_sec != VNOVAL && np != NULL && in nfscl_fillsattr()
639 NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, in nfscl_fillsattr()
727 * pointed to by returned val.
729 * cases.
792 * Advance the position in the mbuf chain.
794 * here than check for offs > 0 for all calls to nfsm_advance.
795 * If left == -1, it should be calculated here.
806 * as such, a printf is logged. in nfsm_advance()
815 * If left == -1, calculate it here. in nfsm_advance()
822 * Loop around, advancing over the mbuf data. in nfsm_advance()
842 * Copy a string into mbuf(s).
843 * Return the number of bytes output, including XDR overheads.
872 * Loop around copying the string to mbuf(s). in nfsm_strtom()
929 * Called once to initialize data structures...
955 * Put a file handle in an mbuf list.
956 * If the size argument == 0, just use the default size.
957 * set_true == 1 if there should be an newnfs_true prepended on the file handle.
958 * Return the number of bytes output, including XDR overhead.
1005 * if they are the same host.
1006 * If there is any doubt, return FALSE.
1008 * don't need to be saved to store "struct in_addr", which is only 4 bytes.
1022 inetaddr->sin_addr.s_addr == haddr->had_inet.s_addr) in nfsaddr_match()
1045 * Similar to the above, but takes to NFSSOCKADDR_T args.
1059 addr1->sin_addr.s_addr == addr2->sin_addr.s_addr) in nfsaddr2_match()
1082 * Dissect a file handle on the client.
1116 * Break down the nfsv4 acl.
1117 * If the aclp == NULL or won't fit in an acl, just discard the acl info.
1132 * what can be supported by R/W/X bits. in nfsrv_dissectacl()
1139 * an ACL, but 10240 should be more than sufficient. in nfsrv_dissectacl()
1171 * Skip over an NFSv4 ace entry. Just dissect the xdr and discard it.
1189 * Get attribute bits from an mbuf list.
1190 * Returns EBADRPC for a parsing error, 0 otherwise.
1191 * If the clearinvalid flag is set, clear the bits not supported.
1230 * Get operation bits from an mbuf list.
1231 * Returns EBADRPC for a parsing error, 0 otherwise.
1271 * Get the attributes for V4.
1273 * otherwise return the attribute values.
1275 * "struct nfsfsinfo", the file handle and the lease duration.
1277 * and 0 otherwise.
1278 * Returns EBADRPC if it can't be parsed, 0 otherwise.
1321 * Just set default values to some of the important ones. in nfsv4_loadattr()
1328 nap->na_mtime.tv_sec = 0; in nfsv4_loadattr()
1329 nap->na_mtime.tv_nsec = 0; in nfsv4_loadattr()
1330 nap->na_btime.tv_sec = -1; in nfsv4_loadattr()
1331 nap->na_btime.tv_nsec = 0; in nfsv4_loadattr()
1353 fsp->fs_timedelta.tv_sec = 0; in nfsv4_loadattr()
1354 fsp->fs_timedelta.tv_nsec = 1; in nfsv4_loadattr()
1377 * Loop around getting the attributes. in nfsv4_loadattr()
1513 vp->v_mount->mnt_stat.f_fsid.val[0] || in nfsv4_loadattr()
1515 vp->v_mount->mnt_stat.f_fsid.val[1]) in nfsv4_loadattr()
1782 tnfsquad.qval = fxdr_hyper(tl); in nfsv4_loadattr()
1786 if (tquad != tnfsquad.qval) in nfsv4_loadattr()
1790 fsp->fs_maxfilesize = tnfsquad.qval; in nfsv4_loadattr()
1819 * NFS_MAXNAMLEN. If a server actually creates in nfsv4_loadattr()
1821 * get an error back. in nfsv4_loadattr()
1987 * we'll just make sure that's the case. in nfsv4_loadattr()
1993 freenum = min(dqb.dqb_bhardlimit, freenum); in nfsv4_loadattr()
2016 * we'll just make sure that's the case. in nfsv4_loadattr()
2022 freenum = min(dqb.dqb_bsoftlimit, freenum); in nfsv4_loadattr()
2042 * we'll just make sure that's the case. in nfsv4_loadattr()
2048 freenum = dqb.dqb_curblocks; in nfsv4_loadattr()
2181 if ((u_int32_t)fsp->fs_timedelta.tv_sec != in nfsv4_loadattr()
2183 (u_int32_t)fsp->fs_timedelta.tv_nsec != in nfsv4_loadattr()
2271 * than enough. in nfsv4_loadattr()
2330 * the unknown attribute data. in nfsv4_loadattr()
2339 * padding. in nfsv4_loadattr()
2355 * Implement sleep locks for newnfs. The nfslock_usecnt allows for a
2356 * shared lock and the NFSXXX_LOCK flag permits an exclusive lock.
2357 * The first argument is a pointer to an nfsv4lock structure.
2358 * The second argument is 1 iff a blocking lock is wanted.
2360 * holds an exclusive lock.
2361 * It returns 1 if the lock was acquired, 0 otherwise.
2364 * lock. (If the caller must have the lock, it simply calls this function in a
2365 * loop until the function returns 1 to indicate the lock was acquired.)
2367 * calling nfsv4_lock(). It was done this way, so nfsv4_lock() could
2368 * be called in a loop.
2371 * NULL.
2382 * someone and then released. If I want the lock, try to acquire it. in nfsv4_lock()
2384 * must be zero. in nfsv4_lock()
2415 * Release the lock acquired by nfsv4_lock().
2417 * incremented, as well.
2430 * Release a reference cnt.
2444 * Get a reference cnt.
2446 * not wait for threads that want the exclusive lock. If priority needs
2448 * with the 2nd argument == 0 should be done before calling nfsv4_getref().
2450 * return without getting a refcnt for that case.
2461 * Wait for a lock held. in nfsv4_getref()
2479 * an exclusive lock is held.
2493 * Test for a lock. Return 1 if locked, 0 otherwise.
2506 * Wake up anyone sleeping, waiting for this lock.
2519 * Copy a string from an mbuf list into a character array.
2521 * 0 otherwise.
2572 * Fill in the attributes as marked by the bitmap (V4).
2601 * First, set the bits that can be filled and get fsinfo. in nfsv4_fillattr()
2605 * If both p and cred are NULL, it is a client side setattr call. in nfsv4_fillattr()
2606 * If both p and cred are not NULL, it is a server side reply call. in nfsv4_fillattr()
2608 * reply call. in nfsv4_fillattr()
2620 * Get the VFS_STATFS(), since some attributes need them. in nfsv4_fillattr()
2636 * so set them to 0. Without this, they will appear in nfsv4_fillattr()
2638 * Solaris10. in nfsv4_fillattr()
2647 * And the NFSv4 ACL... in nfsv4_fillattr()
2678 /* Check to see if Extended Attributes are supported. */ in nfsv4_fillattr()
2692 * and get the field for the number of attributes returned. in nfsv4_fillattr()
2699 * Now, loop around filling in the attributes for each bit set. in nfsv4_fillattr()
2735 if (fsinf.fs_properties & NFSV3FSINFO_LINK) in nfsv4_fillattr()
2743 if (fsinf.fs_properties & NFSV3FSINFO_SYMLINK) in nfsv4_fillattr()
2757 *tl++ = txdr_unsigned(mp->mnt_stat.f_fsid.val[0]); in nfsv4_fillattr()
2759 *tl = txdr_unsigned(mp->mnt_stat.f_fsid.val[1]); in nfsv4_fillattr()
2778 * Recommended Attributes. (Only the supported ones.) in nfsv4_fillattr()
2790 if (fsinf.fs_properties & NFSV3FSINFO_CANSETTIME) in nfsv4_fillattr()
2847 if (fsinf.fs_properties & NFSV3FSINFO_HOMOGENEOUS) in nfsv4_fillattr()
2872 *tl = txdr_unsigned(fsinf.fs_rtmax); in nfsv4_fillattr()
2878 *tl = txdr_unsigned(fsinf.fs_wtmax); in nfsv4_fillattr()
2919 * we'll just make sure that's the case. in nfsv4_fillattr()
2925 freenum = min(dqb.dqb_bhardlimit, freenum); in nfsv4_fillattr()
2943 * we'll just make sure that's the case. in nfsv4_fillattr()
2949 freenum = min(dqb.dqb_bsoftlimit, freenum); in nfsv4_fillattr()
2964 * we'll just make sure that's the case. in nfsv4_fillattr()
2970 freenum = dqb.dqb_curblocks; in nfsv4_fillattr()
3053 temptime.tv_sec = 0; in nfsv4_fillattr()
3054 temptime.tv_nsec = 1000000000 / hz; in nfsv4_fillattr()
3108 *tl++ = txdr_unsigned(1); /* One entry. */ in nfsv4_fillattr()
3139 * there is no umask to handle here. If FreeBSD in nfsv4_fillattr()
3141 * this could change. in nfsv4_fillattr()
3175 * Calculate the files available attribute value.
3188 * Check quota and use min(quota, f_ffree). in nfsv4_filesavail()
3194 * for FreeBSD. I do not know if doing this is in nfsv4_filesavail()
3195 * useful, so I will just leave the code here. in nfsv4_filesavail()
3201 * we'll just make sure that's the case. in nfsv4_filesavail()
3207 freenum = min(dqb.dqb_isoftlimit-dqb.dqb_curinodes, in nfsv4_filesavail()
3215 * Put the attribute bits onto an mbuf list.
3216 * Return the number of bytes of output generated.
3236 * Put the operation bits onto an mbuf list.
3237 * Return the number of bytes of output generated.
3257 * Convert a uid to a string.
3258 * If the lookup fails, just output the digits.
3280 * Always map nfsrv_defaultuid to "nobody". in nfsv4_uidtostr()
3309 * in it, append @domainname to it. in nfsv4_uidtostr()
3355 * No match, just return a string of digits. in nfsv4_uidtostr()
3376 * Get a credential for the uid with the server's group list.
3378 * logging a warning message.
3421 * Convert a string to a uid.
3423 * return 0.
3426 * a number.
3444 /* If a string of digits and an AUTH_SYS mount, just convert it. */ in nfsv4_strtouid()
3448 /* A numeric string. */ in nfsv4_strtouid()
3458 * Look for an '@'. in nfsv4_strtouid()
3471 * the name with dns stripped off. in nfsv4_strtouid()
3473 * since RFC8881 defines this string as a DNS domain name. in nfsv4_strtouid()
3484 * Check for the special case of "nobody". in nfsv4_strtouid()
3527 * Convert a gid to a string.
3549 * Always map nfsrv_defaultgid to "nogroup". in nfsv4_gidtostr()
3578 * in it, append @domainname to it. in nfsv4_gidtostr()
3624 * No match, just return a string of digits. in nfsv4_gidtostr()
3645 * Convert a string to a gid.
3647 * return 0.
3650 * a number.
3668 /* If a string of digits and an AUTH_SYS mount, just convert it. */ in nfsv4_strtogid()
3672 /* A numeric string. */ in nfsv4_strtogid()
3682 * Look for an '@'. in nfsv4_strtogid()
3695 * name with the dns stripped off. in nfsv4_strtogid()
3706 * Check for the special case of "nogroup". in nfsv4_strtogid()
3749 * Set the port for the nfsuserd.
3772 * Set up the socket record and connect. in nfsrv_nfsuserdport()
3774 * process/thread/core will use a bogus old value. This could only in nfsrv_nfsuserdport()
3776 * broken. in nfsrv_nfsuserdport()
3795 ad->sin_addr.s_addr = htonl(INADDR_LOOPBACK); in nfsrv_nfsuserdport()
3833 * Delete the nfsuserd port.
3845 /* Wait for all upcalls to complete. */ in nfsrv_nfsuserddelport()
3851 free(NFSD_VNET(nfsrv_nfsuserdsock).nr_nam, M_SONAME); in nfsrv_nfsuserddelport()
3859 * name<-->id cache.
3860 * Returns 0 upon success, non-zero otherwise.
3880 * can wait until no upcalls are in progress. in nfsrv_getuser()
3922 * kernel user/group name list(s) for the V4 owner and ownergroup attributes.
3952 * lists. All mutexes for both lists must be locked, in nfssvc_idname()
3954 * ones, to avoid a LOR. in nfssvc_idname()
3957 mtx_lock(&NFSD_VNET(nfsusernamehash)[i].mtx); in nfssvc_idname()
3959 mtx_lock(&NFSD_VNET(nfsuserhash)[i].mtx); in nfssvc_idname()
3962 &NFSD_VNET(nfsuserhash)[i].lughead, lug_numhash, nusrp) in nfssvc_idname()
3965 mtx_unlock(&NFSD_VNET(nfsuserhash)[i].mtx); in nfssvc_idname()
3967 mtx_unlock(&NFSD_VNET(nfsusernamehash)[i].mtx); in nfssvc_idname()
3969 mtx_lock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); in nfssvc_idname()
3971 mtx_lock(&NFSD_VNET(nfsgrouphash)[i].mtx); in nfssvc_idname()
3974 &NFSD_VNET(nfsgrouphash)[i].lughead, lug_numhash, in nfssvc_idname()
3978 mtx_unlock(&NFSD_VNET(nfsgrouphash)[i].mtx); in nfssvc_idname()
3980 mtx_unlock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); in nfssvc_idname()
3985 /* Allocate the hash tables. */ in nfssvc_idname()
3990 mtx_init(&NFSD_VNET(nfsuserhash)[i].mtx, "nfsuidhash", in nfssvc_idname()
3996 mtx_init(&NFSD_VNET(nfsusernamehash)[i].mtx, in nfssvc_idname()
4003 mtx_init(&NFSD_VNET(nfsgrouphash)[i].mtx, "nfsgidhash", in nfssvc_idname()
4009 mtx_init(&NFSD_VNET(nfsgroupnamehash)[i].mtx, in nfssvc_idname()
4012 /* (Re)initialize the list heads. */ in nfssvc_idname()
4014 TAILQ_INIT(&NFSD_VNET(nfsuserhash)[i].lughead); in nfssvc_idname()
4016 TAILQ_INIT(&NFSD_VNET(nfsusernamehash)[i].lughead); in nfssvc_idname()
4018 TAILQ_INIT(&NFSD_VNET(nfsgrouphash)[i].lughead); in nfssvc_idname()
4020 TAILQ_INIT(&NFSD_VNET(nfsgroupnamehash)[i].lughead); in nfssvc_idname()
4023 * Put name in "DNS" string. in nfssvc_idname()
4037 * manipulation of the lists. in nfssvc_idname()
4052 * but using the group list provided. in nfssvc_idname()
4076 * by uid[0]->[nfsrv_lughashsize - 1], with the same for group. in nfssvc_idname()
4079 * locked. hp_name != NULL and hp_idnum != NULL indicates that in nfssvc_idname()
4080 * the respective one mutex is locked. in nfssvc_idname()
4086 * Delete old entries, as required. in nfssvc_idname()
4089 /* Must lock all username hash lists first, to avoid a LOR. */ in nfssvc_idname()
4091 mtx_lock(&NFSD_VNET(nfsusernamehash)[i].mtx); in nfssvc_idname()
4118 /* Must lock all groupname hash lists first, to avoid a LOR. */ in nfssvc_idname()
4120 mtx_lock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); in nfssvc_idname()
4149 * Now, we can add the new one. in nfssvc_idname()
4180 * Once per second, allow one thread to trim the cache. in nfssvc_idname()
4186 * can be locked and any LOR is avoided. in nfssvc_idname()
4201 mtx_lock(&NFSD_VNET(nfsusernamehash)[i].mtx); in nfssvc_idname()
4207 mtx_lock(&NFSD_VNET(nfsuserhash)[i].mtx); in nfssvc_idname()
4211 &NFSD_VNET(nfsuserhash)[i].lughead, lug_numhash, in nfssvc_idname()
4219 * algorithm. This code deletes the least in nfssvc_idname()
4220 * recently used entry on each hash list. in nfssvc_idname()
4224 usrp = TAILQ_FIRST(&NFSD_VNET(nfsuserhash)[i].lughead); in nfssvc_idname()
4231 mtx_lock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); in nfssvc_idname()
4237 mtx_lock(&NFSD_VNET(nfsgrouphash)[i].mtx); in nfssvc_idname()
4241 &NFSD_VNET(nfsgrouphash)[i].lughead, lug_numhash, in nfssvc_idname()
4249 * algorithm. This code deletes the least in nfssvc_idname()
4250 * recently user entry on each hash list. in nfssvc_idname()
4254 usrp = TAILQ_FIRST(&NFSD_VNET(nfsgrouphash)[i].lughead); in nfssvc_idname()
4263 /* Now, unlock all locked mutexes. */ in nfssvc_idname()
4270 mtx_unlock(&NFSD_VNET(nfsuserhash)[i].mtx); in nfssvc_idname()
4273 mtx_unlock(&NFSD_VNET(nfsusernamehash)[i].mtx); in nfssvc_idname()
4276 mtx_unlock(&NFSD_VNET(nfsgrouphash)[i].mtx); in nfssvc_idname()
4279 mtx_unlock(&NFSD_VNET(nfsgroupnamehash)[i].mtx); in nfssvc_idname()
4286 * Remove a user/group name element.
4315 * Free up all the allocations related to the name<-->id cache.
4317 * running, since it doesn't do any locking.
4318 * This function is meant to be called when a vnet jail is destroyed.
4351 mtx_destroy(&NFSD_VNET(nfsuserhash)[i].mtx); in nfsrv_cleanusergroup()
4352 mtx_destroy(&NFSD_VNET(nfsusernamehash)[i].mtx); in nfsrv_cleanusergroup()
4353 mtx_destroy(&NFSD_VNET(nfsgroupnamehash)[i].mtx); in nfsrv_cleanusergroup()
4354 mtx_destroy(&NFSD_VNET(nfsgrouphash)[i].mtx); in nfsrv_cleanusergroup()
4364 * This function scans a byte string and checks for UTF-8 compliance.
4365 * It returns 0 if it conforms and NFSERR_INVAL if not.
4382 * shift - lower order bits of range (ie. "val >> shift" should in nfsrv_checkutf8()
4432 * Parse the xdr for an NFSv4 FsLocations attribute. Return two malloc'd
4434 * locations. The list is in the same format as is found in nfr_refs.
4436 * form <server>:<rootpath>. For example
4437 * "nfsv4-test:/sub2,nfsv4-test2:/user/mnt,nfsv4-test2:/user/mnt2"
4439 * and an empty server list.
4441 * number of xdr bytes parsed in sump.
4463 * and 0 length server list. in nfsrv_getrefstr()
4494 * Now, loop through the location list and make up the srvlist. in nfsrv_getrefstr()
4510 * Handle the first server by putting it in the srvstr. in nfsrv_getrefstr()
4532 * Yuck, put them in an slist and process them later. in nfsrv_getrefstr()
4551 * Finally, we can get the path. in nfsrv_getrefstr()
4597 * Make the malloc'd space large enough. This is a pain, but the xdr
4598 * doesn't set an upper bound on the side, so...
4618 * Initialize the reply header data structures.
4634 * If this is a big reply, use a cluster. in nfsrvd_rephead()
4655 * Lock a socket against others.
4656 * Currently used to serialize connect/disconnect attempts.
4666 ts.tv_sec = 0; in newnfs_sndlock()
4667 ts.tv_nsec = 0; in newnfs_sndlock()
4677 * Unlock the stream socket for others.
4741 * The shortest address is 11chars and the longest is < 64. in nfsv4_getipaddr()
4747 /* Find the port# at the end and extract that. */ in nfsv4_getipaddr()
4751 /* Count back two '.'s from end to get port# field. */ in nfsv4_getipaddr()
4753 if (*cp == '.') { in nfsv4_getipaddr()
4762 * The NFSv4 port# is appended as .N.N, where N is in nfsv4_getipaddr()
4764 * address. Cheat and use inet_aton(), which will in nfsv4_getipaddr()
4766 * order 8bits over to convert it to the port#. in nfsv4_getipaddr()
4770 portnum = ntohl(saddr.s_addr); in nfsv4_getipaddr()
4810 * Handle an NFSv4.1 Sequence request for the session.
4811 * If reply != NULL, use it to return the cached reply, as required.
4813 * server gets a cached reply via the nfsv4_seqsess_cacherep() call.
4827 if (seqid == slots[slotid].nfssl_seq) { in nfsv4_seqsession()
4828 /* A retry. */ in nfsv4_seqsession()
4829 if (slots[slotid].nfssl_inprog != 0) in nfsv4_seqsession()
4831 else if (slots[slotid].nfssl_reply != NULL) { in nfsv4_seqsession()
4833 m = m_copym(slots[slotid].nfssl_reply, 0, in nfsv4_seqsession()
4838 *reply = slots[slotid].nfssl_reply; in nfsv4_seqsession()
4839 slots[slotid].nfssl_reply = NULL; in nfsv4_seqsession()
4842 slots[slotid].nfssl_inprog = 1; in nfsv4_seqsession()
4845 /* No reply cached, so just do it. */ in nfsv4_seqsession()
4846 slots[slotid].nfssl_inprog = 1; in nfsv4_seqsession()
4847 } else if ((slots[slotid].nfssl_seq + 1) == seqid) { in nfsv4_seqsession()
4848 if (slots[slotid].nfssl_reply != NULL) in nfsv4_seqsession()
4849 m_freem(slots[slotid].nfssl_reply); in nfsv4_seqsession()
4850 slots[slotid].nfssl_reply = NULL; in nfsv4_seqsession()
4851 slots[slotid].nfssl_inprog = 1; in nfsv4_seqsession()
4852 slots[slotid].nfssl_seq++; in nfsv4_seqsession()
4859 * Cache this reply for the slot.
4861 * NFSERR_REPLYFROMCACHE. The client never sets repstat to this value.
4870 if (slots[slotid].nfssl_reply != NULL) { in nfsv4_seqsess_cacherep()
4873 * succeed. in nfsv4_seqsess_cacherep()
4875 m = m_copym(slots[slotid].nfssl_reply, 0, M_COPYALL, in nfsv4_seqsess_cacherep()
4883 * be ok. in nfsv4_seqsess_cacherep()
4885 *rep = slots[slotid].nfssl_reply; in nfsv4_seqsess_cacherep()
4886 slots[slotid].nfssl_reply = NULL; in nfsv4_seqsess_cacherep()
4891 if (slots[slotid].nfssl_reply != NULL) in nfsv4_seqsess_cacherep()
4892 m_freem(slots[slotid].nfssl_reply); in nfsv4_seqsess_cacherep()
4893 slots[slotid].nfssl_reply = *rep; in nfsv4_seqsess_cacherep()
4895 slots[slotid].nfssl_inprog = 0; in nfsv4_seqsess_cacherep()
4899 * Generate the xdr for an NFSv4.1 Sequence Operation.
4913 /* If all slots are bad, Destroy the session. */ in nfsv4_setsequence()
4922 /* Build the Sequence arguments. */ in nfsv4_setsequence()
4941 * just be zeros. in nfsv4_setsequence()
4943 * the same error again when the RPC is retried. in nfsv4_setsequence()
4945 * RPC to fail later. in nfsv4_setsequence()
4956 * If fnd_init is true, ignore the badslots.
4957 * If fnd_init is false, return NFSERR_SEQMISORDERED if all slots are bad.
4968 /* Find an unused slot. */ in nfsv4_sequencelookup()
4974 /* Just return the bad session. */ in nfsv4_sequencelookup()
4997 * If a forced dismount is in progress, just return. in nfsv4_sequencelookup()
4999 * newnfs_request(). in nfsv4_sequencelookup()
5005 /* Wake up once/sec, to check for a forced dismount. */ in nfsv4_sequencelookup()
5012 * If all slots are bad, just return slot 0 and NFSERR_SEQMISORDERED. in nfsv4_sequencelookup()
5014 * will get a NFSERR_BADSESSION reply from the server. in nfsv4_sequencelookup()
5019 /* Now, find the highest slot in use. (nfsc_slots is 64bits) */ in nfsv4_sequencelookup()
5037 * Free a session slot.
5060 * Search for a matching pnfsd DS, based on the nmp arg.
5061 * Return one if found, NULL otherwise.
5070 * Search the DS server list for a match with nmp. in nfsv4_findmirror()
5084 * Fill in the fields of "struct nfsrv_descript".
5127 * Grow a ext_pgs mbuf list. Either allocate another page or add
5128 * an mbuf to the list.
5153 * Do the NFSv4.1 Destroy Session.