aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-07-26 05:03:25 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-08-27 03:50:19 -0400
commit4beab5c623fef4622f9a8593f85760ff10b5a3f7 (patch)
tree630ad8965703e3ea8296945f4db10c80a348d2b4
parent14e507b852e7dcea142b98757181bfa785cb4c05 (diff)
block: rename blk_scsi_cmd_filter to blk_cmd_filter
Technically, the cmd_filter would be applied to other protocols though it's unlikely to happen. Putting SCSI stuff to request_queue is kinda layer violation. So let's rename it. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--block/cmd-filter.c30
-rw-r--r--block/scsi_ioctl.c2
-rw-r--r--include/linux/blkdev.h8
3 files changed, 20 insertions, 20 deletions
diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index c705c33361a0..0e3a123944a8 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -27,7 +27,7 @@
27#include <scsi/scsi.h> 27#include <scsi/scsi.h>
28#include <linux/cdrom.h> 28#include <linux/cdrom.h>
29 29
30int blk_verify_command(struct blk_scsi_cmd_filter *filter, 30int blk_verify_command(struct blk_cmd_filter *filter,
31 unsigned char *cmd, int has_write_perm) 31 unsigned char *cmd, int has_write_perm)
32{ 32{
33 /* root can do any command. */ 33 /* root can do any command. */
@@ -51,7 +51,7 @@ int blk_verify_command(struct blk_scsi_cmd_filter *filter,
51EXPORT_SYMBOL(blk_verify_command); 51EXPORT_SYMBOL(blk_verify_command);
52 52
53/* and now, the sysfs stuff */ 53/* and now, the sysfs stuff */
54static ssize_t rcf_cmds_show(struct blk_scsi_cmd_filter *filter, char *page, 54static ssize_t rcf_cmds_show(struct blk_cmd_filter *filter, char *page,
55 int rw) 55 int rw)
56{ 56{
57 char *npage = page; 57 char *npage = page;
@@ -78,18 +78,18 @@ static ssize_t rcf_cmds_show(struct blk_scsi_cmd_filter *filter, char *page,
78 return npage - page; 78 return npage - page;
79} 79}
80 80
81static ssize_t rcf_readcmds_show(struct blk_scsi_cmd_filter *filter, char *page) 81static ssize_t rcf_readcmds_show(struct blk_cmd_filter *filter, char *page)
82{ 82{
83 return rcf_cmds_show(filter, page, READ); 83 return rcf_cmds_show(filter, page, READ);
84} 84}
85 85
86static ssize_t rcf_writecmds_show(struct blk_scsi_cmd_filter *filter, 86static ssize_t rcf_writecmds_show(struct blk_cmd_filter *filter,
87 char *page) 87 char *page)
88{ 88{
89 return rcf_cmds_show(filter, page, WRITE); 89 return rcf_cmds_show(filter, page, WRITE);
90} 90}
91 91
92static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter, 92static ssize_t rcf_cmds_store(struct blk_cmd_filter *filter,
93 const char *page, size_t count, int rw) 93 const char *page, size_t count, int rw)
94{ 94{
95 ssize_t ret = 0; 95 ssize_t ret = 0;
@@ -122,13 +122,13 @@ static ssize_t rcf_cmds_store(struct blk_scsi_cmd_filter *filter,
122 return count; 122 return count;
123} 123}
124 124
125static ssize_t rcf_readcmds_store(struct blk_scsi_cmd_filter *filter, 125static ssize_t rcf_readcmds_store(struct blk_cmd_filter *filter,
126 const char *page, size_t count) 126 const char *page, size_t count)
127{ 127{
128 return rcf_cmds_store(filter, page, count, READ); 128 return rcf_cmds_store(filter, page, count, READ);
129} 129}
130 130
131static ssize_t rcf_writecmds_store(struct blk_scsi_cmd_filter *filter, 131static ssize_t rcf_writecmds_store(struct blk_cmd_filter *filter,
132 const char *page, size_t count) 132 const char *page, size_t count)
133{ 133{
134 return rcf_cmds_store(filter, page, count, WRITE); 134 return rcf_cmds_store(filter, page, count, WRITE);
@@ -136,8 +136,8 @@ static ssize_t rcf_writecmds_store(struct blk_scsi_cmd_filter *filter,
136 136
137struct rcf_sysfs_entry { 137struct rcf_sysfs_entry {
138 struct attribute attr; 138 struct attribute attr;
139 ssize_t (*show)(struct blk_scsi_cmd_filter *, char *); 139 ssize_t (*show)(struct blk_cmd_filter *, char *);
140 ssize_t (*store)(struct blk_scsi_cmd_filter *, const char *, size_t); 140 ssize_t (*store)(struct blk_cmd_filter *, const char *, size_t);
141}; 141};
142 142
143static struct rcf_sysfs_entry rcf_readcmds_entry = { 143static struct rcf_sysfs_entry rcf_readcmds_entry = {
@@ -164,9 +164,9 @@ static ssize_t
164rcf_attr_show(struct kobject *kobj, struct attribute *attr, char *page) 164rcf_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
165{ 165{
166 struct rcf_sysfs_entry *entry = to_rcf(attr); 166 struct rcf_sysfs_entry *entry = to_rcf(attr);
167 struct blk_scsi_cmd_filter *filter; 167 struct blk_cmd_filter *filter;
168 168
169 filter = container_of(kobj, struct blk_scsi_cmd_filter, kobj); 169 filter = container_of(kobj, struct blk_cmd_filter, kobj);
170 if (entry->show) 170 if (entry->show)
171 return entry->show(filter, page); 171 return entry->show(filter, page);
172 172
@@ -178,7 +178,7 @@ rcf_attr_store(struct kobject *kobj, struct attribute *attr,
178 const char *page, size_t length) 178 const char *page, size_t length)
179{ 179{
180 struct rcf_sysfs_entry *entry = to_rcf(attr); 180 struct rcf_sysfs_entry *entry = to_rcf(attr);
181 struct blk_scsi_cmd_filter *filter; 181 struct blk_cmd_filter *filter;
182 182
183 if (!capable(CAP_SYS_RAWIO)) 183 if (!capable(CAP_SYS_RAWIO))
184 return -EPERM; 184 return -EPERM;
@@ -186,7 +186,7 @@ rcf_attr_store(struct kobject *kobj, struct attribute *attr,
186 if (!entry->store) 186 if (!entry->store)
187 return -EINVAL; 187 return -EINVAL;
188 188
189 filter = container_of(kobj, struct blk_scsi_cmd_filter, kobj); 189 filter = container_of(kobj, struct blk_cmd_filter, kobj);
190 return entry->store(filter, page, length); 190 return entry->store(filter, page, length);
191} 191}
192 192
@@ -203,7 +203,7 @@ static struct kobj_type rcf_ktype = {
203int blk_register_filter(struct gendisk *disk) 203int blk_register_filter(struct gendisk *disk)
204{ 204{
205 int ret; 205 int ret;
206 struct blk_scsi_cmd_filter *filter = &disk->queue->cmd_filter; 206 struct blk_cmd_filter *filter = &disk->queue->cmd_filter;
207 struct kobject *parent = kobject_get(disk->holder_dir->parent); 207 struct kobject *parent = kobject_get(disk->holder_dir->parent);
208 208
209 if (!parent) 209 if (!parent)
@@ -220,7 +220,7 @@ int blk_register_filter(struct gendisk *disk)
220 220
221void blk_unregister_filter(struct gendisk *disk) 221void blk_unregister_filter(struct gendisk *disk)
222{ 222{
223 struct blk_scsi_cmd_filter *filter = &disk->queue->cmd_filter; 223 struct blk_cmd_filter *filter = &disk->queue->cmd_filter;
224 224
225 kobject_put(&filter->kobj); 225 kobject_put(&filter->kobj);
226 kobject_put(disk->holder_dir->parent); 226 kobject_put(disk->holder_dir->parent);
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index d01ef5ee427e..ec4b7f234626 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -105,7 +105,7 @@ static int sg_emulated_host(struct request_queue *q, int __user *p)
105 return put_user(1, p); 105 return put_user(1, p);
106} 106}
107 107
108void blk_set_cmd_filter_defaults(struct blk_scsi_cmd_filter *filter) 108void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter)
109{ 109{
110 /* Basic read-only commands */ 110 /* Basic read-only commands */
111 __set_bit(TEST_UNIT_READY, filter->read_ok); 111 __set_bit(TEST_UNIT_READY, filter->read_ok);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d2d34e2774b2..ab247d589ad6 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -283,7 +283,7 @@ struct blk_queue_tag {
283#define BLK_SCSI_MAX_CMDS (256) 283#define BLK_SCSI_MAX_CMDS (256)
284#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) 284#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
285 285
286struct blk_scsi_cmd_filter { 286struct blk_cmd_filter {
287 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; 287 unsigned long read_ok[BLK_SCSI_CMD_PER_LONG];
288 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; 288 unsigned long write_ok[BLK_SCSI_CMD_PER_LONG];
289 struct kobject kobj; 289 struct kobject kobj;
@@ -407,7 +407,7 @@ struct request_queue
407#if defined(CONFIG_BLK_DEV_BSG) 407#if defined(CONFIG_BLK_DEV_BSG)
408 struct bsg_class_device bsg_dev; 408 struct bsg_class_device bsg_dev;
409#endif 409#endif
410 struct blk_scsi_cmd_filter cmd_filter; 410 struct blk_cmd_filter cmd_filter;
411}; 411};
412 412
413#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 413#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -843,11 +843,11 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
843/* 843/*
844* command filter functions 844* command filter functions
845*/ 845*/
846extern int blk_verify_command(struct blk_scsi_cmd_filter *filter, 846extern int blk_verify_command(struct blk_cmd_filter *filter,
847 unsigned char *cmd, int has_write_perm); 847 unsigned char *cmd, int has_write_perm);
848extern int blk_register_filter(struct gendisk *disk); 848extern int blk_register_filter(struct gendisk *disk);
849extern void blk_unregister_filter(struct gendisk *disk); 849extern void blk_unregister_filter(struct gendisk *disk);
850extern void blk_set_cmd_filter_defaults(struct blk_scsi_cmd_filter *filter); 850extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
851 851
852#define MAX_PHYS_SEGMENTS 128 852#define MAX_PHYS_SEGMENTS 128
853#define MAX_HW_SEGMENTS 128 853#define MAX_HW_SEGMENTS 128