Lines Matching refs:cookie
620 struct afs_lookup_one_cookie *cookie = in afs_lookup_one_filldir() local
624 cookie->name.name, cookie->name.len, name, nlen, in afs_lookup_one_filldir()
631 if (cookie->name.len != nlen || in afs_lookup_one_filldir()
632 memcmp(cookie->name.name, name, nlen) != 0) { in afs_lookup_one_filldir()
637 cookie->fid.vnode = ino; in afs_lookup_one_filldir()
638 cookie->fid.unique = dtype; in afs_lookup_one_filldir()
639 cookie->found = 1; in afs_lookup_one_filldir()
654 struct afs_lookup_one_cookie cookie = { in afs_do_lookup_one() local
664 ret = afs_dir_iterate(dir, &cookie.ctx, key, _dir_version); in afs_do_lookup_one()
670 if (!cookie.found) { in afs_do_lookup_one()
675 *fid = cookie.fid; in afs_do_lookup_one()
688 struct afs_lookup_cookie *cookie = in afs_lookup_filldir() local
693 cookie->name.name, cookie->name.len, name, nlen, in afs_lookup_filldir()
700 if (cookie->found) { in afs_lookup_filldir()
701 if (cookie->nr_fids < 50) { in afs_lookup_filldir()
702 cookie->fids[cookie->nr_fids].vnode = ino; in afs_lookup_filldir()
703 cookie->fids[cookie->nr_fids].unique = dtype; in afs_lookup_filldir()
704 cookie->nr_fids++; in afs_lookup_filldir()
706 } else if (cookie->name.len == nlen && in afs_lookup_filldir()
707 memcmp(cookie->name.name, name, nlen) == 0) { in afs_lookup_filldir()
708 cookie->fids[1].vnode = ino; in afs_lookup_filldir()
709 cookie->fids[1].unique = dtype; in afs_lookup_filldir()
710 cookie->found = 1; in afs_lookup_filldir()
711 if (cookie->one_only) in afs_lookup_filldir()
715 ret = cookie->nr_fids >= 50 ? -1 : 0; in afs_lookup_filldir()
834 struct afs_lookup_cookie *cookie; in afs_do_lookup() local
845 cookie = kzalloc(sizeof(struct afs_lookup_cookie), GFP_KERNEL); in afs_do_lookup()
846 if (!cookie) in afs_do_lookup()
849 for (i = 0; i < ARRAY_SIZE(cookie->fids); i++) in afs_do_lookup()
850 cookie->fids[i].vid = dvnode->fid.vid; in afs_do_lookup()
851 cookie->ctx.actor = afs_lookup_filldir; in afs_do_lookup()
852 cookie->name = dentry->d_name; in afs_do_lookup()
853 cookie->nr_fids = 2; /* slot 0 is saved for the fid we actually want in afs_do_lookup()
857 cookie->one_only = true; in afs_do_lookup()
860 ret = afs_dir_iterate(dir, &cookie->ctx, key, &data_version); in afs_do_lookup()
867 if (!cookie->found) in afs_do_lookup()
871 inode = ilookup5(dir->i_sb, cookie->fids[1].vnode, in afs_do_lookup()
872 afs_ilookup5_test_by_fid, &cookie->fids[1]); in afs_do_lookup()
887 afs_op_set_fid(op, 1, &cookie->fids[1]); in afs_do_lookup()
889 op->nr_files = cookie->nr_fids; in afs_do_lookup()
903 vp->fid = cookie->fids[i]; in afs_do_lookup()
926 if (!cookie->one_only) { in afs_do_lookup()
956 kfree(cookie); in afs_do_lookup()