Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 3 Nov 2007 19:43:21 +0000 (12:43 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 3 Nov 2007 19:43:21 +0000 (12:43 -0700)
* 'sg' of git://git.kernel.dk/linux-2.6-block:
  [SG] Get rid of __sg_mark_end()
  cleanup asm/scatterlist.h includes
  SG: Make sg_init_one() use general table init functions

43 files changed:
block/ll_rw_blk.c
crypto/anubis.c
crypto/blowfish.c
crypto/compress.c
crypto/crypto_null.c
crypto/khazad.c
crypto/sha1_generic.c
crypto/sha256_generic.c
crypto/sha512.c
crypto/tea.c
crypto/tgr192.c
crypto/wp512.c
drivers/base/dmapool.c
drivers/ieee1394/sbp2.c
drivers/media/video/bt8xx/bttvp.h
drivers/mmc/core/core.c
drivers/mmc/core/mmc_ops.c
drivers/mmc/core/sd_ops.c
drivers/mmc/core/sdio_ops.c
drivers/net/meth.c
drivers/scsi/scsi_lib.c
drivers/usb/core/buffer.c
drivers/usb/core/hcd.c
drivers/usb/core/usb.c
fs/nfsd/nfs4recover.c
include/linux/scatterlist.h
include/net/esp.h
include/rdma/ib_verbs.h
include/scsi/libsas.h
net/core/skbuff.c
net/ieee80211/ieee80211_crypt_ccmp.c
net/ipv4/ah4.c
net/ipv4/ipcomp.c
net/ipv4/tcp_ipv4.c
net/ipv6/ah6.c
net/ipv6/ipcomp6.c
net/ipv6/tcp_ipv6.c
net/mac80211/aes_ccm.c
net/rxrpc/rxkad.c
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_krb5_seal.c
net/sunrpc/auth_gss/gss_krb5_wrap.c
net/xfrm/xfrm_algo.c

index 56f2646612e604c2599b3ba8589f99adbf752fcb..54fd38589674526d24cd68b870ef5c61493b3863 100644 (file)
@@ -1369,7 +1369,7 @@ new_segment:
        } /* segments in rq */
 
        if (sg)
-               __sg_mark_end(sg);
+               sg_mark_end(sg);
 
        return nsegs;
 }
index 1c771f7f4dc5ee355d2f6d84ac6c76a547591fd8..4ff0e1e243ad331f07aba9d5423df61f37a4764c 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 55238c4e37f039c59872d5b049707a41cebc5160..80c3fd8be97cd729157a347f22f8b74b494ac4a1 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 0a6570048c1efb6ffaf6199662e4e33ee7ae9010..1ee357085d3a40bfdd8e3013e7fc7b501eb32948 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/types.h>
 #include <linux/crypto.h>
 #include <linux/errno.h>
-#include <asm/scatterlist.h>
 #include <linux/string.h>
 #include "internal.h"
 
index 24dbb5d8617e03584bc7dd4938b06ea2736488b2..29f77477d701859e5dc34c72035d2c9e39108c67 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mm.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/string.h>
 
index 9fa24a2dd6ffbee4e9c7aff2d06b6f3b51cf8388..704ebfe26b55e903d55c902d219e01340159d7e7 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 48a3c3e0bf5f8b4fb974c2e8aeddabb80fca8043..68c62f528eb59ed86c40086e4261c5824792bcaf 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/cryptohash.h>
 #include <linux/types.h>
 #include <crypto/sha.h>
