aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/cmd-filter.c30
-rw-r--r--block/scsi_ioctl.c2
2 files changed, 16 insertions, 16 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);