diff options
author | Asias He <asias@redhat.com> | 2013-05-06 04:38:26 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-07-07 07:38:53 -0400 |
commit | c7289312fe9b4077b5c15632b232e76144a220c6 (patch) | |
tree | aa46c223494c724bc791e5046ad990ebcea356c6 | |
parent | deeacef086a0b312da846aac7b7cd046523bf6c6 (diff) |
vhost-scsi: Rename struct vhost_scsi *s to *vs
vs is used everywhere, make the naming more consistent.
Signed-off-by: Asias He <asias@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | drivers/vhost/scsi.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d5a91cf84221..e5edb651b6d2 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -1337,63 +1337,63 @@ static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) | |||
1337 | 1337 | ||
1338 | static int vhost_scsi_open(struct inode *inode, struct file *f) | 1338 | static int vhost_scsi_open(struct inode *inode, struct file *f) |
1339 | { | 1339 | { |
1340 | struct vhost_scsi *s; | 1340 | struct vhost_scsi *vs; |
1341 | struct vhost_virtqueue **vqs; | 1341 | struct vhost_virtqueue **vqs; |
1342 | int r, i; | 1342 | int r, i; |
1343 | 1343 | ||
1344 | s = kzalloc(sizeof(*s), GFP_KERNEL); | 1344 | vs = kzalloc(sizeof(*vs), GFP_KERNEL); |
1345 | if (!s) | 1345 | if (!vs) |
1346 | return -ENOMEM; | 1346 | return -ENOMEM; |
1347 | 1347 | ||
1348 | vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL); | 1348 | vqs = kmalloc(VHOST_SCSI_MAX_VQ * sizeof(*vqs), GFP_KERNEL); |
1349 | if (!vqs) { | 1349 | if (!vqs) { |
1350 | kfree(s); | 1350 | kfree(vs); |
1351 | return -ENOMEM; | 1351 | return -ENOMEM; |
1352 | } | 1352 | } |
1353 | 1353 | ||
1354 | vhost_work_init(&s->vs_completion_work, vhost_scsi_complete_cmd_work); | 1354 | vhost_work_init(&vs->vs_completion_work, vhost_scsi_complete_cmd_work); |
1355 | vhost_work_init(&s->vs_event_work, tcm_vhost_evt_work); | 1355 | vhost_work_init(&vs->vs_event_work, tcm_vhost_evt_work); |
1356 | 1356 | ||
1357 | s->vs_events_nr = 0; | 1357 | vs->vs_events_nr = 0; |
1358 | s->vs_events_missed = false; | 1358 | vs->vs_events_missed = false; |
1359 | 1359 | ||
1360 | vqs[VHOST_SCSI_VQ_CTL] = &s->vqs[VHOST_SCSI_VQ_CTL].vq; | 1360 | vqs[VHOST_SCSI_VQ_CTL] = &vs->vqs[VHOST_SCSI_VQ_CTL].vq; |
1361 | vqs[VHOST_SCSI_VQ_EVT] = &s->vqs[VHOST_SCSI_VQ_EVT].vq; | 1361 | vqs[VHOST_SCSI_VQ_EVT] = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; |
1362 | s->vqs[VHOST_SCSI_VQ_CTL].vq.handle_kick = vhost_scsi_ctl_handle_kick; | 1362 | vs->vqs[VHOST_SCSI_VQ_CTL].vq.handle_kick = vhost_scsi_ctl_handle_kick; |
1363 | s->vqs[VHOST_SCSI_VQ_EVT].vq.handle_kick = vhost_scsi_evt_handle_kick; | 1363 | vs->vqs[VHOST_SCSI_VQ_EVT].vq.handle_kick = vhost_scsi_evt_handle_kick; |
1364 | for (i = VHOST_SCSI_VQ_IO; i < VHOST_SCSI_MAX_VQ; i++) { | 1364 | for (i = VHOST_SCSI_VQ_IO; i < VHOST_SCSI_MAX_VQ; i++) { |
1365 | vqs[i] = &s->vqs[i].vq; | 1365 | vqs[i] = &vs->vqs[i].vq; |
1366 | s->vqs[i].vq.handle_kick = vhost_scsi_handle_kick; | 1366 | vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick; |
1367 | } | 1367 | } |
1368 | r = vhost_dev_init(&s->dev, vqs, VHOST_SCSI_MAX_VQ); | 1368 | r = vhost_dev_init(&vs->dev, vqs, VHOST_SCSI_MAX_VQ); |
1369 | 1369 | ||
1370 | tcm_vhost_init_inflight(s, NULL); | 1370 | tcm_vhost_init_inflight(vs, NULL); |
1371 | 1371 | ||
1372 | if (r < 0) { | 1372 | if (r < 0) { |
1373 | kfree(vqs); | 1373 | kfree(vqs); |
1374 | kfree(s); | 1374 | kfree(vs); |
1375 | return r; | 1375 | return r; |
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | f->private_data = s; | 1378 | f->private_data = vs; |
1379 | return 0; | 1379 | return 0; |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | static int vhost_scsi_release(struct inode *inode, struct file *f) | 1382 | static int vhost_scsi_release(struct inode *inode, struct file *f) |
1383 | { | 1383 | { |
1384 | struct vhost_scsi *s = f->private_data; | 1384 | struct vhost_scsi *vs = f->private_data; |
1385 | struct vhost_scsi_target t; | 1385 | struct vhost_scsi_target t; |
1386 | 1386 | ||
1387 | mutex_lock(&s->dev.mutex); | 1387 | mutex_lock(&vs->dev.mutex); |
1388 | memcpy(t.vhost_wwpn, s->vs_vhost_wwpn, sizeof(t.vhost_wwpn)); | 1388 | memcpy(t.vhost_wwpn, vs->vs_vhost_wwpn, sizeof(t.vhost_wwpn)); |
1389 | mutex_unlock(&s->dev.mutex); | 1389 | mutex_unlock(&vs->dev.mutex); |
1390 | vhost_scsi_clear_endpoint(s, &t); | 1390 | vhost_scsi_clear_endpoint(vs, &t); |
1391 | vhost_dev_stop(&s->dev); | 1391 | vhost_dev_stop(&vs->dev); |
1392 | vhost_dev_cleanup(&s->dev, false); | 1392 | vhost_dev_cleanup(&vs->dev, false); |
1393 | /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */ | 1393 | /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */ |
1394 | vhost_scsi_flush(s); | 1394 | vhost_scsi_flush(vs); |
1395 | kfree(s->dev.vqs); | 1395 | kfree(vs->dev.vqs); |
1396 | kfree(s); | 1396 | kfree(vs); |
1397 | return 0; | 1397 | return 0; |
1398 | } | 1398 | } |
1399 | 1399 | ||