Lines Matching defs:cookie

4643  * The incoming "offset" is a directory cookie indicating where in the
4644 * directory entries should be read from. A zero cookie means start at
4645 * the beginning of the directory. Any other cookie will be a cookie
4648 * Using that cookie, determine which buffer (and where in that buffer)
4655 * entry's cookie and enter that cookie in the cookie cache.
4658 * the incoming offset is a potentially truncated cookie (ptc).
4659 * The cookie matching code is aware of this and will fall back to
4660 * matching only 32 bits of the cookie.
4681 uint64_t cookie, nextcookie, lbn = 0;
4750 if (error < 0) { /* just hit EOF cookie */
4760 cookie = nextcookie;
4794 if ((lbn != cookie) && !(ptc && NFS_DIR_COOKIE_SAME32(lbn, cookie))) {
4797 for (; (i < ndbhp->ndbh_count) && (cookie != dp->d_seekoff); i++) {
4798 if (ptc && !dpptc && NFS_DIR_COOKIE_SAME32(cookie, dp->d_seekoff)) {
4815 ptc = 0; /* only have to deal with ptc on first cookie */
4862 if (!error && !done && (nextcookie == cookie)) {
4863 printf("nfs readdir cookie didn't change 0x%llx, %d/%d\n", cookie, i, ndbhp->ndbh_count);
4915 * add/update a cookie->lbn entry in the directory cookie cache
4918 nfs_dir_cookie_cache(nfsnode_t dnp, uint64_t cookie, uint64_t lbn)
4923 if (!cookie)
4929 if (cookie == dnp->n_eofcookie) { /* EOF cookie */
4936 /* allocate the cookie cache structure */
4950 * Search the list for this cookie.
4955 while ((i != -1) && (cookie != ndcc->cookies[i].key)) {
4961 if ((i != -1) && (cookie == ndcc->cookies[i].key)) {
4973 ndcc->cookies[i].key = cookie;
4976 /* insert cookie at head of MRU list */
4983 * Try to map the given directory cookie to a directory buffer (return lbn).
4984 * If we have a possibly truncated cookie (ptc), check for 32-bit matches too.
4987 nfs_dir_cookie_to_lbn(nfsnode_t dnp, uint64_t cookie, int *ptc, uint64_t *lbnp)
4998 if (!cookie) { /* initial cookie */
5007 if (cookie == dnp->n_eofcookie) { /* EOF cookie */
5013 /* note if cookie is a 32-bit match with the EOF cookie */
5014 eofptc = *ptc ? NFS_DIR_COOKIE_SAME32(cookie, dnp->n_eofcookie) : 0;
5017 /* search the list for the cookie */
5019 if (ndcc->cookies[i].key == cookie) {
5020 /* found a match for this cookie */
5028 if (*ptc && (iptc == -1) && NFS_DIR_COOKIE_SAME32(ndcc->cookies[i].key, cookie))
5033 /* but 32-bit match hit the EOF cookie */
5048 * No match found in the cookie cache... hmm...
5049 * Let's search the directory's buffers for the cookie.
5086 /* scan the buffer for the cookie */
5090 for (i=0; (i < ndbhp->ndbh_count) && (cookie != dp->d_seekoff); i++) {
5091 if (*ptc && !dpptc && NFS_DIR_COOKIE_SAME32(cookie, dp->d_seekoff)) {
5124 *lbnp = cookie;
5354 uint64_t cookie, lastcookie, xid, savedxid, fileno;
5376 /* determine cookie to use, and move dp to the right offset */
5382 cookie = dp->d_seekoff;
5385 cookie = bp->nb_lblkno;
5389 lastcookie = cookie;
5405 nfsm_chain_add_64(error, &nmreq, cookie);
5408 nfsm_chain_add_32(error, &nmreq, cookie);
5482 * last cookie in the current buffer.
5514 nfsm_chain_get_64(error, &nmrep, cookie);
5516 nfsm_chain_get_32(error, &nmrep, cookie);
5518 dp->d_seekoff = cookie;
5519 if (!bigcookies && (cookie >> 32) && (nmp == NFSTONMP(dnp))) {
5520 /* we've got a big cookie, make sure flag is set */
5573 lastcookie = cookie;