aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio-integrity.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-06-17 13:05:48 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-07-03 07:21:13 -0400
commitb984679efe1a616ec4ac919dba08286d71593900 (patch)
treeeb8bf50d5fddac43a059926e217d31f0fb0e4f0d /fs/bio-integrity.c
parentc1c72b59941e2f5aad4b02609d7ee7b121734b8d (diff)
block: integrity checkpatch cleanups
> 80 char lines and that sort of thing. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/bio-integrity.c')
-rw-r--r--fs/bio-integrity.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 31b08878913d..63e2ee63058d 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -39,7 +39,10 @@ static struct workqueue_struct *kintegrityd_wq;
39 * metadata. nr_vecs specifies the maximum number of pages containing 39 * metadata. nr_vecs specifies the maximum number of pages containing
40 * integrity metadata that can be attached. 40 * integrity metadata that can be attached.
41 */ 41 */
42struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio, gfp_t gfp_mask, unsigned int nr_vecs, struct bio_set *bs) 42struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *bio,
43 gfp_t gfp_mask,
44 unsigned int nr_vecs,
45 struct bio_set *bs)
43{ 46{
44 struct bio_integrity_payload *bip; 47 struct bio_integrity_payload *bip;
45 struct bio_vec *iv; 48 struct bio_vec *iv;
@@ -81,7 +84,9 @@ EXPORT_SYMBOL(bio_integrity_alloc_bioset);
81 * metadata. nr_vecs specifies the maximum number of pages containing 84 * metadata. nr_vecs specifies the maximum number of pages containing
82 * integrity metadata that can be attached. 85 * integrity metadata that can be attached.
83 */ 86 */
84struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, gfp_t gfp_mask, unsigned int nr_vecs) 87struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio,
88 gfp_t gfp_mask,
89 unsigned int nr_vecs)
85{ 90{
86 return bio_integrity_alloc_bioset(bio, gfp_mask, nr_vecs, fs_bio_set); 91 return bio_integrity_alloc_bioset(bio, gfp_mask, nr_vecs, fs_bio_set);
87} 92}
@@ -174,7 +179,8 @@ EXPORT_SYMBOL(bio_integrity_enabled);
174 * sector size of the storage device. Convert the block layer sectors 179 * sector size of the storage device. Convert the block layer sectors
175 * to physical sectors. 180 * to physical sectors.
176 */ 181 */
177static inline unsigned int bio_integrity_hw_sectors(struct blk_integrity *bi, unsigned int sectors) 182static inline unsigned int bio_integrity_hw_sectors(struct blk_integrity *bi,
183 unsigned int sectors)
178{ 184{
179 /* At this point there are only 512b or 4096b DIF/EPP devices */ 185 /* At this point there are only 512b or 4096b DIF/EPP devices */
180 if (bi->sector_size == 4096) 186 if (bi->sector_size == 4096)
@@ -212,7 +218,8 @@ int bio_integrity_tag(struct bio *bio, void *tag_buf, unsigned int len, int set)
212 if (bi->tag_size == 0) 218 if (bi->tag_size == 0)
213 return -1; 219 return -1;
214 220
215 nr_sectors = bio_integrity_hw_sectors(bi, DIV_ROUND_UP(len, bi->tag_size)); 221 nr_sectors = bio_integrity_hw_sectors(bi,
222 DIV_ROUND_UP(len, bi->tag_size));
216 223
217 if (nr_sectors * bi->tuple_size > bip->bip_size) { 224 if (nr_sectors * bi->tuple_size > bip->bip_size) {
218 printk(KERN_ERR "%s: tag too big for bio: %u > %u\n", 225 printk(KERN_ERR "%s: tag too big for bio: %u > %u\n",
@@ -456,7 +463,7 @@ static int bio_integrity_verify(struct bio *bio)
456 */ 463 */
457static void bio_integrity_verify_fn(struct work_struct *work) 464static void bio_integrity_verify_fn(struct work_struct *work)
458{ 465{
459 struct bio_integrity_payload *bip = 466 struct bio_integrity_payload *bip =
460 container_of(work, struct bio_integrity_payload, bip_work); 467 container_of(work, struct bio_integrity_payload, bip_work);
461 struct bio *bio = bip->bip_bio; 468 struct bio *bio = bip->bip_bio;
462 int error = bip->bip_error; 469 int error = bip->bip_error;
@@ -502,7 +509,8 @@ EXPORT_SYMBOL(bio_integrity_endio);
502 * @bip: Integrity vector to advance 509 * @bip: Integrity vector to advance
503 * @skip: Number of bytes to advance it 510 * @skip: Number of bytes to advance it
504 */ 511 */
505void bio_integrity_mark_head(struct bio_integrity_payload *bip, unsigned int skip) 512void bio_integrity_mark_head(struct bio_integrity_payload *bip,
513 unsigned int skip)
506{ 514{
507 struct bio_vec *iv; 515 struct bio_vec *iv;
508 unsigned int i; 516 unsigned int i;
@@ -527,7 +535,8 @@ void bio_integrity_mark_head(struct bio_integrity_payload *bip, unsigned int ski
527 * @bip: Integrity vector to truncate 535 * @bip: Integrity vector to truncate
528 * @len: New length of integrity vector 536 * @len: New length of integrity vector
529 */ 537 */
530void bio_integrity_mark_tail(struct bio_integrity_payload *bip, unsigned int len) 538void bio_integrity_mark_tail(struct bio_integrity_payload *bip,
539 unsigned int len)
531{ 540{
532 struct bio_vec *iv; 541 struct bio_vec *iv;
533 unsigned int i; 542 unsigned int i;
@@ -579,7 +588,8 @@ EXPORT_SYMBOL(bio_integrity_advance);
579 * and the length will be truncated corresponding to 'len' data 588 * and the length will be truncated corresponding to 'len' data
580 * sectors. 589 * sectors.
581 */ 590 */
582void bio_integrity_trim(struct bio *bio, unsigned int offset, unsigned int sectors) 591void bio_integrity_trim(struct bio *bio, unsigned int offset,
592 unsigned int sectors)
583{ 593{
584 struct bio_integrity_payload *bip = bio->bi_integrity; 594 struct bio_integrity_payload *bip = bio->bi_integrity;
585 struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); 595 struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev);
@@ -648,7 +658,8 @@ EXPORT_SYMBOL(bio_integrity_split);
648 * 658 *
649 * Description: Called to allocate a bip when cloning a bio 659 * Description: Called to allocate a bip when cloning a bio
650 */ 660 */
651int bio_integrity_clone(struct bio *bio, struct bio *bio_src, struct bio_set *bs) 661int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
662 struct bio_set *bs)
652{ 663{
653 struct bio_integrity_payload *bip_src = bio_src->bi_integrity; 664 struct bio_integrity_payload *bip_src = bio_src->bi_integrity;
654 struct bio_integrity_payload *bip; 665 struct bio_integrity_payload *bip;