Lines Matching refs:walk

28 static inline unsigned int scatterwalk_pagelen(struct scatter_walk *walk)  in scatterwalk_pagelen()  argument
30 unsigned int len = walk->sg->offset + walk->sg->length - walk->offset; in scatterwalk_pagelen()
31 unsigned int len_this_page = offset_in_page(~walk->offset) + 1; in scatterwalk_pagelen()
35 static inline unsigned int scatterwalk_clamp(struct scatter_walk *walk, in scatterwalk_clamp() argument
38 unsigned int len_this_page = scatterwalk_pagelen(walk); in scatterwalk_clamp()
42 static inline void scatterwalk_advance(struct scatter_walk *walk, in scatterwalk_advance() argument
45 walk->offset += nbytes; in scatterwalk_advance()
48 static inline unsigned int scatterwalk_aligned(struct scatter_walk *walk, in scatterwalk_aligned() argument
51 return !(walk->offset & alignmask); in scatterwalk_aligned()
54 static inline struct page *scatterwalk_page(struct scatter_walk *walk) in scatterwalk_page() argument
56 return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); in scatterwalk_page()
64 static inline void scatterwalk_start(struct scatter_walk *walk, in scatterwalk_start() argument
67 walk->sg = sg; in scatterwalk_start()
68 walk->offset = sg->offset; in scatterwalk_start()
71 static inline void *scatterwalk_map(struct scatter_walk *walk) in scatterwalk_map() argument
73 return kmap_atomic(scatterwalk_page(walk)) + in scatterwalk_map()
74 offset_in_page(walk->offset); in scatterwalk_map()
77 static inline void scatterwalk_pagedone(struct scatter_walk *walk, int out, in scatterwalk_pagedone() argument
83 page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT); in scatterwalk_pagedone()
87 if (more && walk->offset >= walk->sg->offset + walk->sg->length) in scatterwalk_pagedone()
88 scatterwalk_start(walk, sg_next(walk->sg)); in scatterwalk_pagedone()
91 static inline void scatterwalk_done(struct scatter_walk *walk, int out, in scatterwalk_done() argument
94 if (!more || walk->offset >= walk->sg->offset + walk->sg->length || in scatterwalk_done()
95 !(walk->offset & (PAGE_SIZE - 1))) in scatterwalk_done()
96 scatterwalk_pagedone(walk, out, more); in scatterwalk_done()
99 void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
101 void *scatterwalk_map(struct scatter_walk *walk);