Lines Matching refs:walk

41 static int hash_walk_next(struct crypto_hash_walk *walk)  in hash_walk_next()  argument
43 unsigned int alignmask = walk->alignmask; in hash_walk_next()
44 unsigned int offset = walk->offset; in hash_walk_next()
45 unsigned int nbytes = min(walk->entrylen, in hash_walk_next()
48 walk->data = kmap_atomic(walk->pg); in hash_walk_next()
49 walk->data += offset; in hash_walk_next()
58 walk->entrylen -= nbytes; in hash_walk_next()
62 static int hash_walk_new_entry(struct crypto_hash_walk *walk) in hash_walk_new_entry() argument
66 sg = walk->sg; in hash_walk_new_entry()
67 walk->offset = sg->offset; in hash_walk_new_entry()
68 walk->pg = sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); in hash_walk_new_entry()
69 walk->offset = offset_in_page(walk->offset); in hash_walk_new_entry()
70 walk->entrylen = sg->length; in hash_walk_new_entry()
72 if (walk->entrylen > walk->total) in hash_walk_new_entry()
73 walk->entrylen = walk->total; in hash_walk_new_entry()
74 walk->total -= walk->entrylen; in hash_walk_new_entry()
76 return hash_walk_next(walk); in hash_walk_new_entry()
79 int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) in crypto_hash_walk_done() argument
81 unsigned int alignmask = walk->alignmask; in crypto_hash_walk_done()
83 walk->data -= walk->offset; in crypto_hash_walk_done()
85 if (walk->entrylen && (walk->offset & alignmask) && !err) { in crypto_hash_walk_done()
88 walk->offset = ALIGN(walk->offset, alignmask + 1); in crypto_hash_walk_done()
89 nbytes = min(walk->entrylen, in crypto_hash_walk_done()
90 (unsigned int)(PAGE_SIZE - walk->offset)); in crypto_hash_walk_done()
92 walk->entrylen -= nbytes; in crypto_hash_walk_done()
93 walk->data += walk->offset; in crypto_hash_walk_done()
98 kunmap_atomic(walk->data); in crypto_hash_walk_done()
99 crypto_yield(walk->flags); in crypto_hash_walk_done()
104 if (walk->entrylen) { in crypto_hash_walk_done()
105 walk->offset = 0; in crypto_hash_walk_done()
106 walk->pg++; in crypto_hash_walk_done()
107 return hash_walk_next(walk); in crypto_hash_walk_done()
110 if (!walk->total) in crypto_hash_walk_done()
113 walk->sg = sg_next(walk->sg); in crypto_hash_walk_done()
115 return hash_walk_new_entry(walk); in crypto_hash_walk_done()
120 struct crypto_hash_walk *walk) in crypto_hash_walk_first() argument
122 walk->total = req->nbytes; in crypto_hash_walk_first()
124 if (!walk->total) { in crypto_hash_walk_first()
125 walk->entrylen = 0; in crypto_hash_walk_first()
129 walk->alignmask = crypto_ahash_alignmask(crypto_ahash_reqtfm(req)); in crypto_hash_walk_first()
130 walk->sg = req->src; in crypto_hash_walk_first()
131 walk->flags = req->base.flags; in crypto_hash_walk_first()
133 return hash_walk_new_entry(walk); in crypto_hash_walk_first()