Lines Matching refs:bdev
13 static sector_t bio_discard_limit(struct block_device *bdev, sector_t sector) in bio_discard_limit() argument
15 unsigned int discard_granularity = bdev_discard_granularity(bdev); in bio_discard_limit()
18 if (bdev_is_partition(bdev)) in bio_discard_limit()
19 sector += bdev->bd_start_sect; in bio_discard_limit()
38 int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, in __blkdev_issue_discard() argument
44 if (bdev_read_only(bdev)) in __blkdev_issue_discard()
46 if (!bdev_max_discard_sectors(bdev)) in __blkdev_issue_discard()
50 if (WARN_ON_ONCE(!bdev_discard_granularity(bdev))) { in __blkdev_issue_discard()
52 bdev); in __blkdev_issue_discard()
56 bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1; in __blkdev_issue_discard()
65 min(nr_sects, bio_discard_limit(bdev, sector)); in __blkdev_issue_discard()
67 bio = blk_next_bio(bio, bdev, 0, REQ_OP_DISCARD, gfp_mask); in __blkdev_issue_discard()
97 int blkdev_issue_discard(struct block_device *bdev, sector_t sector, in blkdev_issue_discard() argument
105 ret = __blkdev_issue_discard(bdev, sector, nr_sects, gfp_mask, &bio); in blkdev_issue_discard()
118 static int __blkdev_issue_write_zeroes(struct block_device *bdev, in __blkdev_issue_write_zeroes() argument
125 if (bdev_read_only(bdev)) in __blkdev_issue_write_zeroes()
129 max_write_zeroes_sectors = bdev_write_zeroes_sectors(bdev); in __blkdev_issue_write_zeroes()
135 bio = blk_next_bio(bio, bdev, 0, REQ_OP_WRITE_ZEROES, gfp_mask); in __blkdev_issue_write_zeroes()
168 static int __blkdev_issue_zero_pages(struct block_device *bdev, in __blkdev_issue_zero_pages() argument
176 if (bdev_read_only(bdev)) in __blkdev_issue_zero_pages()
180 bio = blk_next_bio(bio, bdev, __blkdev_sectors_to_bio_pages(nr_sects), in __blkdev_issue_zero_pages()
218 int __blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, in __blkdev_issue_zeroout() argument
225 bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1; in __blkdev_issue_zeroout()
229 ret = __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp_mask, in __blkdev_issue_zeroout()
234 return __blkdev_issue_zero_pages(bdev, sector, nr_sects, gfp_mask, in __blkdev_issue_zeroout()
252 int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector, in blkdev_issue_zeroout() argument
259 bool try_write_zeroes = !!bdev_write_zeroes_sectors(bdev); in blkdev_issue_zeroout()
261 bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1; in blkdev_issue_zeroout()
269 ret = __blkdev_issue_write_zeroes(bdev, sector, nr_sects, in blkdev_issue_zeroout()
272 ret = __blkdev_issue_zero_pages(bdev, sector, nr_sects, in blkdev_issue_zeroout()
288 if (!bdev_write_zeroes_sectors(bdev)) { in blkdev_issue_zeroout()
303 int blkdev_issue_secure_erase(struct block_device *bdev, sector_t sector, in blkdev_issue_secure_erase() argument
306 sector_t bs_mask = (bdev_logical_block_size(bdev) >> 9) - 1; in blkdev_issue_secure_erase()
307 unsigned int max_sectors = bdev_max_secure_erase_sectors(bdev); in blkdev_issue_secure_erase()
321 if (bdev_read_only(bdev)) in blkdev_issue_secure_erase()
328 bio = blk_next_bio(bio, bdev, 0, REQ_OP_SECURE_ERASE, gfp); in blkdev_issue_secure_erase()