};
-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;
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); */
kfree(Device);
}
/* 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;
}
/* 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;
return storDevice;
}
-static inline void PutStorDevice(struct hv_device *Device)
+static inline void put_stor_device(struct hv_device *Device)
{
struct storvsc_device *storDevice;
/* ASSERT(atomic_read(&storDevice->ref_count)); */
}
-/* Drop ref count to 1 to effectively disable GetStorDevice() */
-static inline struct storvsc_device *ReleaseStorDevice(struct hv_device *Device)
+/* Drop ref count to 1 to effectively disable get_stor_device() */
+static inline struct storvsc_device *release_stor_device(
+ struct hv_device *Device)
{
struct storvsc_device *storDevice;
}
/* 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 storvsc_device *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_request_extension *request;
struct vstor_packet *vstorPacket;
int ret;
- storDevice = GetStorDevice(Device);
+ storDevice = get_stor_device(Device);
if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
kfree(request->wait_event);
request->wait_event = NULL;
nomem:
- PutStorDevice(Device);
+ put_stor_device(Device);
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 storvsc_request_extension *RequestExt)
{
struct hv_storvsc_request *request;
struct storvsc_device *storDevice;
- storDevice = MustGetStorDevice(Device);
+ storDevice = must_get_stor_device(Device);
if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
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 storvsc_request_extension *RequestExt)
{
switch (VStorPacket->operation) {
case VSTOR_OPERATION_COMPLETE_IO:
DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION");
- StorVscOnIOCompletion(Device, VStorPacket, RequestExt);
+ stor_vsc_on_io_completion(Device, VStorPacket, RequestExt);
break;
case VSTOR_OPERATION_REMOVE_DEVICE:
DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
}
}
-static void StorVscOnChannelCallback(void *context)
+static void stor_vsc_on_channel_callback(void *context)
{
struct hv_device *device = (struct hv_device *)context;
struct storvsc_device *storDevice;
/* ASSERT(device); */
- storDevice = MustGetStorDevice(device);
+ storDevice = must_get_stor_device(device);
if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
osd_waitevent_set(request->wait_event);
} else {
- StorVscOnReceive(device,
+ stor_vsc_on_receive(device,
(struct vstor_packet *)packet,
request);
}
}
} while (1);
- PutStorDevice(device);
+ put_stor_device(device);
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 storvsc_driver_object *storDriver;
storDriver->ring_buffer_size,
(void *)&props,
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",
props.path_id, props.target_id, props.max_transfer_bytes);
return -1;
}
- ret = StorVscChannelInit(Device);
+ ret = stor_vsc_channel_init(Device);
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
*/
-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 vmstorage_channel_properties *props; */
int ret = 0;
deviceInfo = (struct storvsc_device_info *)AdditionalInfo;
- storDevice = AllocStorDevice(Device);
+ storDevice = alloc_stor_device(Device);
if (!storDevice) {
ret = -1;
goto Cleanup;
storDevice->port_number = deviceInfo->port_number;
/* Send it back up */
- ret = StorVscConnectToVsp(Device);
+ ret = stor_vsc_connect_to_vsp(Device);
/* deviceInfo->PortNumber = storDevice->PortNumber; */
deviceInfo->path_id = storDevice->path_id;
}
/*
- * 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;
DPRINT_INFO(STORVSC, "disabling storage device (%p)...",
Device->Extension);
- storDevice = ReleaseStorDevice(Device);
+ storDevice = release_stor_device(Device);
/*
* At this point, all outbound traffic should be disable. We
DPRINT_INFO(STORVSC, "removing storage device (%p)...",
Device->Extension);
- storDevice = FinalReleaseStorDevice(Device);
+ storDevice = final_release_stor_device(Device);
DPRINT_INFO(STORVSC, "storage device (%p) safe to remove", storDevice);
/* Close the channel */
vmbus_close(Device->channel);
- FreeStorDevice(storDevice);
+ free_stor_device(storDevice);
return 0;
}
DPRINT_INFO(STORVSC, "resetting host adapter...");
- storDevice = GetStorDevice(Device);
+ storDevice = get_stor_device(Device);
if (!storDevice) {
DPRINT_ERR(STORVSC, "unable to get stor device..."
"device being destroyed?");
*/
Cleanup:
- PutStorDevice(Device);
+ put_stor_device(Device);
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 storvsc_device *storDevice;
requestExtension =
(struct storvsc_request_extension *)Request->extension;
vstorPacket = &requestExtension->vstor_packet;
- storDevice = GetStorDevice(Device);
+ storDevice = get_stor_device(Device);
DPRINT_DBG(STORVSC, "enter - Device %p, DeviceExt %p, Request %p, "
"Extension %p", Device, storDevice, Request,
atomic_inc(&storDevice->num_outstanding_requests);
- PutStorDevice(Device);
+ put_stor_device(Device);
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)
{
}
STORVSC_MAX_IO_REQUESTS);
/* Setup the dispatch table */
- storDriver->base.OnDeviceAdd = StorVscOnDeviceAdd;
- storDriver->base.OnDeviceRemove = StorVscOnDeviceRemove;
- storDriver->base.OnCleanup = StorVscOnCleanup;
+ storDriver->base.OnDeviceAdd = stor_vsc_on_device_add;
+ storDriver->base.OnDeviceRemove = stor_vsc_on_device_remove;
+ storDriver->base.OnCleanup = stor_vsc_on_cleanup;
- storDriver->on_io_request = StorVscOnIORequest;
+ storDriver->on_io_request = stor_vsc_on_io_request;
return 0;
}