summaryrefslogtreecommitdiff
path: root/drivers/md/dm-thin.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-09-29 12:52:07 +0200
committerTakashi Iwai <tiwai@suse.de>2015-09-29 12:52:07 +0200
commitd8dfacf8b50c260d79864933ac82a8198a0908a9 (patch)
treeb172eb8643de7bd9f9439c58031b06c98116d86a /drivers/md/dm-thin.c
parente87359efcaf45efc41dbaa6ec25eb26705300cee (diff)
parentdf075feefbd347f13fba5198294cda619532c237 (diff)
downloadlinux-d8dfacf8b50c260d79864933ac82a8198a0908a9.tar.gz
linux-d8dfacf8b50c260d79864933ac82a8198a0908a9.tar.xz
Merge branch 'topic/firewire-update' into for-next
Diffstat (limited to 'drivers/md/dm-thin.c')
-rw-r--r--drivers/md/dm-thin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 6578b7bc1fbb..6fcbfb063366 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -4249,6 +4249,10 @@ static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)
{
struct thin_c *tc = ti->private;
struct pool *pool = tc->pool;
+ struct queue_limits *pool_limits = dm_get_queue_limits(pool->pool_md);
+
+ if (!pool_limits->discard_granularity)
+ return; /* pool's discard support is disabled */
limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT;
limits->max_discard_sectors = 2048 * 1024 * 16; /* 16G */