virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH 103/117] Staging: hv: storvsc: Add the contents of hyperv_storage.h to storvsc_drv.c
Date: Fri, 15 Jul 2011 10:47:31 -0700	[thread overview]
Message-ID: <1310752065-27895-103-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1310752065-27895-1-git-send-email-kys@microsoft.com>

As part of further cleanup of storvsc, add the contents of hyperv_storage.h
to storvsc_drv.c.


Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
 drivers/staging/hv/hyperv_storage.h |  341 -----------------------------------
 drivers/staging/hv/storvsc_drv.c    |  327 +++++++++++++++++++++++++++++++++-
 2 files changed, 326 insertions(+), 342 deletions(-)
 delete mode 100644 drivers/staging/hv/hyperv_storage.h

diff --git a/drivers/staging/hv/hyperv_storage.h b/drivers/staging/hv/hyperv_storage.h
deleted file mode 100644
index a1f3e27..0000000
--- a/drivers/staging/hv/hyperv_storage.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- *
- * Copyright (c) 2011, Microsoft Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
- * Authors:
- *   Haiyang Zhang <haiyangz@microsoft.com>
- *   Hank Janssen  <hjanssen@microsoft.com>
- *   K. Y. Srinivasan <kys@microsoft.com>
- *
- */
-
-#ifndef _HYPERV_STORAGE_H
-#define _HYPERV_STORAGE_H
-
-
-/* vstorage.w revision number.  This is used in the case of a version match, */
-/* to alert the user that structure sizes may be mismatched even though the */
-/* protocol versions match. */
-
-
-#define REVISION_STRING(REVISION_) #REVISION_
-#define FILL_VMSTOR_REVISION(RESULT_LVALUE_)				\
-	do {								\
-		char *revision_string					\
-			= REVISION_STRING($Rev : 6 $) + 6;		\
-		RESULT_LVALUE_ = 0;					\
-		while (*revision_string >= '0'				\
-			&& *revision_string <= '9') {			\
-			RESULT_LVALUE_ *= 10;				\
-			RESULT_LVALUE_ += *revision_string - '0';	\
-			revision_string++;				\
-		}							\
-	} while (0)
-
-/* Major/minor macros.  Minor version is in LSB, meaning that earlier flat */
-/* version numbers will be interpreted as "0.x" (i.e., 1 becomes 0.1). */
-#define VMSTOR_PROTOCOL_MAJOR(VERSION_)		(((VERSION_) >> 8) & 0xff)
-#define VMSTOR_PROTOCOL_MINOR(VERSION_)		(((VERSION_))      & 0xff)
-#define VMSTOR_PROTOCOL_VERSION(MAJOR_, MINOR_)	((((MAJOR_) & 0xff) << 8) | \
-						 (((MINOR_) & 0xff)))
-#define VMSTOR_INVALID_PROTOCOL_VERSION		(-1)
-
-/* Version history: */
-/* V1 Beta                    0.1 */
-/* V1 RC < 2008/1/31          1.0 */
-/* V1 RC > 2008/1/31          2.0 */
-#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(2, 0)
-
-
-
-
-/*  This will get replaced with the max transfer length that is possible on */
-/*  the host adapter. */
-/*  The max transfer length will be published when we offer a vmbus channel. */
-#define MAX_TRANSFER_LENGTH	0x40000
-#define DEFAULT_PACKET_SIZE (sizeof(struct vmdata_gpa_direct) +	\
-			sizeof(struct vstor_packet) +		\
-			sizesizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
-
-
-/*  Packet structure describing virtual storage requests. */
-enum vstor_packet_operation {
-	VSTOR_OPERATION_COMPLETE_IO		= 1,
-	VSTOR_OPERATION_REMOVE_DEVICE		= 2,
-	VSTOR_OPERATION_EXECUTE_SRB		= 3,
-	VSTOR_OPERATION_RESET_LUN		= 4,
-	VSTOR_OPERATION_RESET_ADAPTER		= 5,
-	VSTOR_OPERATION_RESET_BUS		= 6,
-	VSTOR_OPERATION_BEGIN_INITIALIZATION	= 7,
-	VSTOR_OPERATION_END_INITIALIZATION	= 8,
-	VSTOR_OPERATION_QUERY_PROTOCOL_VERSION	= 9,
-	VSTOR_OPERATION_QUERY_PROPERTIES	= 10,
-	VSTOR_OPERATION_MAXIMUM			= 10
-};
-
-/*
- * Platform neutral description of a scsi request -
- * this remains the same across the write regardless of 32/64 bit
- * note: it's patterned off the SCSI_PASS_THROUGH structure
- */
-#define CDB16GENERIC_LENGTH			0x10
-
-#ifndef SENSE_BUFFER_SIZE
-#define SENSE_BUFFER_SIZE			0x12
-#endif
-
-#define MAX_DATA_BUF_LEN_WITH_PADDING		0x14
-
-struct vmscsi_request {
-	unsigned short length;
-	unsigned char srb_status;
-	unsigned char scsi_status;
-
-	unsigned char port_number;
-	unsigned char path_id;
-	unsigned char target_id;
-	unsigned char lun;
-
-	unsigned char cdb_length;
-	unsigned char sense_info_length;
-	unsigned char data_in;
-	unsigned char reserved;
-
-	unsigned int data_transfer_length;
-
-	union {
-		unsigned char cdb[CDB16GENERIC_LENGTH];
-		unsigned char sense_data[SENSE_BUFFER_SIZE];
-		unsigned char reserved_array[MAX_DATA_BUF_LEN_WITH_PADDING];
-	};
-} __attribute((packed));
-
-
-/*
- * This structure is sent during the intialization phase to get the different
- * properties of the channel.
- */
-struct vmstorage_channel_properties {
-	unsigned short protocol_version;
-	unsigned char path_id;
-	unsigned char target_id;
-
-	/* Note: port number is only really known on the client side */
-	unsigned int port_number;
-	unsigned int flags;
-	unsigned int max_transfer_bytes;
-
-	/*  This id is unique for each channel and will correspond with */
-	/*  vendor specific data in the inquirydata */
-	unsigned long long unique_id;
-} __packed;
-
-/*  This structure is sent during the storage protocol negotiations. */
-struct vmstorage_protocol_version {
-	/* Major (MSW) and minor (LSW) version numbers. */
-	unsigned short major_minor;
-
-	/*
-	 * Revision number is auto-incremented whenever this file is changed
-	 * (See FILL_VMSTOR_REVISION macro above).  Mismatch does not
-	 * definitely indicate incompatibility--but it does indicate mismatched
-	 * builds.
-	 */
-	unsigned short revision;
-} __packed;
-
-/* Channel Property Flags */
-#define STORAGE_CHANNEL_REMOVABLE_FLAG		0x1
-#define STORAGE_CHANNEL_EMULATED_IDE_FLAG	0x2
-
-struct vstor_packet {
-	/* Requested operation type */
-	enum vstor_packet_operation operation;
-
-	/*  Flags - see below for values */
-	unsigned int flags;
-
-	/* Status of the request returned from the server side. */
-	unsigned int status;
-
-	/* Data payload area */
-	union {
-		/*
-		 * Structure used to forward SCSI commands from the
-		 * client to the server.
-		 */
-		struct vmscsi_request vm_srb;
-
-		/* Structure used to query channel properties. */
-		struct vmstorage_channel_properties storage_channel_properties;
-
-		/* Used during version negotiations. */
-		struct vmstorage_protocol_version version;
-	};
-} __packed;
-
-/* Packet flags */
-/*
- * This flag indicates that the server should send back a completion for this
- * packet.
- */
-#define REQUEST_COMPLETION_FLAG	0x1
-
-/*  This is the set of flags that the vsc can set in any packets it sends */
-#define VSC_LEGAL_FLAGS		(REQUEST_COMPLETION_FLAG)
-
-
-#include <linux/kernel.h>
-#include <linux/wait.h>
-#include "hyperv_storage.h"
-#include "hyperv.h"
-
-/* Defines */
-#define STORVSC_RING_BUFFER_SIZE			(20*PAGE_SIZE)
-#define BLKVSC_RING_BUFFER_SIZE				(20*PAGE_SIZE)
-
-#define STORVSC_MAX_IO_REQUESTS				128
-
-/*
- * In Hyper-V, each port/path/target maps to 1 scsi host adapter.  In
- * reality, the path/target is not used (ie always set to 0) so our
- * scsi host adapter essentially has 1 bus with 1 target that contains
- * up to 256 luns.
- */
-#define STORVSC_MAX_LUNS_PER_TARGET			64
-#define STORVSC_MAX_TARGETS				1
-#define STORVSC_MAX_CHANNELS				1
-
-struct hv_storvsc_request;
-
-/* Matches Windows-end */
-enum storvsc_request_type {
-	WRITE_TYPE,
-	READ_TYPE,
-	UNKNOWN_TYPE,
-};
-
-
-struct hv_storvsc_request {
-	struct hv_storvsc_request *request;
-	struct hv_device *device;
-
-	/* Synchronize the request/response if needed */
-	struct completion wait_event;
-
-	unsigned char *sense_buffer;
-	void *context;
-	void (*on_io_completion)(struct hv_storvsc_request *request);
-	struct hv_multipage_buffer data_buffer;
-
-	struct vstor_packet vstor_packet;
-};
-
-
-struct storvsc_device_info {
-	u32 ring_buffer_size;
-	unsigned int port_number;
-	unsigned char path_id;
-	unsigned char target_id;
-};
-
-struct storvsc_major_info {
-	int major;
-	int index;
-	bool do_register;
-	char *devname;
-	char *diskname;
-};
-
-/* A storvsc device is a device object that contains a vmbus channel */
-struct storvsc_device {
-	struct hv_device *device;
-
-	/* 0 indicates the device is being destroyed */
-	int	 ref_count;
-	bool	 destroy;
-	bool	 drain_notify;
-	atomic_t num_outstanding_req;
-
-	wait_queue_head_t waiting_to_drain;
-
-	/*
-	 * Each unique Port/Path/Target represents 1 channel ie scsi
-	 * controller. In reality, the pathid, targetid is always 0
-	 * and the port is set by us
-	 */
-	unsigned int port_number;
-	unsigned char path_id;
-	unsigned char target_id;
-
-	/* Used for vsc/vsp channel reset process */
-	struct hv_storvsc_request init_request;
-	struct hv_storvsc_request reset_request;
-};
-
-
-static inline struct storvsc_device *get_out_stor_device(
-					struct hv_device *device)
-{
-	struct storvsc_device *stor_device;
-	unsigned long flags;
-
-	spin_lock_irqsave(&device->ext_lock, flags);
-	stor_device = (struct storvsc_device *)device->ext;
-	if (stor_device && (stor_device->ref_count) &&
-		!stor_device->destroy)
-		stor_device->ref_count++;
-	else
-		stor_device = NULL;
-	spin_unlock_irqrestore(&device->ext_lock, flags);
-
-	return stor_device;
-}
-
-
-static inline void put_stor_device(struct hv_device *device)
-{
-	struct storvsc_device *stor_device;
-	unsigned long flags;
-
-	spin_lock_irqsave(&device->ext_lock, flags);
-	stor_device = (struct storvsc_device *)device->ext;
-
-	stor_device->ref_count--;
-	spin_unlock_irqrestore(&device->ext_lock, flags);
-}
-
-static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
-{
-	dev->drain_notify = true;
-	wait_event(dev->waiting_to_drain,
-		   atomic_read(&dev->num_outstanding_req) == 0);
-	dev->drain_notify = false;
-}
-
-/* Interface */
-
-int storvsc_dev_add(struct hv_device *device,
-				void *additional_info);
-int storvsc_dev_remove(struct hv_device *device);
-
-int storvsc_do_io(struct hv_device *device,
-				struct hv_storvsc_request *request);
-
-int storvsc_get_major_info(struct storvsc_device_info *device_info,
-				struct storvsc_major_info *major_info);
-
-#endif /* _HYPERV_STORAGE_H */
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 5c06f5d..463b428 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -40,7 +40,332 @@
 #include <scsi/scsi_dbg.h>
 
 #include "hyperv.h"
