Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73099
b: refs/heads/master
c: c46f233
h: refs/heads/master
i:
  73097: ab673cb
  73095: 08a2af1
v: v3
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Nov 2, 2007
1 parent b394028 commit 282589b
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87ae9afdcada236d0a1b38ce2c465a65916961dc
refs/heads/master: c46f2334c84c2b26baa64d42d75ddc5fab38c3dc
2 changes: 1 addition & 1 deletion trunk/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
} /* segments in rq */

if (sg)
__sg_mark_end(sg);
sg_mark_end(sg);

return nsegs;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions trunk/include/linux/scatterlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +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)
{
sgl[nents - 1].page_link = 0x02;
}

static inline void __sg_mark_end(struct scatterlist *sg)
static inline void sg_mark_end(struct scatterlist *sg)
{
#ifdef CONFIG_DEBUG_SG
BUG_ON(sg->sg_magic != SG_MAGIC);
#endif
/*
* Set termination bit, clear potential chain bit
*/
sg->page_link |= 0x02;
sg->page_link &= ~0x01;
}

/**
Expand All @@ -218,14 +220,14 @@ static inline void __sg_mark_end(struct scatterlist *sg)
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;
for (i = 0; i < nents; i++)
sgl[i].sg_magic = SG_MAGIC;
}
#endif
sg_mark_end(&sgl[nents - 1]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/rxrpc/rxkad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/sunrpc/auth_gss/gss_krb5_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 282589b

Please sign in to comment.