-#include <asm/scatterlist.h>
 #include <asm/byteorder.h>
 
 struct sha1_ctx {
index 5f4332edcf6ba64b4e18d43406322c200f4fb63d..fd3918be58b51be9637a854f3bab569032b9f3a0 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/crypto.h>
 #include <linux/types.h>
 #include <crypto/sha.h>
-#include <asm/scatterlist.h>
 #include <asm/byteorder.h>
 
 struct sha256_ctx {
index e736596ca5741a86adf19f44129b0a4399eecdd6..c39c803ecc02dabc90bddecf52c837efdea6c902 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/types.h>
 #include <crypto/sha.h>
 
-#include <asm/scatterlist.h>
 #include <asm/byteorder.h>
 
 struct sha512_ctx {
index 1c54e26fa529342d6ee893b7636233f9c317f3ba..6893b3fdf9d6e9c4408b392df117bbebb06cc0a3 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index a0fadf3dd3e2d094bc635464c33781c4ab8be88c..2e7ea1680c7f72a6e3e945fac880ccad40c41183 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 727d05a19ff4e4ada1d23b09ca9303ee70243352..f746952b93fc8eb411d5dd78d9a16ecc61707bb9 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/mm.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/types.h>
 
index 5beddc322e6f86f0df9c43b1207f5cef8aad753a..b5034dc72a05f7f5d111692bcab3929af0b009da 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/device.h>
 #include <linux/mm.h>
 #include <asm/io.h>            /* Needed for i386 to build */
-#include <asm/scatterlist.h>   /* Needed for i386 to build */
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
 #include <linux/slab.h>
index d5dfe11aa5c6ded52e40b6c65c353c22db827b39..b83d254bc86edec605f1f78ba510a59566f2baef 100644 (file)
 #include <linux/types.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
+#include <linux/scatterlist.h>
 
 #include <asm/byteorder.h>
 #include <asm/errno.h>
 #include <asm/param.h>
-#include <asm/scatterlist.h>
 #include <asm/system.h>
 #include <asm/types.h>
 
index 0b92c35a8435cd86a8abbd9b7df5cf2fa5218cb7..d4ac4c4b49b459a9b71a952aac453ec456ed4dcc 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/pci.h>
 #include <linux/input.h>
 #include <linux/mutex.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <asm/io.h>
 #include <media/v4l2-common.h>
 
index 09435e0ec6806fa4771fb616227413bbc5c2dd33..b96667448eb5618ffcfae4e02e15cfaeca52146f 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/pagemap.h>
 #include <linux/err.h>
 #include <linux/leds.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/card.h>
index 7471d49909b25fbad327cf67a41aed52b6433fbb..64b05c6270f2f3aef54d88e309f8772694c4347a 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
index a6dafe62b992416f00c776f61312c1c9a00b61df..0d96080d44b098431af53b15764c0f8e6fdd1e81 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/types.h>
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
index 4d289b2750317b32f4a5a08d2ef0fb33a789cf3e..e1fca588e3853b5a10c477b6bd55ee7078fd19b8 100644 (file)
@@ -9,7 +9,6 @@
  * your option) any later version.
  */
 
-#include <asm/scatterlist.h>
 #include <linux/scatterlist.h>
 
 #include <linux/mmc/host.h>
index e25dbab67363c3b5ede9eea2fec63b1197577848..0c89b028a80c5f04c7b1ca0cdfe3ff62f6b974ce 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/ip32/ip32_ints.h>
 
 #include <asm/io.h>
-#include <asm/scatterlist.h>
 
 #include "meth.h"
 
index 61fdaf02f2511fb09aa6008ab5d78b354d39554b..88de771d3569ff7b58fff72a2926d2eaf28b0510 100644 (file)
@@ -785,7 +785,7 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask)
                 * end-of-list
                 */
                if (!left)
-                       sg_mark_end(sgl, this);
+                       sg_mark_end(&sgl[this - 1]);
 
                /*
                 * don't allow subsequent mempool allocs to sleep, it would
index ead2475406b85ce89f57df29c56bc4d5e98f0784..28d4972f7ad5493f449dd1ae0fe07cab446bb264 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/device.h>
 #include <linux/mm.h>
 #include <asm/io.h>
-#include <asm/scatterlist.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
 #include <linux/usb.h>
index 3dd997df8505bf3b2f64c7210f71b466b7101746..fea8256a18d6e1a99c01872a25e99ac3354f3f7c 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/utsname.h>
 #include <linux/mm.h>
 #include <asm/io.h>
-#include <asm/scatterlist.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
 #include <linux/mutex.h>
index 69aa68287d3f8b5cf7884955b703760fd1897c46..c4a6f1095b8b636f89e80267713b0c35fb3018a7 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/workqueue.h>
 
 #include <asm/io.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/mm.h>
 #include <linux/dma-mapping.h>
 
index 6f03918018a3106b0ffdedb0da170c5613a05c69..1602cd00dd455c790d309742791164e7c7045a32 100644 (file)
@@ -43,7 +43,7 @@
 #include <linux/file.h>
 #include <linux/namei.h>
 #include <asm/uaccess.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/sched.h>
 
index 32326c293d7bfbd0c9fe318ce4f5143258bed65a..25973504414823b7876d2f34256ea1f103018ddb 100644 (file)
@@ -188,43 +188,23 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
 
 /**
  * sg_mark_end - Mark the end of the scatterlist
- * @sgl:       Scatterlist
- * @nents:     Number of entries in sgl
+ * @sg:                 SG entryScatterlist
  *
  * Description:
- *   Marks the last entry as the termination point for sg_next()
+ *   Marks the passed in sg entry as the termination point for the sg
+ *   table. A call to sg_next() on this entry will return NULL.
  *
  **/
-static inline void sg_mark_end(struct scatterlist *sgl, unsigned int nents)
+static inline void sg_mark_end(struct scatterlist *sg)
 {
-       sgl[nents - 1].page_link = 0x02;
-}
-
-static inline void __sg_mark_end(struct scatterlist *sg)
-{
-       sg->page_link |= 0x02;
-}
-
-/**
- * sg_init_one - Initialize a single entry sg list
- * @sg:                 SG entry
- * @buf:        Virtual address for IO
- * @buflen:     IO length
- *
- * Notes:
- *   This should not be used on a single entry that is part of a larger
- *   table. Use sg_init_table() for that.
- *
- **/
-static inline void sg_init_one(struct scatterlist *sg, const void *buf,
-                              unsigned int buflen)
-{
-       memset(sg, 0, sizeof(*sg));
 #ifdef CONFIG_DEBUG_SG
-       sg->sg_magic = SG_MAGIC;
+       BUG_ON(sg->sg_magic != SG_MAGIC);
 #endif
-       sg_mark_end(sg, 1);
-       sg_set_buf(sg, buf, buflen);
+       /*
+        * Set termination bit, clear potential chain bit
+        */
+       sg->page_link |= 0x02;
+       sg->page_link &= ~0x01;
 }
 
 /**
@@ -240,7 +220,6 @@ static inline void sg_init_one(struct scatterlist *sg, const void *buf,
 static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
 {
        memset(sgl, 0, sizeof(*sgl) * nents);
-       sg_mark_end(sgl, nents);
 #ifdef CONFIG_DEBUG_SG
        {
                unsigned int i;
@@ -248,6 +227,25 @@ static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
                        sgl[i].sg_magic = SG_MAGIC;
        }
 #endif
+       sg_mark_end(&sgl[nents - 1]);
+}
+
+/**
+ * sg_init_one - Initialize a single entry sg list
+ * @sg:                 SG entry
+ * @buf:        Virtual address for IO
+ * @buflen:     IO length
+ *
+ * Notes:
+ *   This should not be used on a single entry that is part of a larger
+ *   table. Use sg_init_table() for that.
+ *
+ **/
+static inline void sg_init_one(struct scatterlist *sg, const void *buf,
+                              unsigned int buflen)
+{
+       sg_init_table(sg, 1);
+       sg_set_buf(sg, buf, buflen);
 }
 
 /**
index c1bc529809daad155865ed444049fdb1396b1b21..c05f529bff2824c9bc6f92a0a454b0f2260cc884 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <linux/crypto.h>
 #include <net/xfrm.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 
 #define ESP_NUM_FAST_SG                4
 
index 4bea182d7116c4aa80e863ed2d5a59fed24967e0..11f39606e7d94c64c1a63c6e5772dbca944a538c 100644 (file)
@@ -48,9 +48,9 @@
 #include <linux/kref.h>
 #include <linux/list.h>
 #include <linux/rwsem.h>
+#include <linux/scatterlist.h>
 
 #include <asm/atomic.h>
-#include <asm/scatterlist.h>
 #include <asm/uaccess.h>
 
 union ib_gid {
index 8dda2d66b5b92bcb61fd03c3e5fde16ce4bdb3ff..a466c2cb8955b5f0955a7a194b44475abfce3e31 100644 (file)
@@ -36,7 +36,7 @@
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_transport_sas.h>
-#include <asm/scatterlist.h>
+#include <linux/scatterlist.h>
 
 struct block_device;
 
index 64b50ff7a41399baeec0d10a44a94e291d9e8607..32d5826b7177078eb51dd99bc1887b974516888f 100644 (file)
@@ -2095,7 +2095,7 @@ int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset, int le
 {
        int nsg = __skb_to_sgvec(skb, sg, offset, len);
 
-       __sg_mark_end(&sg[nsg - 1]);
+       sg_mark_end(&sg[nsg - 1]);
 
        return nsg;
 }
index 0936a3e0210b4f3cf3bdb8962531adc66491bf7c..c6d760d9fbbe2a83fb3902ee040d6e1db3ce16df 100644 (file)
@@ -25,7 +25,6 @@
 #include <net/ieee80211.h>
 
 #include <linux/crypto.h>
-#include <asm/scatterlist.h>
 
 MODULE_AUTHOR("Jouni Malinen");
 MODULE_DESCRIPTION("Host AP crypt: CCMP");
index 4e8e3b079f5b606cf7c70aed28563889b2202aa7..5fc346d8b5665a344f80a8b82e6c2013b9dd549f 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/spinlock.h>
 #include <net/icmp.h>
 #include <net/protocol.h>
-#include <asm/scatterlist.h>
 
 
 /* Clear mutable options and find final destination to substitute
index 0bfeb02a5f87b7f99676fd5d73d89a4f9db70ba8..ca1b5fdb8d31387d6400e4188c486b8100059314 100644 (file)
@@ -14,7 +14,6 @@
  *   - Adaptive compression.
  */
 #include <linux/module.h>
-#include <asm/scatterlist.h>
 #include <asm/semaphore.h>
 #include <linux/crypto.h>
 #include <linux/pfkeyv2.h>
index eec02b29ffcfb7c71483f8e59816a44c528da02c..d438dfb0c8f38a9f53833a6283eb30a40741ff78 100644 (file)
@@ -1083,7 +1083,7 @@ static int tcp_v4_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
        sg_set_buf(&sg[block++], key->key, key->keylen);
        nbytes += key->keylen;
 
-       __sg_mark_end(&sg[block - 1]);
+       sg_mark_end(&sg[block - 1]);
 
        /* Now store the Hash into the packet */
        err = crypto_hash_init(desc);
index 66a9139d46e97fe30a843c08c356e69d990abfac..4eaf55072b1b05ff7c52537acb01eead7bd761f4 100644 (file)
@@ -35,7 +35,6 @@
 #include <net/ipv6.h>
 #include <net/protocol.h>
 #include <net/xfrm.h>
-#include <asm/scatterlist.h>
 
 static int zero_out_mutable_opts(struct ipv6_opt_hdr *opthdr)
 {
index 80ef2a1d39fd56704fef43e47a8c80456ce0a587..85eb4798d8d2a856bb6810db6bf66ecc3556600b 100644 (file)
@@ -34,7 +34,6 @@
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/ipcomp.h>
-#include <asm/scatterlist.h>
 #include <asm/semaphore.h>
 #include <linux/crypto.h>
 #include <linux/pfkeyv2.h>
index 4b9032880959421be4d8e08780f58efd38cdb726..06be2a1f27303d761b63aa0ce5c30da3c253eb65 100644 (file)
@@ -781,7 +781,7 @@ static int tcp_v6_do_calc_md5_hash(char *md5_hash, struct tcp_md5sig_key *key,
        sg_set_buf(&sg[block++], key->key, key->keylen);
        nbytes += key->keylen;
 
-       __sg_mark_end(&sg[block - 1]);
+       sg_mark_end(&sg[block - 1]);
 
        /* Now store the hash into the packet */
        err = crypto_hash_init(desc);
index bf7ba128b963a49c949b9e240209978dd691d2ac..e62fe55944b88774233059b247038be252d5844a 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/types.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
-#include <asm/scatterlist.h>
 
 #include <net/mac80211.h>
 #include "ieee80211_key.h"
index c387cf68a08c6431ef18ff2bd1df36b7b16e2f44..e09a95aa68ff7acf6cd98cf41947419a51c9f2d4 100644 (file)
@@ -702,7 +702,7 @@ static void rxkad_sg_set_buf2(struct scatterlist sg[2],
                nsg++;
        }
 
-       __sg_mark_end(&sg[nsg - 1]);
+       sg_mark_end(&sg[nsg - 1]);
 
        ASSERTCMP(sg[0].length + sg[1].length, ==, buflen);
 }
index ab7cbd6575c45d0c860e599cf27202dee5249c57..0dd792338fa96298bb523812e10ff81ebf4a7480 100644 (file)
@@ -211,8 +211,8 @@ encryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
-       __sg_mark_end(&desc->infrags[desc->fragno - 1]);
-       __sg_mark_end(&desc->outfrags[desc->fragno - 1]);
+       sg_mark_end(&desc->infrags[desc->fragno - 1]);
+       sg_mark_end(&desc->outfrags[desc->fragno - 1]);
 
        ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
                                          desc->infrags, thislen);
@@ -293,7 +293,7 @@ decryptor(struct scatterlist *sg, void *data)
        if (thislen == 0)
                return 0;
 
-       __sg_mark_end(&desc->frags[desc->fragno - 1]);
+       sg_mark_end(&desc->frags[desc->fragno - 1]);
 
        ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags,
                                          desc->frags, thislen);
index a0d9faa59cb55d6bc6720d5159301fbc0fa712f2..1c6eda5077c16683051a847fe0892dd253eb884e 100644 (file)
@@ -63,7 +63,6 @@
 #include <linux/jiffies.h>
 #include <linux/sunrpc/gss_krb5.h>
 #include <linux/random.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 
 #ifdef RPC_DEBUG
index 8bd074df27d36ece4d015dea8b4c5c9144fe95b2..3bdc527ee64a131e7b1dd705af5aa9e30e28952a 100644 (file)
@@ -4,7 +4,6 @@
 #include <linux/sunrpc/gss_krb5.h>
 #include <linux/random.h>
 #include <linux/pagemap.h>
-#include <asm/scatterlist.h>
 #include <linux/crypto.h>
 
 #ifdef RPC_DEBUG
index 0426388d351de58bf116ae526b791c8e42c22764..1686f64c4352c2ee19d565d54017608474a98b83 100644 (file)
@@ -21,7 +21,6 @@
 #if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE)
 #include <net/esp.h>
 #endif
-#include <asm/scatterlist.h>
 
 /*
  * Algorithms supported by IPsec.  These entries contain properties which