-#include "hyperv_storage.h"
+
+
+/*
+ *
+ * Copyright (c) 2011, Microsoft Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Authors:
+ *   Haiyang Zhang <haiyangz@microsoft.com>
+ *   Hank Janssen  <hjanssen@microsoft.com>
+ *   K. Y. Srinivasan <kys@microsoft.com>
+ *
+ */
+
+
+
+/* vstorage.w revision number.  This is used in the case of a version match, */
+/* to alert the user that structure sizes may be mismatched even though the */
+/* protocol versions match. */
+
+
+#define REVISION_STRING(REVISION_) #REVISION_
+#define FILL_VMSTOR_REVISION(RESULT_LVALUE_)				\
+	do {								\
+		char *revision_string					\
+			= REVISION_STRING($Rev : 6 $) + 6;		\
+		RESULT_LVALUE_ = 0;					\
+		while (*revision_string >= '0'				\
+			&& *revision_string <= '9') {			\
+			RESULT_LVALUE_ *= 10;				\
+			RESULT_LVALUE_ += *revision_string - '0';	\
+			revision_string++;				\
+		}							\
+	} while (0)
+
+/* Major/minor macros.  Minor version is in LSB, meaning that earlier flat */
+/* version numbers will be interpreted as "0.x" (i.e., 1 becomes 0.1). */
+#define VMSTOR_PROTOCOL_MAJOR(VERSION_)		(((VERSION_) >> 8) & 0xff)
+#define VMSTOR_PROTOCOL_MINOR(VERSION_)		(((VERSION_))      & 0xff)
+#define VMSTOR_PROTOCOL_VERSION(MAJOR_, MINOR_)	((((MAJOR_) & 0xff) << 8) | \
+						 (((MINOR_) & 0xff)))
+#define VMSTOR_INVALID_PROTOCOL_VERSION		(-1)
+
+/* Version history: */
+/* V1 Beta                    0.1 */
+/* V1 RC < 2008/1/31          1.0 */
+/* V1 RC > 2008/1/31          2.0 */
+#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(2, 0)
+
+
+
+
+/*  This will get replaced with the max transfer length that is possible on */
+/*  the host adapter. */
+/*  The max transfer length will be published when we offer a vmbus channel. */
+#define MAX_TRANSFER_LENGTH	0x40000
+#define DEFAULT_PACKET_SIZE (sizeof(struct vmdata_gpa_direct) +	\
+			sizeof(struct vstor_packet) +		\
+			sizesizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
+
+
+/*  Packet structure describing virtual storage requests. */
+enum vstor_packet_operation {
+	VSTOR_OPERATION_COMPLETE_IO		= 1,
+	VSTOR_OPERATION_REMOVE_DEVICE		= 2,
+	VSTOR_OPERATION_EXECUTE_SRB		= 3,
+	VSTOR_OPERATION_RESET_LUN		= 4,
+	VSTOR_OPERATION_RESET_ADAPTER		= 5,
+	VSTOR_OPERATION_RESET_BUS		= 6,
+	VSTOR_OPERATION_BEGIN_INITIALIZATION	= 7,
+	VSTOR_OPERATION_END_INITIALIZATION	= 8,
+	VSTOR_OPERATION_QUERY_PROTOCOL_VERSION	= 9,
+	VSTOR_OPERATION_QUERY_PROPERTIES	= 10,
+	VSTOR_OPERATION_MAXIMUM			= 10
+};
+
+/*
+ * Platform neutral description of a scsi request -
+ * this remains the same across the write regardless of 32/64 bit
+ * note: it's patterned off the SCSI_PASS_THROUGH structure
+ */
+#define CDB16GENERIC_LENGTH			0x10
+
+#ifndef SENSE_BUFFER_SIZE
+#define SENSE_BUFFER_SIZE			0x12
+#endif
+
+#define MAX_DATA_BUF_LEN_WITH_PADDING		0x14
+
+struct vmscsi_request {
+	unsigned short length;
+	unsigned char srb_status;
+	unsigned char scsi_status;
+
+	unsigned char port_number;
+	unsigned char path_id;
+	unsigned char target_id;
+	unsigned char lun;
+
+	unsigned char cdb_length;
+	unsigned char sense_info_length;
+	unsigned char data_in;
+	unsigned char reserved;
+
+	unsigned int data_transfer_length;
+
+	union {
+		unsigned char cdb[CDB16GENERIC_LENGTH];
+		unsigned char sense_data[SENSE_BUFFER_SIZE];
+		unsigned char reserved_array[MAX_DATA_BUF_LEN_WITH_PADDING];
+	};
+} __attribute((packed));
+
+
+/*
+ * This structure is sent during the intialization phase to get the different
+ * properties of the channel.
+ */
+struct vmstorage_channel_properties {
+	unsigned short protocol_version;
+	unsigned char path_id;
+	unsigned char target_id;
+
+	/* Note: port number is only really known on the client side */
+	unsigned int port_number;
+	unsigned int flags;
+	unsigned int max_transfer_bytes;
+
+	/*  This id is unique for each channel and will correspond with */
+	/*  vendor specific data in the inquirydata */
+	unsigned long long unique_id;
+} __packed;
+
+/*  This structure is sent during the storage protocol negotiations. */
+struct vmstorage_protocol_version {
+	/* Major (MSW) and minor (LSW) version numbers. */
+	unsigned short major_minor;
+
+	/*
+	 * Revision number is auto-incremented whenever this file is changed
+	 * (See FILL_VMSTOR_REVISION macro above).  Mismatch does not
+	 * definitely indicate incompatibility--but it does indicate mismatched
+	 * builds.
+	 */
+	unsigned short revision;
+} __packed;
+
+/* Channel Property Flags */
+#define STORAGE_CHANNEL_REMOVABLE_FLAG		0x1
+#define STORAGE_CHANNEL_EMULATED_IDE_FLAG	0x2
+
+struct vstor_packet {
+	/* Requested operation type */
+	enum vstor_packet_operation operation;
+
+	/*  Flags - see below for values */
+	unsigned int flags;
+
+	/* Status of the request returned from the server side. */
+	unsigned int status;
+
+	/* Data payload area */
+	union {
+		/*
+		 * Structure used to forward SCSI commands from the
+		 * client to the server.
+		 */
+		struct vmscsi_request vm_srb;
+
+		/* Structure used to query channel properties. */
+		struct vmstorage_channel_properties storage_channel_properties;
+
+		/* Used during version negotiations. */
+		struct vmstorage_protocol_version version;
+	};
+} __packed;
+
+/* Packet flags */
+/*
+ * This flag indicates that the server should send back a completion for this
+ * packet.
+ */
+#define REQUEST_COMPLETION_FLAG	0x1
+
+/*  This is the set of flags that the vsc can set in any packets it sends */
+#define VSC_LEGAL_FLAGS		(REQUEST_COMPLETION_FLAG)
+
+
+#include <linux/kernel.h>
+#include <linux/wait.h>
+#include "hyperv.h"
+
+/* Defines */
+#define STORVSC_RING_BUFFER_SIZE			(20*PAGE_SIZE)
+#define BLKVSC_RING_BUFFER_SIZE				(20*PAGE_SIZE)
+
+#define STORVSC_MAX_IO_REQUESTS				128
+
+/*
+ * In Hyper-V, each port/path/target maps to 1 scsi host adapter.  In
+ * reality, the path/target is not used (ie always set to 0) so our
+ * scsi host adapter essentially has 1 bus with 1 target that contains
+ * up to 256 luns.
+ */
+#define STORVSC_MAX_LUNS_PER_TARGET			64
+#define STORVSC_MAX_TARGETS				1
+#define STORVSC_MAX_CHANNELS				1
+
+struct hv_storvsc_request;
+
+/* Matches Windows-end */
+enum storvsc_request_type {
+	WRITE_TYPE,
+	READ_TYPE,
+	UNKNOWN_TYPE,
+};
+
+
+struct hv_storvsc_request {
+	struct hv_storvsc_request *request;
+	struct hv_device *device;
+
+	/* Synchronize the request/response if needed */
+	struct completion wait_event;
+
+	unsigned char *sense_buffer;
+	void *context;
+	void (*on_io_completion)(struct hv_storvsc_request *request);
+	struct hv_multipage_buffer data_buffer;
+
+	struct vstor_packet vstor_packet;
+};
+
+
+struct storvsc_device_info {
+	u32 ring_buffer_size;
+	unsigned int port_number;
+	unsigned char path_id;
+	unsigned char target_id;
+};
+
+struct storvsc_major_info {
+	int major;
+	int index;
+	bool do_register;
+	char *devname;
+	char *diskname;
+};
+
+/* A storvsc device is a device object that contains a vmbus channel */
+struct storvsc_device {
+	struct hv_device *device;
+
+	/* 0 indicates the device is being destroyed */
+	int	 ref_count;
+	bool	 destroy;
+	bool	 drain_notify;
+	atomic_t num_outstanding_req;
+
+	wait_queue_head_t waiting_to_drain;
+
+	/*
+	 * Each unique Port/Path/Target represents 1 channel ie scsi
+	 * controller. In reality, the pathid, targetid is always 0
+	 * and the port is set by us
+	 */
+	unsigned int port_number;
+	unsigned char path_id;
+	unsigned char target_id;
+
+	/* Used for vsc/vsp channel reset process */
+	struct hv_storvsc_request init_request;
+	struct hv_storvsc_request reset_request;
+};
+
+
+static inline struct storvsc_device *get_out_stor_device(
+					struct hv_device *device)
+{
+	struct storvsc_device *stor_device;
+	unsigned long flags;
+
+	spin_lock_irqsave(&device->ext_lock, flags);
+	stor_device = (struct storvsc_device *)device->ext;
+	if (stor_device && (stor_device->ref_count) &&
+		!stor_device->destroy)
+		stor_device->ref_count++;
+	else
+		stor_device = NULL;
+	spin_unlock_irqrestore(&device->ext_lock, flags);
+
+	return stor_device;
+}
+
+
+static inline void put_stor_device(struct hv_device *device)
+{
+	struct storvsc_device *stor_device;
+	unsigned long flags;
+
+	spin_lock_irqsave(&device->ext_lock, flags);
+	stor_device = (struct storvsc_device *)device->ext;
+
+	stor_device->ref_count--;
+	spin_unlock_irqrestore(&device->ext_lock, flags);
+}
+
+static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
+{
+	dev->drain_notify = true;
+	wait_event(dev->waiting_to_drain,
+		   atomic_read(&dev->num_outstanding_req) == 0);
+	dev->drain_notify = false;
+}
 
 
 static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
