Commit 8c5553678237b7121355108e03c36086037d8975
Committed by
Jens Axboe
1 parent
31725e65c7
Exists in
master
and in
7 other branches
block: remove the BLKDEV_IFL_BARRIER flag
Remove support for barriers on discards, which is unused now. Also remove the DISCARD_NOBARRIER I/O type in favour of just setting the rw flags up locally in blkdev_issue_discard. tj: Also remove DISCARD_SECURE and use REQ_SECURE directly. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Showing 3 changed files with 2 additions and 26 deletions Side-by-side Diff
block/blk-lib.c
... | ... | @@ -39,8 +39,7 @@ |
39 | 39 | { |
40 | 40 | DECLARE_COMPLETION_ONSTACK(wait); |
41 | 41 | struct request_queue *q = bdev_get_queue(bdev); |
42 | - int type = flags & BLKDEV_IFL_BARRIER ? | |
43 | - DISCARD_BARRIER : DISCARD_NOBARRIER; | |
42 | + int type = REQ_WRITE | REQ_DISCARD; | |
44 | 43 | unsigned int max_discard_sectors; |
45 | 44 | struct bio *bio; |
46 | 45 | int ret = 0; |
... | ... | @@ -65,7 +64,7 @@ |
65 | 64 | if (flags & BLKDEV_IFL_SECURE) { |
66 | 65 | if (!blk_queue_secdiscard(q)) |
67 | 66 | return -EOPNOTSUPP; |
68 | - type |= DISCARD_SECURE; | |
67 | + type |= REQ_SECURE; | |
69 | 68 | } |
70 | 69 | |
71 | 70 | while (nr_sects && !ret) { |
... | ... | @@ -162,12 +161,6 @@ |
162 | 161 | bb.wait = &wait; |
163 | 162 | bb.end_io = NULL; |
164 | 163 | |
165 | - if (flags & BLKDEV_IFL_BARRIER) { | |
166 | - /* issue async barrier before the data */ | |
167 | - ret = blkdev_issue_flush(bdev, gfp_mask, NULL, 0); | |
168 | - if (ret) | |
169 | - return ret; | |
170 | - } | |
171 | 164 | submit: |
172 | 165 | ret = 0; |
173 | 166 | while (nr_sects != 0) { |
... | ... | @@ -199,13 +192,6 @@ |
199 | 192 | issued++; |
200 | 193 | submit_bio(WRITE, bio); |
201 | 194 | } |
202 | - /* | |
203 | - * When all data bios are in flight. Send final barrier if requeted. | |
204 | - */ | |
205 | - if (nr_sects == 0 && flags & BLKDEV_IFL_BARRIER) | |
206 | - ret = blkdev_issue_flush(bdev, gfp_mask, NULL, | |
207 | - flags & BLKDEV_IFL_WAIT); | |
208 | - | |
209 | 195 | |
210 | 196 | if (flags & BLKDEV_IFL_WAIT) |
211 | 197 | /* Wait for bios in-flight */ |
include/linux/blkdev.h
... | ... | @@ -869,11 +869,9 @@ |
869 | 869 | } |
870 | 870 | enum{ |
871 | 871 | BLKDEV_WAIT, /* wait for completion */ |
872 | - BLKDEV_BARRIER, /* issue request with barrier */ | |
873 | 872 | BLKDEV_SECURE, /* secure discard */ |
874 | 873 | }; |
875 | 874 | #define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT) |
876 | -#define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER) | |
877 | 875 | #define BLKDEV_IFL_SECURE (1 << BLKDEV_SECURE) |
878 | 876 | extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *, |
879 | 877 | unsigned long); |
include/linux/fs.h
... | ... | @@ -163,14 +163,6 @@ |
163 | 163 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ |
164 | 164 | REQ_FLUSH | REQ_FUA) |
165 | 165 | |
166 | -/* | |
167 | - * These aren't really reads or writes, they pass down information about | |
168 | - * parts of device that are now unused by the file system. | |
169 | - */ | |
170 | -#define DISCARD_NOBARRIER (WRITE | REQ_DISCARD) | |
171 | -#define DISCARD_BARRIER (WRITE | REQ_DISCARD | REQ_HARDBARRIER) | |
172 | -#define DISCARD_SECURE (DISCARD_NOBARRIER | REQ_SECURE) | |
173 | - | |
174 | 166 | #define SEL_IN 1 |
175 | 167 | #define SEL_OUT 2 |
176 | 168 | #define SEL_EX 4 |