Commit 02e37db7 authored by Hank Janssen's avatar Hank Janssen Committed by Greg Kroah-Hartman

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: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3d8cdf22
...@@ -42,7 +42,7 @@ static int BlkVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) ...@@ -42,7 +42,7 @@ static int BlkVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
deviceInfo = (struct storvsc_device_info *)AdditionalInfo; deviceInfo = (struct storvsc_device_info *)AdditionalInfo;
ret = StorVscOnDeviceAdd(Device, AdditionalInfo); ret = stor_vsc_on_device_add(Device, AdditionalInfo);
if (ret != 0) if (ret != 0)
return ret; return ret;
...@@ -94,9 +94,9 @@ int blk_vsc_initialize(struct hv_driver *Driver) ...@@ -94,9 +94,9 @@ int blk_vsc_initialize(struct hv_driver *Driver)
/* Setup the dispatch table */ /* Setup the dispatch table */
storDriver->base.OnDeviceAdd = BlkVscOnDeviceAdd; storDriver->base.OnDeviceAdd = BlkVscOnDeviceAdd;
storDriver->base.OnDeviceRemove = StorVscOnDeviceRemove; storDriver->base.OnDeviceRemove = stor_vsc_on_device_remove;
storDriver->base.OnCleanup = StorVscOnCleanup; storDriver->base.OnCleanup = stor_vsc_on_cleanup;
storDriver->on_io_request = StorVscOnIORequest; storDriver->on_io_request = stor_vsc_on_io_request;
return ret; return ret;
} }
...@@ -81,7 +81,7 @@ static const struct hv_guid gStorVscDeviceType = { ...@@ -81,7 +81,7 @@ static const struct hv_guid gStorVscDeviceType = {
}; };
static inline struct storvsc_device *AllocStorDevice(struct hv_device *Device) static inline struct storvsc_device *alloc_stor_device(struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -99,14 +99,14 @@ static inline struct storvsc_device *AllocStorDevice(struct hv_device *Device) ...@@ -99,14 +99,14 @@ static inline struct storvsc_device *AllocStorDevice(struct hv_device *Device)
return storDevice; return storDevice;
} }
static inline void FreeStorDevice(struct storvsc_device *Device) static inline void free_stor_device(struct storvsc_device *Device)
{ {
/* ASSERT(atomic_read(&Device->ref_count) == 0); */ /* ASSERT(atomic_read(&Device->ref_count) == 0); */
kfree(Device); kfree(Device);
} }
/* Get the stordevice object iff exists and its refcount > 1 */ /* Get the stordevice object iff exists and its refcount > 1 */
static inline struct storvsc_device *GetStorDevice(struct hv_device *Device) static inline struct storvsc_device *get_stor_device(struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -120,7 +120,8 @@ static inline struct storvsc_device *GetStorDevice(struct hv_device *Device) ...@@ -120,7 +120,8 @@ static inline struct storvsc_device *GetStorDevice(struct hv_device *Device)
} }
/* Get the stordevice object iff exists and its refcount > 0 */ /* Get the stordevice object iff exists and its refcount > 0 */
static inline struct storvsc_device *MustGetStorDevice(struct hv_device *Device) static inline struct storvsc_device *must_get_stor_device(
struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -133,7 +134,7 @@ static inline struct storvsc_device *MustGetStorDevice(struct hv_device *Device) ...@@ -133,7 +134,7 @@ static inline struct storvsc_device *MustGetStorDevice(struct hv_device *Device)
return storDevice; return storDevice;
} }
static inline void PutStorDevice(struct hv_device *Device) static inline void put_stor_device(struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -144,8 +145,9 @@ static inline void PutStorDevice(struct hv_device *Device) ...@@ -144,8 +145,9 @@ static inline void PutStorDevice(struct hv_device *Device)
/* ASSERT(atomic_read(&storDevice->ref_count)); */ /* ASSERT(atomic_read(&storDevice->ref_count)); */
} }
/* Drop ref count to 1 to effectively disable GetStorDevice() */ /* Drop ref count to 1 to effectively disable get_stor_device() */
static inline struct storvsc_device *ReleaseStorDevice(struct hv_device *Device) static inline struct storvsc_device *release_stor_device(
struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -160,7 +162,7 @@ static inline struct storvsc_device *ReleaseStorDevice(struct hv_device *Device) ...@@ -160,7 +162,7 @@ static inline struct storvsc_device *ReleaseStorDevice(struct hv_device *Device)
} }
/* Drop ref count to 0. No one can use StorDevice object. */ /* Drop ref count to 0. No one can use StorDevice object. */
static inline struct storvsc_device *FinalReleaseStorDevice( static inline struct storvsc_device *final_release_stor_device(
struct hv_device *Device) struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -176,14 +178,14 @@ static inline struct storvsc_device *FinalReleaseStorDevice( ...@@ -176,14 +178,14 @@ static inline struct storvsc_device *FinalReleaseStorDevice(
return storDevice; return storDevice;
} }
static int StorVscChannelInit(struct hv_device *Device) static int stor_vsc_channel_init(struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
struct storvsc_request_extension *request; struct storvsc_request_extension *request;
struct vstor_packet *vstorPacket; struct vstor_packet *vstorPacket;
int ret; int ret;
storDevice = GetStorDevice(Device); storDevice = get_stor_device(Device);
if (!storDevice) { if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..." DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?"); "device being destroyed?");
...@@ -340,18 +342,18 @@ static int StorVscChannelInit(struct hv_device *Device) ...@@ -340,18 +342,18 @@ static int StorVscChannelInit(struct hv_device *Device)
kfree(request->wait_event); kfree(request->wait_event);
request->wait_event = NULL; request->wait_event = NULL;
nomem: nomem:
PutStorDevice(Device); put_stor_device(Device);
return ret; return ret;
} }
static void StorVscOnIOCompletion(struct hv_device *Device, static void stor_vsc_on_io_completion(struct hv_device *Device,
struct vstor_packet *VStorPacket, struct vstor_packet *VStorPacket,
struct storvsc_request_extension *RequestExt) struct storvsc_request_extension *RequestExt)
{ {
struct hv_storvsc_request *request; struct hv_storvsc_request *request;
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
storDevice = MustGetStorDevice(Device); storDevice = must_get_stor_device(Device);
if (!storDevice) { if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..." DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?"); "device being destroyed?");
...@@ -405,17 +407,17 @@ static void StorVscOnIOCompletion(struct hv_device *Device, ...@@ -405,17 +407,17 @@ static void StorVscOnIOCompletion(struct hv_device *Device,
atomic_dec(&storDevice->num_outstanding_requests); atomic_dec(&storDevice->num_outstanding_requests);
PutStorDevice(Device); put_stor_device(Device);
} }
static void StorVscOnReceive(struct hv_device *Device, static void stor_vsc_on_receive(struct hv_device *Device,
struct vstor_packet *VStorPacket, struct vstor_packet *VStorPacket,
struct storvsc_request_extension *RequestExt) struct storvsc_request_extension *RequestExt)
{ {
switch (VStorPacket->operation) { switch (VStorPacket->operation) {
case VSTOR_OPERATION_COMPLETE_IO: case VSTOR_OPERATION_COMPLETE_IO:
DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION"); DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION");
StorVscOnIOCompletion(Device, VStorPacket, RequestExt); stor_vsc_on_io_completion(Device, VStorPacket, RequestExt);
break; break;
case VSTOR_OPERATION_REMOVE_DEVICE: case VSTOR_OPERATION_REMOVE_DEVICE:
DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION"); DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
...@@ -429,7 +431,7 @@ static void StorVscOnReceive(struct hv_device *Device, ...@@ -429,7 +431,7 @@ static void StorVscOnReceive(struct hv_device *Device,
} }
} }
static void StorVscOnChannelCallback(void *context) static void stor_vsc_on_channel_callback(void *context)
{ {
struct hv_device *device = (struct hv_device *)context; struct hv_device *device = (struct hv_device *)context;
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -441,7 +443,7 @@ static void StorVscOnChannelCallback(void *context) ...@@ -441,7 +443,7 @@ static void StorVscOnChannelCallback(void *context)
/* ASSERT(device); */ /* ASSERT(device); */
storDevice = MustGetStorDevice(device); storDevice = must_get_stor_device(device);
if (!storDevice) { if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..." DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?"); "device being destroyed?");
...@@ -476,7 +478,7 @@ static void StorVscOnChannelCallback(void *context) ...@@ -476,7 +478,7 @@ static void StorVscOnChannelCallback(void *context)
osd_waitevent_set(request->wait_event); osd_waitevent_set(request->wait_event);
} else { } else {
StorVscOnReceive(device, stor_vsc_on_receive(device,
(struct vstor_packet *)packet, (struct vstor_packet *)packet,
request); request);
} }
...@@ -486,11 +488,11 @@ static void StorVscOnChannelCallback(void *context) ...@@ -486,11 +488,11 @@ static void StorVscOnChannelCallback(void *context)
} }
} while (1); } while (1);
PutStorDevice(device); put_stor_device(device);
return; return;
} }
static int StorVscConnectToVsp(struct hv_device *Device) static int stor_vsc_connect_to_vsp(struct hv_device *Device)
{ {
struct vmstorage_channel_properties props; struct vmstorage_channel_properties props;
struct storvsc_driver_object *storDriver; struct storvsc_driver_object *storDriver;
...@@ -505,7 +507,7 @@ static int StorVscConnectToVsp(struct hv_device *Device) ...@@ -505,7 +507,7 @@ static int StorVscConnectToVsp(struct hv_device *Device)
storDriver->ring_buffer_size, storDriver->ring_buffer_size,
(void *)&props, (void *)&props,
sizeof(struct vmstorage_channel_properties), sizeof(struct vmstorage_channel_properties),
StorVscOnChannelCallback, Device); stor_vsc_on_channel_callback, Device);
DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d", DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d",
props.path_id, props.target_id, props.max_transfer_bytes); props.path_id, props.target_id, props.max_transfer_bytes);
...@@ -515,16 +517,17 @@ static int StorVscConnectToVsp(struct hv_device *Device) ...@@ -515,16 +517,17 @@ static int StorVscConnectToVsp(struct hv_device *Device)
return -1; return -1;
} }
ret = StorVscChannelInit(Device); ret = stor_vsc_channel_init(Device);
return ret; return ret;
} }
/* /*
* StorVscOnDeviceAdd - Callback when the device belonging to this driver is added * stor_vsc_on_device_add - Callback when the device belonging to this driver
* is added * is added
*/ */
static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) static int stor_vsc_on_device_add(struct hv_device *Device,
void *AdditionalInfo)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
/* struct vmstorage_channel_properties *props; */ /* struct vmstorage_channel_properties *props; */
...@@ -532,7 +535,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) ...@@ -532,7 +535,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
int ret = 0; int ret = 0;
deviceInfo = (struct storvsc_device_info *)AdditionalInfo; deviceInfo = (struct storvsc_device_info *)AdditionalInfo;
storDevice = AllocStorDevice(Device); storDevice = alloc_stor_device(Device);
if (!storDevice) { if (!storDevice) {
ret = -1; ret = -1;
goto Cleanup; goto Cleanup;
...@@ -555,7 +558,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) ...@@ -555,7 +558,7 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
storDevice->port_number = deviceInfo->port_number; storDevice->port_number = deviceInfo->port_number;
/* Send it back up */ /* Send it back up */
ret = StorVscConnectToVsp(Device); ret = stor_vsc_connect_to_vsp(Device);
/* deviceInfo->PortNumber = storDevice->PortNumber; */ /* deviceInfo->PortNumber = storDevice->PortNumber; */
deviceInfo->path_id = storDevice->path_id; deviceInfo->path_id = storDevice->path_id;
...@@ -570,16 +573,16 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo) ...@@ -570,16 +573,16 @@ static int StorVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
} }
/* /*
* StorVscOnDeviceRemove - Callback when the our device is being removed * stor_vsc_on_device_remove - Callback when the our device is being removed
*/ */
static int StorVscOnDeviceRemove(struct hv_device *Device) static int stor_vsc_on_device_remove(struct hv_device *Device)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
DPRINT_INFO(STORVSC, "disabling storage device (%p)...", DPRINT_INFO(STORVSC, "disabling storage device (%p)...",
Device->Extension); Device->Extension);
storDevice = ReleaseStorDevice(Device); storDevice = release_stor_device(Device);
/* /*
* At this point, all outbound traffic should be disable. We * At this point, all outbound traffic should be disable. We
...@@ -595,14 +598,14 @@ static int StorVscOnDeviceRemove(struct hv_device *Device) ...@@ -595,14 +598,14 @@ static int StorVscOnDeviceRemove(struct hv_device *Device)
DPRINT_INFO(STORVSC, "removing storage device (%p)...", DPRINT_INFO(STORVSC, "removing storage device (%p)...",
Device->Extension); Device->Extension);
storDevice = FinalReleaseStorDevice(Device); storDevice = final_release_stor_device(Device);
DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", storDevice); DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", storDevice);
/* Close the channel */ /* Close the channel */
vmbus_close(Device->channel); vmbus_close(Device->channel);
FreeStorDevice(storDevice); free_stor_device(storDevice);
return 0; return 0;
} }
...@@ -615,7 +618,7 @@ int stor_vsc_on_host_reset(struct hv_device *Device) ...@@ -615,7 +618,7 @@ int stor_vsc_on_host_reset(struct hv_device *Device)
DPRINT_INFO(STORVSC, "resetting host adapter..."); DPRINT_INFO(STORVSC, "resetting host adapter...");
storDevice = GetStorDevice(Device); storDevice = get_stor_device(Device);
if (!storDevice) { if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..." DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?"); "device being destroyed?");
...@@ -658,14 +661,14 @@ int stor_vsc_on_host_reset(struct hv_device *Device) ...@@ -658,14 +661,14 @@ int stor_vsc_on_host_reset(struct hv_device *Device)
*/ */
Cleanup: Cleanup:
PutStorDevice(Device); put_stor_device(Device);
return ret; return ret;
} }
/* /*
* StorVscOnIORequest - Callback to initiate an I/O request * stor_vsc_on_io_request - Callback to initiate an I/O request
*/ */
static int StorVscOnIORequest(struct hv_device *Device, static int stor_vsc_on_io_request(struct hv_device *Device,
struct hv_storvsc_request *Request) struct hv_storvsc_request *Request)
{ {
struct storvsc_device *storDevice; struct storvsc_device *storDevice;
...@@ -676,7 +679,7 @@ static int StorVscOnIORequest(struct hv_device *Device, ...@@ -676,7 +679,7 @@ static int StorVscOnIORequest(struct hv_device *Device,
requestExtension = requestExtension =
(struct storvsc_request_extension *)Request->extension; (struct storvsc_request_extension *)Request->extension;
vstorPacket = &requestExtension->vstor_packet; vstorPacket = &requestExtension->vstor_packet;
storDevice = GetStorDevice(Device); storDevice = get_stor_device(Device);
DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, " DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, "
"Extension %p", Device, storDevice, Request, "Extension %p", Device, storDevice, Request,
...@@ -751,14 +754,14 @@ static int StorVscOnIORequest(struct hv_device *Device, ...@@ -751,14 +754,14 @@ static int StorVscOnIORequest(struct hv_device *Device,
atomic_inc(&storDevice->num_outstanding_requests); atomic_inc(&storDevice->num_outstanding_requests);
PutStorDevice(Device); put_stor_device(Device);
return ret; return ret;
} }
/* /*
* StorVscOnCleanup - Perform any cleanup when the driver is removed * stor_vsc_on_cleanup - Perform any cleanup when the driver is removed
*/ */
static void StorVscOnCleanup(struct hv_driver *Driver) static void stor_vsc_on_cleanup(struct hv_driver *Driver)
{ {
} }
...@@ -806,11 +809,11 @@ int stor_vsc_initialize(struct hv_driver *Driver) ...@@ -806,11 +809,11 @@ int stor_vsc_initialize(struct hv_driver *Driver)
STORVSC_MAX_IO_REQUESTS); STORVSC_MAX_IO_REQUESTS);
/* Setup the dispatch table */ /* Setup the dispatch table */
storDriver->base.OnDeviceAdd = StorVscOnDeviceAdd; storDriver->base.OnDeviceAdd = stor_vsc_on_device_add;
storDriver->base.OnDeviceRemove = StorVscOnDeviceRemove; storDriver->base.OnDeviceRemove = stor_vsc_on_device_remove;
storDriver->base.OnCleanup = StorVscOnCleanup; storDriver->base.OnCleanup = stor_vsc_on_cleanup;
storDriver->on_io_request = StorVscOnIORequest; storDriver->on_io_request = stor_vsc_on_io_request;
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment