aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-09-18 12:31:53 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:17 -0400
commit9c02f2b02e29a2244e36c6e1f246080d8afc6cff (patch)
treed917ffa2e6ea5a75d180b72cc16e786da6a4b437 /fs
parent7ba1fbaa4a478f72fbaf5a56af9c82a77966b4c7 (diff)
block: cleanup some of the integrity stuff in blkdev.h
Don't put functions that are only used in fs/bio-integrity.c in blkdev.h, it's much cleaner to just keep it in there. Also kill completely unused bdev_get_tag_size() Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/bio-integrity.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index c3e174b35fe6..ba4ada08564a 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -150,6 +150,29 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
150} 150}
151EXPORT_SYMBOL(bio_integrity_add_page); 151EXPORT_SYMBOL(bio_integrity_add_page);
152 152
153static struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
154{
155 return bdev->bd_disk->integrity;
156}
157
158static int bdev_integrity_enabled(struct block_device *bdev, int rw)
159{
160 struct blk_integrity *bi = bdev_get_integrity(bdev);
161
162 if (bi == NULL)
163 return 0;
164
165 if (rw == READ && bi->verify_fn != NULL &&
166 (bi->flags & INTEGRITY_FLAG_READ))
167 return 1;
168
169 if (rw == WRITE && bi->generate_fn != NULL &&
170 (bi->flags & INTEGRITY_FLAG_WRITE))
171 return 1;
172
173 return 0;
174}
175
153/** 176/**
154 * bio_integrity_enabled - Check whether integrity can be passed 177 * bio_integrity_enabled - Check whether integrity can be passed
155 * @bio: bio to check 178 * @bio: bio to check
@@ -313,6 +336,14 @@ static void bio_integrity_generate(struct bio *bio)
313 } 336 }
314} 337}
315 338
339static inline unsigned short blk_integrity_tuple_size(struct blk_integrity *bi)
340{
341 if (bi)
342 return bi->tuple_size;
343
344 return 0;
345}
346
316/** 347/**
317 * bio_integrity_prep - Prepare bio for integrity I/O 348 * bio_integrity_prep - Prepare bio for integrity I/O
318 * @bio: bio to prepare 349 * @bio: bio to prepare