aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4e72a9d48232..281516ae8b4e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1139,6 +1139,16 @@ static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector
1139 & (lim->discard_granularity - 1); 1139 & (lim->discard_granularity - 1);
1140} 1140}
1141 1141
1142static inline int bdev_discard_alignment(struct block_device *bdev)
1143{
1144 struct request_queue *q = bdev_get_queue(bdev);
1145
1146 if (bdev != bdev->bd_contains)
1147 return bdev->bd_part->discard_alignment;
1148
1149 return q->limits.discard_alignment;
1150}
1151
1142static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) 1152static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
1143{ 1153{
1144 if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1) 1154 if (q->limits.max_discard_sectors && q->limits.discard_zeroes_data == 1)