diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-31 07:06:37 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-11-02 03:47:06 -0400 |
commit | c46f2334c84c2b26baa64d42d75ddc5fab38c3dc (patch) | |
tree | 4d7800effffe61bd3eaeae8f13e44466e4818b36 /net | |
parent | 87ae9afdcada236d0a1b38ce2c465a65916961dc (diff) |
[SG] Get rid of __sg_mark_end()
sg_mark_end() overwrites the page_link information, but all users want
__sg_mark_end() behaviour where we just set the end bit. That is the most
natural way to use the sg list, since you'll fill it in and then mark the
end point.
So change sg_mark_end() to only set the termination bit. Add a sg_magic
debug check as well, and clear a chain pointer if it is set.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 | ||||
-rw-r--r-- | net/rxrpc/rxkad.c | 2 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_crypto.c | 6 |
5 files changed, 7 insertions, 7 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 64b50ff7a41..32d5826b717 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2095,7 +2095,7 @@ int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int le | |||
2095 | { | 2095 | { |
2096 | int nsg = __skb_to_sgvec(skb, sg, offset, len); | 2096 | int nsg = __skb_to_sgvec(skb, sg, offset, len); |
2097 | 2097 | ||
2098 | __sg_mark_end(&sg[nsg - 1]); | 2098 | sg_mark_end(&sg[nsg - 1]); |
2099 | 2099 | ||
2100 | return nsg; | 2100 | return nsg; |
2101 | } | 2101 | } |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index eec02b29ffc..d438dfb0c8f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1083,7 +1083,7 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
1083 | sg_set_buf(&sg[block++], key->key, key->keylen); | 1083 | sg_set_buf(&sg[block++], key->key, key->keylen); |
1084 | nbytes += key->keylen; | 1084 | nbytes += key->keylen; |
1085 | 1085 | ||
1086 | __sg_mark_end(&sg[block - 1]); | 1086 | sg_mark_end(&sg[block - 1]); |
1087 | 1087 | ||
1088 | /* Now store the Hash into the packet */ | 1088 | /* Now store the Hash into the packet */ |
1089 | err = crypto_hash_init(desc); | 1089 | err = crypto_hash_init(desc); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 4b903288095..06be2a1f273 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -781,7 +781,7 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key, | |||
781 | sg_set_buf(&sg[block++], key->key, key->keylen); | 781 | sg_set_buf(&sg[block++], key->key, key->keylen); |
782 | nbytes += key->keylen; | 782 | nbytes += key->keylen; |
783 | 783 | ||
784 | __sg_mark_end(&sg[block - 1]); | 784 | sg_mark_end(&sg[block - 1]); |
785 | 785 | ||
786 | /* Now store the hash into the packet */ | 786 | /* Now store the hash into the packet */ |
787 | err = crypto_hash_init(desc); | 787 | err = crypto_hash_init(desc); |
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c index c387cf68a08..e09a95aa68f 100644 --- a/net/rxrpc/rxkad.c +++ b/net/rxrpc/rxkad.c | |||
@@ -702,7 +702,7 @@ static void rxkad_sg_set_buf2(struct scatterlist sg[2], | |||
702 | nsg++; | 702 | nsg++; |
703 | } | 703 | } |
704 | 704 | ||
705 | __sg_mark_end(&sg[nsg - 1]); | 705 | sg_mark_end(&sg[nsg - 1]); |
706 | 706 | ||
707 | ASSERTCMP(sg[0].length + sg[1].length, ==, buflen); | 707 | ASSERTCMP(sg[0].length + sg[1].length, ==, buflen); |
708 | } | 708 | } |
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index ab7cbd6575c..0dd792338fa 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c | |||
@@ -211,8 +211,8 @@ encryptor(struct scatterlist *sg, void *data) | |||
211 | if (thislen == 0) | 211 | if (thislen == 0) |
212 | return 0; | 212 | return 0; |
213 | 213 | ||
214 | __sg_mark_end(&desc->infrags[desc->fragno - 1]); | 214 | sg_mark_end(&desc->infrags[desc->fragno - 1]); |
215 | __sg_mark_end(&desc->outfrags[desc->fragno - 1]); | 215 | sg_mark_end(&desc->outfrags[desc->fragno - 1]); |
216 | 216 | ||
217 | ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags, | 217 | ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags, |
218 | desc->infrags, thislen); | 218 | desc->infrags, thislen); |
@@ -293,7 +293,7 @@ decryptor(struct scatterlist *sg, void *data) | |||
293 | if (thislen == 0) | 293 | if (thislen == 0) |
294 | return 0; | 294 | return 0; |
295 | 295 | ||
296 | __sg_mark_end(&desc->frags[desc->fragno - 1]); | 296 | sg_mark_end(&desc->frags[desc->fragno - 1]); |
297 | 297 | ||
298 | ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags, | 298 | ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags, |
299 | desc->frags, thislen); | 299 | desc->frags, thislen); |