-- 
1.7.4.1

  parent reply	other threads:[~2011-07-15 17:47 UTC|newest]

Thread overview: 175+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 17:47 [PATCH 0000/0117] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-07-15 17:45 ` [PATCH 001/117] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 002/117] Staging: hv: Replace struct hv_guid with the uuid type already defined in Linux K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 003/117] Staging: hv: Add struct hv_vmbus_device_id to mod_devicetable.h K. Y. Srinivasan
2011-08-23 22:41     ` Greg KH
2011-08-24  0:44       ` KY Srinivasan
2011-08-24  2:59         ` Greg KH
2011-08-24 16:46           ` KY Srinivasan
2011-08-24 20:11             ` Greg KH
2011-08-24 21:51               ` KY Srinivasan
2011-08-25  2:27                 ` KY Srinivasan
2011-08-25  2:40                   ` Greg KH
2011-08-25 14:14                     ` KY Srinivasan
2011-08-25  2:38                 ` Greg KH
2011-07-15 17:45   ` [PATCH 004/117] Staging: hv: Add code to parse struct hv_vmbus_device_id table K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 005/117] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 006/117] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
2011-08-23 22:45     ` Greg KH
2011-07-15 17:45   ` [PATCH 007/117] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 008/117] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 009/117] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 010/117] Staging: hv: util: Make hv_utils a vmbus device driver K. Y. Srinivasan
2011-07-15 17:45   ` [PATCH 011/117] Staging: hv: util: Use the newly introduced vmbus ID in util driver K. Y. Srinivasan
2011-08-23 22:46     ` Greg KH
2011-07-15 17:46   ` [PATCH 012/117] Staging: hv: blkvsc: Add the MODULE_DEVICE_TABLE() line K. Y. Srinivasan
2011-08-23 22:46     ` Greg KH
2011-07-15 17:46   ` [PATCH 013/117] Staging: hv: storvsc: Add " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 014/117] Staging: hv: netvsc: Add the " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 015/117] Staging: hv: util: " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 016/117] Staging: hv: mouse: " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 017/117] Staging: hv: mouse: Do not auto-load the mouse driver K. Y. Srinivasan
2011-08-23 22:47     ` Greg KH
2011-07-15 17:46   ` [PATCH 018/117] Staging: hv: vmbus: Cleanup vmbus_match() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 019/117] Staging: hv: vmbus: Cleanup vmbus_uevent() code K. Y. Srinivasan
2011-08-23 22:49     ` Greg KH
2011-08-24  0:38       ` KY Srinivasan
2011-08-24  3:00         ` Greg KH
2011-08-24 14:12           ` KY Srinivasan
2011-07-15 17:46   ` [PATCH 020/117] Staging: hv: vmbus: Support the notion of id tables in vmbus_match() K. Y. Srinivasan
2011-07-16  2:02     ` Christoph Hellwig
2011-07-16 12:54       ` KY Srinivasan
2011-07-16 18:24         ` Christoph Hellwig
2011-08-23 22:51     ` Greg KH
2011-07-15 17:46   ` [PATCH 021/117] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 022/117] Staging: hv: storvsc: Get rid of the DMI signature K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 023/117] Staging: hv: netvsc: Get rid of the PCI signature K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 024/117] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 025/117] Staging: hv: util: Get rid of the DMI signature in hv_util.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 026/117] Staging: hv: util: Get rid of the PCI " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 027/117] Staging: hv: blkvsc: Get rid of the dev_type guid from blkvsc_drv.c K. Y. Srinivasan
2011-08-23 22:52     ` Greg KH
2011-07-15 17:46   ` [PATCH 028/117] Staging: hv: storvsc: Get rid of the device type guid from storvsc_drv.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 029/117] Staging: hv: netvsc: Get rid of the dev_type guid from netvsc.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 030/117] Staging: hv: netvsc: Initialize the driver name directly K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 031/117] Staging: hv: netvsc: Get rid of the driver name initialization in netvsc.c K. Y. Srinivasan
2011-08-23 22:56     ` Greg KH
2011-07-15 17:46   ` [PATCH 032/117] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 033/117] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 034/117] Staging: hv: mouse: Get rid of the dev_type guid in hv_mouse.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 035/117] Staging: hv: vmbus: Introduce a function to map the dev_type guid to a name K. Y. Srinivasan
2011-08-23 23:01     ` Greg KH
2011-07-15 17:46   ` [PATCH 036/117] Staging: hv: vmbus: Make class_id attribute a human readable string K. Y. Srinivasan
2011-08-23 23:02     ` Greg KH
2011-07-15 17:46   ` [PATCH 037/117] Staging: hv: vmbus: Get rid of the device_id attribute K. Y. Srinivasan
2011-08-23 23:03     ` Greg KH
2011-07-15 17:46   ` [PATCH 038/117] Staging: hv: vmbus: Get rid of some unnecessary comments K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 039/117] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 040/117] Staging: hv: vmbus: Cleanup error handling in hv_init() K. Y. Srinivasan
2011-08-23 23:04     ` Greg KH
2011-07-15 17:46   ` [PATCH 041/117] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 042/117] Staging: hv: vmbus: Get rid of the function dump_gpadl_body() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 043/117] Staging: hv: vmbus: Get rid of the function dump_gpadl_header() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 044/117] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 045/117] Staging: hv: vmbus: Get rid of unnecessary comments " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 046/117] Staging: hv: vmbus: Change the variable name openInfo to open_info " K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 047/117] Staging: hv: vmbus: Cleanup error values in ringbuffer.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 048/117] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 049/117] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 050/117] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 051/117] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 052/117] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 053/117] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 054/117] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 055/117] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 056/117] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 057/117] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 058/117] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 059/117] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 060/117] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 061/117] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 062/117] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 063/117] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 064/117] Staging: hv: netvsc: Cleanup error return values in netvsc_send() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 065/117] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 066/117] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 067/117] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 068/117] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 069/117] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 070/117] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add() K. Y. Srinivasan
2011-07-15 17:46   ` [PATCH 071/117] Staging: hv: mouse: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 072/117] Staging: hv: mouse: Get rid of the unused PCI signature K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 073/117] Staging: hv: netvsc: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 074/117] Staging: hv: netvsc: Change the jump label Exit to exit K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 075/117] Staging: hv: storvsc: Inline free_stor_device() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 076/117] Staging: hv: storvsc: Do not aquire an unnecessary reference on stor_device K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 077/117] Staging: hv: storvsc: Rename must_get_stor_device() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 078/117] Staging: hv: storvsc: Rename get_stor_device() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 079/117] Staging: hv: storvsc: Cleanup alloc_stor_device() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 080/117] Staging: hv: storvsc: Introduce state to manage the lifecycle of stor device K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 081/117] Staging: hv: vmbus: Introduce a lock to protect the ext field in hv_device K. Y. Srinivasan
2011-08-23 23:08     ` Greg KH
2011-08-24  0:55       ` KY Srinivasan
2011-08-24  2:58         ` Greg KH
2011-08-24 14:29           ` KY Srinivasan
2011-07-15 17:47   ` [PATCH 082/117] Staging: hv: storvsc: Use the newly introduced lock in accessing ext field K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 083/117] Staging: hv: storvsc: Prevent outgoing traffic when stor dev is destroyed K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 084/117] Staging: hv: storvsc: Get rid of release_stor_device() by inlining the code K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 085/117] Staging: hv: storvsc: Get rid of final_release_stor_device() by inlining code K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 086/117] Staging: hv: storvsc: Leverage the spinlock to manage ref_cnt K. Y. Srinivasan
2011-08-23 23:10     ` Greg KH
2011-08-24  0:58       ` KY Srinivasan
2011-08-24  2:57         ` Greg KH
2011-08-24 16:25           ` KY Srinivasan
2011-08-24 20:17             ` Greg KH
2011-08-24 22:57               ` KY Srinivasan
2011-08-25  2:45                 ` Greg KH
2011-07-15 17:47   ` [PATCH 087/117] Staging: hv: storvsc: Further cleanup reference counting of stor_device K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 088/117] Staging: hv: netvsc: Inline the code for free_net_device() K. Y. Srinivasan
2011-07-16 10:33     ` Dan Carpenter
2011-07-16 13:09       ` KY Srinivasan
2011-07-15 17:47   ` [PATCH 089/117] Staging: hv: netvsc: Cleanup alloc_net_device() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 090/117] Staging: hv: netvsc: Introduce state to manage the lifecycle of net device K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 091/117] Staging: hv: netvsc: Use the newly introduced lock in accessing ext field K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 092/117] Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 093/117] Staging: hv: netvsc: Get rid of release_outbound_net_device() by inlining the code K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 094/117] Staging: hv: netvsc: Get rid of release_inbound_net_device() " K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 095/117] Staging: hv: netvsc: Leverage the spinlock to manage refcnt K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 096/117] Staging: hv: netvsc: Further cleanup reference counting of netvsc_device K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 097/117] Staging: hv: storvsc: Add code to handle IDE devices using the storvsc driver K. Y. Srinivasan
2011-07-16  2:04     ` Christoph Hellwig
2011-07-16 12:57       ` KY Srinivasan
2011-07-16 13:01         ` Sasha Levin
2011-07-16 13:12           ` KY Srinivasan
2011-07-16 18:27           ` Christoph Hellwig
2011-07-15 17:47   ` [PATCH 098/117] Staging: hv: storvsc: Handle " K. Y. Srinivasan
2011-07-16  2:05     ` Christoph Hellwig
2011-07-15 17:47   ` [PATCH 099/117] Staging: hv: storvsc: Optimize bounce buffer handling for the "write" case K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 100/117] Staging: hv: storvsc: Optimize the bounce buffer handling in the "read" case K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 101/117] Staging: hv: storvsc: Include storvsc.c in storvsc_drv.c K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 102/117] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c K. Y. Srinivasan
2011-07-15 17:47   ` K. Y. Srinivasan [this message]
2011-07-15 17:47   ` [PATCH 104/117] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 105/117] Staging: hv: storvsc: Make some non static functions, static functions K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 106/117] Staging: hv: storvsc: Fixup srb and scsi status for INQUIRY and MODE_SENSE K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 107/117] Staging: hv: storvsc: Fix a typo K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 108/117] Staging: hv: storvsc: In case of scsi errors offline the device K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 109/117] Staging: hv: storvsc: No need to copy from bounce buffer in case of a failure K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 110/117] Staging: hv: vmbus: Change the signature of vmbus_child_driver_register() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 111/117] Staging: hv: vmbus: Change the signature of vmbus_child_driver_unregister() K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 112/117] Staging: hv: util: Forcefully shutdown when shutdown is requested K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 113/117] Staging: hv: util: Adjust guest time in a process context K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 114/117] Staging: hv: vmbus: Check before invoking the channel callback K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 115/117] Staging: hv: vmbus: Properly deal with de-registering " K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 116/117] Staging: hv: vmbus: Add code to display modalias attribute K. Y. Srinivasan
2011-07-15 17:47   ` [PATCH 117/117] Staging: hv: blkvsc: Get rid of blkvsc_drv.c as this code is not used K. Y. Srinivasan
2011-07-15 18:25 ` Large Patch Series in Email (was Re: [PATCH 0000/0117] Staging: hv: Driver cleanup) Michael Witten
2011-07-15 18:50   ` KY Srinivasan
2011-07-15 21:09   ` Dan Carpenter
2011-07-15 22:55     ` Michael Witten
2011-07-15 23:22       ` Large Patch Series in Email David Miller
2011-07-15 23:07   ` Large Patch Series in Email (was Re: [PATCH 0000/0117] Staging: hv: Driver cleanup) Alan Cox
2011-07-17 10:47     ` Florian Mickler
2011-08-23 23:11 ` [PATCH 0000/0117] Staging: hv: Driver cleanup Greg KH
2011-08-24  1:01   ` KY Srinivasan
2011-08-24  3:08     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310752065-27895-103-git-send-email-kys@microsoft.com \
    --to=kys@microsoft.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=haiyangz@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).