aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index e61f22be4d0e..44710d7e7bff 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -280,6 +280,15 @@ struct blk_queue_tag {
280 atomic_t refcnt; /* map can be shared */ 280 atomic_t refcnt; /* map can be shared */
281}; 281};
282 282
283#define BLK_SCSI_MAX_CMDS (256)
284#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
285
286struct blk_cmd_filter {
287 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
288 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
289 struct kobject kobj;
290};
291
283struct request_queue 292struct request_queue
284{ 293{
285 /* 294 /*
@@ -398,6 +407,7 @@ struct request_queue
398#if defined(CONFIG_BLK_DEV_BSG) 407#if defined(CONFIG_BLK_DEV_BSG)
399 struct bsg_class_device bsg_dev; 408 struct bsg_class_device bsg_dev;
400#endif 409#endif
410 struct blk_cmd_filter cmd_filter;
401}; 411};
402 412
403#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 413#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -807,8 +817,6 @@ extern void blk_put_queue(struct request_queue *);
807/* 817/*
808 * tag stuff 818 * tag stuff
809 */ 819 */
810#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
811#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
812#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) 820#define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED)
813extern int blk_queue_start_tag(struct request_queue *, struct request *); 821extern int blk_queue_start_tag(struct request_queue *, struct request *);
814extern struct request *blk_queue_find_tag(struct request_queue *, int); 822extern struct request *blk_queue_find_tag(struct request_queue *, int);
@@ -833,11 +841,11 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
833/* 841/*
834* command filter functions 842* command filter functions
835*/ 843*/
836extern int blk_verify_command(struct file *file, unsigned char *cmd); 844extern int blk_verify_command(struct blk_cmd_filter *filter,
837extern int blk_cmd_filter_verify_command(struct blk_scsi_cmd_filter *filter, 845 unsigned char *cmd, int has_write_perm);
838 unsigned char *cmd, mode_t *f_mode);
839extern int blk_register_filter(struct gendisk *disk); 846extern int blk_register_filter(struct gendisk *disk);
840extern void blk_unregister_filter(struct gendisk *disk); 847extern void blk_unregister_filter(struct gendisk *disk);
848extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
841 849
842#define MAX_PHYS_SEGMENTS 128 850#define MAX_PHYS_SEGMENTS 128
843#define MAX_HW_SEGMENTS 128 851#define MAX_HW_SEGMENTS 128