Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: add a bdev_has_integrity_csum helper

Factor out a helper to see if the block device has an integrity checksum
from bdev_stable_writes so that it can be reused for other checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
7afe9394 a9366556

+10 -6
+10 -6
include/linux/blkdev.h
··· 1477 1477 return bdev->bd_disk->queue->limits.features & BLK_FEAT_SYNCHRONOUS; 1478 1478 } 1479 1479 1480 + static inline bool bdev_has_integrity_csum(struct block_device *bdev) 1481 + { 1482 + struct queue_limits *lim = bdev_limits(bdev); 1483 + 1484 + return IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY) && 1485 + lim->integrity.csum_type != BLK_INTEGRITY_CSUM_NONE; 1486 + } 1487 + 1480 1488 static inline bool bdev_stable_writes(struct block_device *bdev) 1481 1489 { 1482 - struct request_queue *q = bdev_get_queue(bdev); 1483 - 1484 - if (IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY) && 1485 - q->limits.integrity.csum_type != BLK_INTEGRITY_CSUM_NONE) 1486 - return true; 1487 - return q->limits.features & BLK_FEAT_STABLE_WRITES; 1490 + return bdev_has_integrity_csum(bdev) || 1491 + (bdev_limits(bdev)->features & BLK_FEAT_STABLE_WRITES); 1488 1492 } 1489 1493 1490 1494 static inline bool blk_queue_write_cache(struct request_queue *q)