Lines Matching defs:shift
44 * We can shift data by up to LOCAL_BUF_LEN bytes in a pass. If we need
45 * to do more than that, we shift repeatedly. Kevin Coffman reports
55 static void rotate_buf_a_little(struct xdr_buf *buf, unsigned int shift)
61 BUG_ON(shift > LOCAL_BUF_LEN);
63 read_bytes_from_xdr_buf(buf, 0, head, shift);
64 for (i = 0; i + shift < buf->len; i += LOCAL_BUF_LEN) {
65 this_len = min(LOCAL_BUF_LEN, buf->len - (i + shift));
66 read_bytes_from_xdr_buf(buf, i+shift, tmp, this_len);
69 write_bytes_to_xdr_buf(buf, buf->len - shift, head, shift);
72 static void _rotate_left(struct xdr_buf *buf, unsigned int shift)
77 shift %= buf->len;
78 while (shifted < shift) {
79 this_shift = min(shift - shifted, LOCAL_BUF_LEN);
85 static void rotate_left(u32 base, struct xdr_buf *buf, unsigned int shift)
90 _rotate_left(&subbuf, shift);