diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2010-08-11 17:17:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 11:43:30 -0400 |
commit | 8d57a98ccd0b4489003473979da8f5a1363ba7a3 (patch) | |
tree | 2982997ce66bb6a92c020b7189966c3097095fd7 /block/elevator.c | |
parent | 93caf8e69eac763f6a20cf253ace8e7fc1ab7953 (diff) |
block: add secure discard
Secure discard is the same as discard except that all copies of the
discarded sectors (perhaps created by garbage collection) must also be
erased.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: Kyungmin Park <kmpark@infradead.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ben Gardiner <bengardiner@nanometrics.ca>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/elevator.c b/block/elevator.c index 816a7c8d6394..ec585c9554d3 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -83,6 +83,12 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio) | |||
83 | return 0; | 83 | return 0; |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Don't merge discard requests and secure discard requests | ||
87 | */ | ||
88 | if ((bio->bi_rw & REQ_SECURE) != (rq->bio->bi_rw & REQ_SECURE)) | ||
89 | return 0; | ||
90 | |||
91 | /* | ||
86 | * different data direction or already started, don't merge | 92 | * different data direction or already started, don't merge |
87 | */ | 93 | */ |
88 | if (bio_data_dir(bio) != rq_data_dir(rq)) | 94 | if (bio_data_dir(bio) != rq_data_dir(rq)) |