Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[sfrench/cifs-2.6.git] / block / blk-lib.c
index c1fc55a83ba14ad81f86567c14fc283ae9350b3f..c392029a104e0f233fb10022a323ee1ab7ed0118 100644 (file)
@@ -62,6 +62,12 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
                max_discard_sectors &= ~(disc_sects - 1);
        }
 
+       if (flags & BLKDEV_IFL_SECURE) {
+               if (!blk_queue_secdiscard(q))
+                       return -EOPNOTSUPP;
+               type |= DISCARD_SECURE;
+       }
+
        while (nr_sects && !ret) {
                bio = bio_alloc(gfp_mask, 1);
                if (!bio) {