History

block: add a separate operation type for secure erase

Instead of overloading the discard support with the REQ_SECURE flag. Use the opportunity to rename the queue flag as well, and remove the dead checks for this flag in the RAID 1 and RAID 10 drivers that don't claim support for secure erase.

Christoph Hellwig committed 10 years ago

Commit 288dab81 parent 56332f012 files · +63 −65Browse files

Showing the changes to include/linux/blkdev.h (1 of 12 files). Show all

Unified · Split

include/linux/blkdev.h+4−19
@@ -497,7 +497,7 @@ struct request_queue { · 496 unmodified lines
497497 #define QUEUE_FLAG_DISCARD 14 /* supports DISCARD */
498498 #define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */
499499 #define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */
500−#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */
500+#define QUEUE_FLAG_SECERASE 17 /* supports secure erase */
501501 #define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */
502502 #define QUEUE_FLAG_DEAD 19 /* queue tear-down finished */
503503 #define QUEUE_FLAG_INIT_DONE 20 /* queue is initialized */
@@ -593,8 +593,8 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) · 89 unmodified lines
593593 #define blk_queue_stackable(q) \
594594 test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags)
595595 #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags)
596−#define blk_queue_secdiscard(q) (blk_queue_discard(q) && \
597− test_bit(QUEUE_FLAG_SECDISCARD, &(q)->queue_flags))
596+#define blk_queue_secure_erase(q) \
597+ (test_bit(QUEUE_FLAG_SECERASE, &(q)->queue_flags))
598598
599599 #define blk_noretry_request(rq) \
600600 ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \
@@ -675,21 +675,6 @@ static inline bool rq_mergeable(struct request *rq) · 74 unmodified lines
675675 return true;
676676 }
677677
678−static inline bool blk_check_merge_flags(unsigned int flags1, unsigned int op1,
679− unsigned int flags2, unsigned int op2)
680−{
681− if ((op1 == REQ_OP_DISCARD) != (op2 == REQ_OP_DISCARD))
682− return false;
683−
684− if ((flags1 & REQ_SECURE) != (flags2 & REQ_SECURE))
685− return false;
686−
687− if ((op1 == REQ_OP_WRITE_SAME) != (op2 == REQ_OP_WRITE_SAME))
688− return false;
689−
690− return true;
691−}
692−
693678 static inline bool blk_write_same_mergeable(struct bio *a, struct bio *b)
694679 {
695680 if (bio_data(a) == bio_data(b))
@@ -1158,7 +1143,7 @@ extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *); · 462 unmodified lines
11581143 extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
11591144 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
11601145 extern int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
1161− sector_t nr_sects, gfp_t gfp_mask, int op_flags,
1146+ sector_t nr_sects, gfp_t gfp_mask, int flags,
11621147 struct bio **biop);
11631148 extern int blkdev_issue_write_same(struct block_device *bdev, sector_t sector,
11641149 sector_t nr_sects, gfp_t gfp_mask, struct page *page);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t