diff options
author | Adel Gadllah <adel.gadllah@gmail.com> | 2008-06-26 13:48:27 +0200 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-07-03 13:21:14 +0200 |
commit | 0b07de85a76e1346e675f0e98437378932473df7 (patch) | |
tree | b86e5e0be27679c408ab525534c76162754129b9 /include/linux/genhd.h | |
parent | 6e2401ad6f33de15ff00f78b88159f00a14f3b35 (diff) | |
download | op-kernel-dev-0b07de85a76e1346e675f0e98437378932473df7.zip op-kernel-dev-0b07de85a76e1346e675f0e98437378932473df7.tar.gz |
allow userspace to modify scsi command filter on per device basis
This patch exports the per-gendisk command filter to user space through
sysfs, so it can be changed by the system administrator.
All users of the old cmd filter have been converted to use the new one.
Original patch from Peter Jones.
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r-- | include/linux/genhd.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 524ec96..e878741 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -110,6 +110,14 @@ struct hd_struct { #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 #define GENHD_FL_FAIL 64 +#define BLK_SCSI_MAX_CMDS (256) +#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) + +struct blk_scsi_cmd_filter { + unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; + unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; + struct kobject kobj; +}; struct gendisk { int major; /* major number of driver */ @@ -120,6 +128,7 @@ struct gendisk { struct hd_struct **part; /* [indexed by minor] */ struct block_device_operations *fops; struct request_queue *queue; + struct blk_scsi_cmd_filter cmd_filter; void *private_data; sector_t capacity; |