aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHank Janssen <hjanssen@microsoft.com>2010-12-06 15:26:48 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-06 19:11:09 -0500
commit02e37db7148a5ee98a742a0ff2f7e3acc406049b (patch)
tree2e494233726a204cbfc993a13def31d0c957ffc9
parent3d8cdf22b314f84cc4ae85ed650ccd37150a7562 (diff)
staging: hv: Convert camel case function names in storvsc.c to lowercase
Convert camel case function names in storvsc.c to lowercase Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/hv/blkvsc.c8
-rw-r--r--drivers/staging/hv/storvsc.c91
2 files changed, 51 insertions, 48 deletions
diff --git a/drivers/staging/hv/blkvsc.c b/drivers/staging/hv/blkvsc.c
index e62c922f11cb..208492ca781e 100644
--- a/drivers/staging/hv/blkvsc.c
+++ b/drivers/staging/hv/blkvsc.c
@@ -42,7 +42,7 @@ static int BlkVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
42 42
43 deviceInfo = (struct storvsc_device_info *)AdditionalInfo; 43 deviceInfo = (struct storvsc_device_info *)AdditionalInfo;
44 44
45 ret = StorVscOnDeviceAdd(Device, AdditionalInfo); 45 ret = stor_vsc_on_device_add(Device, AdditionalInfo);
46 if (ret != 0) 46 if (ret != 0)
47 return ret; 47 return ret;
48 48
@@ -94,9 +94,9 @@ int blk_vsc_initialize(struct hv_driver *Driver)
94 94
95 /* Setup the dispatch table */ 95 /* Setup the dispatch table */
96 storDriver->base.OnDeviceAdd = BlkVscOnDeviceAdd; 96 storDriver->base.OnDeviceAdd = BlkVscOnDeviceAdd;
97 storDriver->base.OnDeviceRemove = StorVscOnDeviceRemove; 97 storDriver->base.OnDeviceRemove = stor_vsc_on_device_remove;
98 storDriver->base.OnCleanup = StorVscOnCleanup; 98 storDriver->base.OnCleanup = stor_vsc_on_cleanup;
99 storDriver->on_io_request = StorVscOnIORequest; 99 storDriver->on_io_request = stor_vsc_on_io_request;
100 100
101 return ret; 101 return ret;
102} 102}
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 3b6e63aa4554..6643038aa24d 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -81,7 +81,7 @@ static const struct hv_guid gStorVscDeviceType = {
81}; 81};
82 82
83 83
84static inline struct storvsc_device *AllocStorDevice(struct hv_device *Device) 84static inline struct storvsc_device *alloc_stor_device(struct hv_device *Device)
85{ 85{
86 struct storvsc_device *storDevice; 86 struct storvsc_device *storDevice;
87 87
@@ -99,14 +99,14 @@ static inline struct storvsc_device *AllocStorDevice(struct hv_device *Device)
99 return storDevice; 99 return storDevice;
100} 100}
101 101
102static inline void FreeStorDevice(struct storvsc_device *Device) 102static inline void free_stor_device(struct storvsc_device *Device)
103{ 103{
104 /* ASSERT(atomic_read(&Device->ref_count) == 0); */ 104 /* ASSERT(atomic_read(&Device->ref_count) == 0); */
105 kfree(Device); 105 kfree(Device);
106} 106}
107 107
108/* Get the stordevice object iff exists and its refcount > 1 */ 108/* Get the stordevice object iff exists and its refcount > 1 */
109static inline struct storvsc_device *GetStorDevice(struct hv_device *Device) 109static inline struct storvsc_device *get_stor_device(struct hv_device *Device)
110{ 110{
111 struct storvsc_device *storDevice; 111 struct storvsc_device *storDevice;
112 112
@@ -120,7 +120,8 @@ static inline struct storvsc_device *GetStorDevice(struct hv_device *Device)
120} 120}
121 121
122/* Get the stordevice object iff exists and its refcount > 0 */ 122/* Get the stordevice object iff exists and its refcount > 0 */
123static inline struct storvsc_device *MustGetStorDevice(struct hv_device *Device) 123static inline struct storvsc_device *must_get_stor_device(
124 struct hv_device *Device)
124{ 125{
125 struct storvsc_device *storDevice; 126 struct storvsc_device *storDevice;
126 127
@@ -133,7 +134,7 @@ static inline struct storvsc_device *MustGetStorDevice(struct hv_device *Device)
133 return storDevice; 134 return storDevice;
134} 135}
135 136
136static inline void PutStorDevice(struct hv_device *Device) 137static inline void put_stor_device(struct hv_device *Device)
137{ 138{
138 struct storvsc_device *storDevice; 139 struct storvsc_device *storDevice;
139 140
@@ -144,8 +145,9 @@ static inline void PutStorDevice(struct hv_device *Device)
144 /* ASSERT(atomic_read(&storDevice->ref_count)); */ 145 /* ASSERT(atomic_read(&storDevice->ref_count)); */
145} 146}
146 147
147/* Drop ref count to 1 to effectively disable GetStorDevice() */ 148/* Drop ref count to 1 to effectively disable get_stor_device() */
148static inline struct storvsc_device *ReleaseStorDevice(struct hv_device *Device) 149static inline struct storvsc_device *release_stor_device(
150 struct hv_device *Device)
149{ 151{
150 struct storvsc_device *storDevice; 152 struct storvsc_device *storDevice;
151 153
@@ -160,7 +162,7 @@ static inline struct storvsc_device *ReleaseStorDevice(struct hv_device *Device)
160} 162}
161 163
162/* Drop ref count to 0. No one can use StorDevice object. */ 164/* Drop ref count to 0. No one can use StorDevice object. */
163static inline struct storvsc_device *FinalReleaseStorDevice( 165static inline struct storvsc_device *final_release_stor_device(
164 struct hv_device *Device) 166 struct hv_device *Device)
165{ 167{
166 struct storvsc_device *storDevice; 168 struct storvsc_device *storDevice;
@@ -176,14 +178,14 @@ static inline struct storvsc_device *FinalReleaseStorDevice(
176 return storDevice; 178 return storDevice;
177} 179}
178 180
179static int StorVscChannelInit(struct hv_device *Device) 181static int stor_vsc_channel_init(struct hv_device *Device)
180{ 182{
181 struct storvsc_device *storDevice; 183 struct storvsc_device *storDevice;
182 struct storvsc_request_extension *request; 184 struct storvsc_request_extension *request;
183 struct vstor_packet *vstorPacket; 185 struct vstor_packet *vstorPacket;
184 int ret; 186 int ret;
185 187
186 storDevice = GetStorDevice(Device); 188 storDevice = get_stor_device(Device);
187 if (!storDevice) { 189 if (!storDevice) {
188 DPRINT_ERR(STORVSC, "unable to get stor device..." 190 DPRINT_ERR(STORVSC, "unable to get stor device..."
189 "device being destroyed?"); 191 "device being destroyed?");
@@ -340,18 +342,18 @@ Cleanup:
340 kfree(request->wait_event); 342 kfree(request->wait_event);
341 request->wait_event = NULL; 343 request->wait_event = NULL;
342nomem: 344nomem:
343 PutStorDevice(Device); 345 put_stor_device(Device);
344 return ret; 346 return ret;
345} 347}
346 348
347static void StorVscOnIOCompletion(struct hv_device *Device, 349static void stor_vsc_on_io_completion(struct hv_device *Device,
348 struct vstor_packet *VStorPacket, 350 struct vstor_packet *VStorPacket,
349 struct storvsc_request_extension *RequestExt) 351 struct storvsc_request_extension *RequestExt)
350{ 352{
351 struct hv_storvsc_request *request; 353 struct hv_storvsc_request *request;
352 struct storvsc_device *storDevice; 354 struct storvsc_device *storDevice;
353 355
354 storDevice = MustGetStorDevice(Device); 356 storDevice = must_get_stor_device(Device);
355 if (!storDevice) { 357 if (!storDevice) {
356 DPRINT_ERR(STORVSC, "unable to get stor device..." 358 DPRINT_ERR(STORVSC, "unable to get stor device..."
357 "device being destroyed?"); 359 "device being destroyed?");
@@ -405,17 +407,17 @@ static void StorVscOnIOCompletion(struct hv_device *Device,
405 407
406 atomic_dec(&storDevice->num_outstanding_requests); 408 atomic_dec(&storDevice->num_outstanding_requests);
407 409
408 PutStorDevice(Device); 410 put_stor_device(Device);
409} 411}
410 412
411static void StorVscOnReceive(struct hv_device *Device, 413static void stor_vsc_on_receive(struct hv_device *Device,
412 struct vstor_packet *VStorPacket, 414 struct vstor_packet *VStorPacket,
413 struct storvsc_request_extension *RequestExt) 415 struct storvsc_request_extension *RequestExt)
414{ 416{
415 switch (VStorPacket->operation) { 417 switch (VStorPacket->operation) {
416 case VSTOR_OPERATION_COMPLETE_IO: 418 case VSTOR_OPERATION_COMPLETE_IO:
417 DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION"); 419 DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION");
418 StorVscOnIOCompletion(Device, VStorPacket, RequestExt); 420 stor_vsc_on_io_completion(Device, VStorPacket, RequestExt);
419 break; 421 break;
420 case VSTOR_OPERATION_REMOVE_DEVICE: 422 case VSTOR_OPERATION_REMOVE_DEVICE:
421 DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION"); 423 DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
@@ -429,7 +431,7 @@ static void StorVscOnReceive(struct hv_device *Device,
429 } 431 }
430} 432}
431 433
432static void StorVscOnChannelCallback(void *context) 434static void stor_vsc_on_channel_callback(void *context)
433{ 435{
434 struct hv_device *device = (struct hv_device *)context; 436 struct hv_device *device = (struct hv_device *)context;
435 struct storvsc_device *storDevice; 437 struct storvsc_device *storDevice;
@@ -441,7 +443,7 @@ static void StorVscOnChannelCallback(void *context)
441 443
442 /* ASSERT(device); */ 444 /* ASSERT(device); */
443 445
444 storDevice = MustGetStorDevice(device); 446 storDevice = must_get_stor_device(device);
445 if (!storDevice) { 447 if (!storDevice) {
446 DPRINT_ERR(STORVSC, "unable to get stor device..." 448 DPRINT_ERR(STORVSC, "unable to get stor device..."
447 "device being destroyed?"); 449 "device being destroyed?");
@@ -476,7 +478,7 @@ static void StorVscOnChannelCallback(void *context)
476 478
477 osd_waitevent_set(request->wait_event); 479 osd_waitevent_set(request->wait_event);
478 } else { 480 } else {
479 StorVscOnReceive(device, 481 stor_vsc_on_receive(device,
480 (struct vstor_packet *)packet, 482 (struct vstor_packet *)packet,
481 request); 483 request);
482 } 484 }
@@ -486,11 +488,11 @@ static void StorVscOnChannelCallback(void *context)
486 } 488 }
487 } while (1); 489 } while (1);
488 490
489 PutStorDevice(device); 491 put_stor_device(device);
490 return; 492 return;
491} 493}
492 494
493static int StorVscConnectToVsp(struct hv_device *Device) 495static int stor_vsc_connect_to_vsp(struct hv_device *Device)
494{ 496{
495 struct vmstorage_channel_properties props; 497 struct vmstorage_channel_properties props;
496 struct storvsc_driver_object *storDriver; 498 struct storvsc_driver_object *storDriver;
@@ -505,7 +507,7 @@ static int StorVscConnectToVsp(struct hv_device *Device)
505 storDriver->ring_buffer_size, 507 storDriver->ring_buffer_size,
506 (void *)&props, 508 (void *)&props,
507 sizeof(struct vmstorage_channel_properties), 509 sizeof(struct vmstorage_channel_properties),
508 StorVscOnChannelCallback, Device); 510 stor_vsc_on_channel_callback, Device);
509 511
510 DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d", 512 DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d",
511 props.path_id, props.target_id, props.max_transfer_bytes); 513 props.path_id, props.target_id, props.max_transfer_bytes);
@@ -515,16 +517,17 @@ static int StorVscConnectToVsp(struct hv_device *Device)
515 return -1; 517 return -1;
516 } 518 }
517 519
518 ret = StorVscChannelInit(Device); 520 ret = stor_vsc_channel_init(Device);
519 521
520 return ret; 522 return ret;
521} 523}
522 524
523/* 525/*
524 * StorVscOnDeviceAdd - Callback when the device belonging to this driver is added 526 * stor_vsc_on_device_add - Callback when the device belonging to this driver
525 * is added 527 * is added
526 */ 528 */
527static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) 529static int stor_vsc_on_device_add(struct hv_device *Device,
530 void *AdditionalInfo)
528{ 531{
529 struct storvsc_device *storDevice; 532 struct storvsc_device *storDevice;
530 /* struct vmstorage_channel_properties *props; */ 533 /* struct vmstorage_channel_properties *props; */
@@ -532,7 +535,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
532 int ret = 0; 535 int ret = 0;
533 536
534 deviceInfo = (struct storvsc_device_info *)AdditionalInfo; 537 deviceInfo = (struct storvsc_device_info *)AdditionalInfo;
535 storDevice = AllocStorDevice(Device); 538 storDevice = alloc_stor_device(Device);
536 if (!storDevice) { 539 if (!storDevice) {
537 ret = -1; 540 ret = -1;
538 goto Cleanup; 541 goto Cleanup;
@@ -555,7 +558,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
555 558
556 storDevice->port_number = deviceInfo->port_number; 559 storDevice->port_number = deviceInfo->port_number;
557 /* Send it back up */ 560 /* Send it back up */
558 ret = StorVscConnectToVsp(Device); 561 ret = stor_vsc_connect_to_vsp(Device);
559 562
560 /* deviceInfo->PortNumber = storDevice->PortNumber; */ 563 /* deviceInfo->PortNumber = storDevice->PortNumber; */
561 deviceInfo->path_id = storDevice->path_id; 564 deviceInfo->path_id = storDevice->path_id;
@@ -570,16 +573,16 @@ Cleanup:
570} 573}
571 574
572/* 575/*
573 * StorVscOnDeviceRemove - Callback when the our device is being removed 576 * stor_vsc_on_device_remove - Callback when the our device is being removed
574 */ 577 */
575static int StorVscOnDeviceRemove(struct hv_device *Device) 578static int stor_vsc_on_device_remove(struct hv_device *Device)
576{ 579{
577 struct storvsc_device *storDevice; 580 struct storvsc_device *storDevice;
578 581
579 DPRINT_INFO(STORVSC, "disabling storage device (%p)...", 582 DPRINT_INFO(STORVSC, "disabling storage device (%p)...",
580 Device->Extension); 583 Device->Extension);
581 584
582 storDevice = ReleaseStorDevice(Device); 585 storDevice = release_stor_device(Device);
583 586
584 /* 587 /*
585 * At this point, all outbound traffic should be disable. We 588 * At this point, all outbound traffic should be disable. We
@@ -595,14 +598,14 @@ static int StorVscOnDeviceRemove(struct hv_device *Device)
595 DPRINT_INFO(STORVSC, "removing storage device (%p)...", 598 DPRINT_INFO(STORVSC, "removing storage device (%p)...",
596 Device->Extension); 599 Device->Extension);
597 600
598 storDevice = FinalReleaseStorDevice(Device); 601 storDevice = final_release_stor_device(Device);
599 602
600 DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", storDevice); 603 DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", storDevice);
601 604
602 /* Close the channel */ 605 /* Close the channel */
603 vmbus_close(Device->channel); 606 vmbus_close(Device->channel);
604 607
605 FreeStorDevice(storDevice); 608 free_stor_device(storDevice);
606 return 0; 609 return 0;
607} 610}
608 611
@@ -615,7 +618,7 @@ int stor_vsc_on_host_reset(struct hv_device *Device)
615 618
616 DPRINT_INFO(STORVSC, "resetting host adapter..."); 619 DPRINT_INFO(STORVSC, "resetting host adapter...");
617 620
618 storDevice = GetStorDevice(Device); 621 storDevice = get_stor_device(Device);
619 if (!storDevice) { 622 if (!storDevice) {
620 DPRINT_ERR(STORVSC, "unable to get stor device..." 623 DPRINT_ERR(STORVSC, "unable to get stor device..."
621 "device being destroyed?"); 624 "device being destroyed?");
@@ -658,14 +661,14 @@ int stor_vsc_on_host_reset(struct hv_device *Device)
658 */ 661 */
659 662
660Cleanup: 663Cleanup:
661 PutStorDevice(Device); 664 put_stor_device(Device);
662 return ret; 665 return ret;
663} 666}
664 667
665/* 668/*
666 * StorVscOnIORequest - Callback to initiate an I/O request 669 * stor_vsc_on_io_request - Callback to initiate an I/O request
667 */ 670 */
668static int StorVscOnIORequest(struct hv_device *Device, 671static int stor_vsc_on_io_request(struct hv_device *Device,
669 struct hv_storvsc_request *Request) 672 struct hv_storvsc_request *Request)
670{ 673{
671 struct storvsc_device *storDevice; 674 struct storvsc_device *storDevice;
@@ -676,7 +679,7 @@ static int StorVscOnIORequest(struct hv_device *Device,
676 requestExtension = 679 requestExtension =
677 (struct storvsc_request_extension *)Request->extension; 680 (struct storvsc_request_extension *)Request->extension;
678 vstorPacket = &requestExtension->vstor_packet; 681 vstorPacket = &requestExtension->vstor_packet;
679 storDevice = GetStorDevice(Device); 682 storDevice = get_stor_device(Device);
680 683
681 DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, " 684 DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, "
682 "Extension %p", Device, storDevice, Request, 685 "Extension %p", Device, storDevice, Request,
@@ -751,14 +754,14 @@ static int StorVscOnIORequest(struct hv_device *Device,
751 754
752 atomic_inc(&storDevice->num_outstanding_requests); 755 atomic_inc(&storDevice->num_outstanding_requests);
753 756
754 PutStorDevice(Device); 757 put_stor_device(Device);
755 return ret; 758 return ret;
756} 759}
757 760
758/* 761/*
759 * StorVscOnCleanup - Perform any cleanup when the driver is removed 762 * stor_vsc_on_cleanup - Perform any cleanup when the driver is removed
760 */ 763 */
761static void StorVscOnCleanup(struct hv_driver *Driver) 764static void stor_vsc_on_cleanup(struct hv_driver *Driver)
762{ 765{
763} 766}
764 767
@@ -806,11 +809,11 @@ int stor_vsc_initialize(struct hv_driver *Driver)
806 STORVSC_MAX_IO_REQUESTS); 809 STORVSC_MAX_IO_REQUESTS);
807 810
808 /* Setup the dispatch table */ 811 /* Setup the dispatch table */
809 storDriver->base.OnDeviceAdd = StorVscOnDeviceAdd; 812 storDriver->base.OnDeviceAdd = stor_vsc_on_device_add;
810 storDriver->base.OnDeviceRemove = StorVscOnDeviceRemove; 813 storDriver->base.OnDeviceRemove = stor_vsc_on_device_remove;
811 storDriver->base.OnCleanup = StorVscOnCleanup; 814 storDriver->base.OnCleanup = stor_vsc_on_cleanup;
812 815
813 storDriver->on_io_request = StorVscOnIORequest; 816 storDriver->on_io_request = stor_vsc_on_io_request;
814 817
815 return 0; 818 return 0;
816} 819}