Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67023
b: refs/heads/master
c: 5fa0fea
h: refs/heads/master
i:
  67021: 010f6cd
  67019: 6a133b5
  67015: 3db42c6
  67007: 69f8841
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 10, 2007
1 parent 4ff4830 commit 2aa3560
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e962a653f3146330d99aefa5adadeaed60bc9bb5
refs/heads/master: 5fa0fea27461f5ff7fad07687618db08272e9502
22 changes: 22 additions & 0 deletions trunk/crypto/scatterwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,25 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
}
}
EXPORT_SYMBOL_GPL(scatterwalk_copychunks);

void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
unsigned int start, unsigned int nbytes, int out)
{
struct scatter_walk walk;
unsigned int offset = 0;

for (;;) {
scatterwalk_start(&walk, sg);

if (start < offset + sg->length)
break;

offset += sg->length;
sg = sg_next(sg);
}

scatterwalk_advance(&walk, start - offset);
scatterwalk_copychunks(buf, &walk, nbytes, out);
scatterwalk_done(&walk, out, 0);
}
EXPORT_SYMBOL_GPL(scatterwalk_map_and_copy);
3 changes: 3 additions & 0 deletions trunk/crypto/scatterwalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
void *scatterwalk_map(struct scatter_walk *walk, int out);
void scatterwalk_done(struct scatter_walk *walk, int out, int more);

void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
unsigned int start, unsigned int nbytes, int out);

#endif /* _CRYPTO_SCATTERWALK_H */

0 comments on commit 2aa3560

Please sign in to comment.