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>,
Abhishek Kane <v-abkane@microsoft.com>
Subject: [PATCH 33/40] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c
Date: Wed, 29 Jun 2011 07:39:30 -0700 [thread overview]
Message-ID: <1309358377-8537-33-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1309358377-8537-1-git-send-email-kys@microsoft.com>
Now, cleanup storvsc_drv.c after adding the contents of storvsc.c
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 105 +++-----------------------------------
1 files changed, 7 insertions(+), 98 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index f460741..0702dc0 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -19,8 +19,15 @@
* Hank Janssen <hjanssen@microsoft.com>
* K. Y. Srinivasan <kys@microsoft.com>
*/
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/completion.h>
+#include <linux/string.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/mm.h>
+#include <linux/delay.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/blkdev.h>
@@ -41,39 +48,6 @@ static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
module_param(storvsc_ringbuffer_size, int, S_IRUGO);
MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
-/*
- * Copyright (c) 2009, 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>
- *
- */
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/completion.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-
-#include "hyperv.h"
-#include "hyperv_storage.h"
-
static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
{
@@ -504,71 +478,6 @@ int storvsc_do_io(struct hv_device *device,
return ret;
}
-/*
- * The channel properties uniquely specify how the device is to be
- * presented to the guest. Map this information for use by the block
- * driver. For Linux guests on Hyper-V, we emulate a scsi HBA in the guest
- * (storvsc_drv) and so scsi devices in the guest are handled by
- * native upper level Linux drivers. Consequently, Hyper-V
- * block driver, while being a generic block driver, presently does not
- * deal with anything other than devices that would need to be presented
- * to the guest as an IDE disk.
- *
- * This function maps the channel properties as embedded in the input
- * parameter device_info onto information necessary to register the
- * corresponding block device.
- *
- * Currently, there is no way to stop the emulation of the block device
- * on the host side. And so, to prevent the native IDE drivers in Linux
- * from taking over these devices (to be managedby Hyper-V block
- * driver), we will take over if need be the major of the IDE controllers.
- *
- */
-
-int storvsc_get_major_info(struct storvsc_device_info *device_info,
- struct storvsc_major_info *major_info)
-{
- static bool ide0_registered;
- static bool ide1_registered;
-
- /*
- * For now we only support IDE disks.
- */
- major_info->devname = "ide";
- major_info->diskname = "hd";
-
- if (device_info->path_id) {
- major_info->major = 22;
- if (!ide1_registered) {
- major_info->do_register = true;
- ide1_registered = true;
- } else
- major_info->do_register = false;
-
- if (device_info->target_id)
- major_info->index = 3;
- else
- major_info->index = 2;
-
- return 0;
- } else {
- major_info->major = 3;
- if (!ide0_registered) {
- major_info->do_register = true;
- ide0_registered = true;
- } else
- major_info->do_register = false;
-
- if (device_info->target_id)
- major_info->index = 1;
- else
- major_info->index = 0;
-
- return 0;
- }
-
- return -ENODEV;
-}
static const char *driver_name = "storvsc";
struct hv_host_device {
--
1.7.4.1
WARNING: multiple messages have this Message-ID (diff)
From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Abhishek Kane <v-abkane@microsoft.com>,
Hank Janssen <hjanssen@microsoft.com>
Subject: [PATCH 33/40] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c
Date: Wed, 29 Jun 2011 07:39:30 -0700 [thread overview]
Message-ID: <1309358377-8537-33-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1309358377-8537-1-git-send-email-kys@microsoft.com>
Now, cleanup storvsc_drv.c after adding the contents of storvsc.c
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 105 +++-----------------------------------
1 files changed, 7 insertions(+), 98 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index f460741..0702dc0 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -19,8 +19,15 @@
* Hank Janssen <hjanssen@microsoft.com>
* K. Y. Srinivasan <kys@microsoft.com>
*/
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/completion.h>
+#include <linux/string.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/mm.h>
+#include <linux/delay.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/blkdev.h>
@@ -41,39 +48,6 @@ static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
module_param(storvsc_ringbuffer_size, int, S_IRUGO);
MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
-/*
- * Copyright (c) 2009, 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>
- *
- */
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/completion.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/mm.h>
-#include <linux/delay.h>
-
-#include "hyperv.h"
-#include "hyperv_storage.h"
-
static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
{
@@ -504,71 +478,6 @@ int storvsc_do_io(struct hv_device *device,
return ret;
}
-/*
- * The channel properties uniquely specify how the device is to be
- * presented to the guest. Map this information for use by the block
- * driver. For Linux guests on Hyper-V, we emulate a scsi HBA in the guest
- * (storvsc_drv) and so scsi devices in the guest are handled by
- * native upper level Linux drivers. Consequently, Hyper-V
- * block driver, while being a generic block driver, presently does not
- * deal with anything other than devices that would need to be presented
- * to the guest as an IDE disk.
- *
- * This function maps the channel properties as embedded in the input
- * parameter device_info onto information necessary to register the
- * corresponding block device.
- *
- * Currently, there is no way to stop the emulation of the block device
- * on the host side. And so, to prevent the native IDE drivers in Linux
- * from taking over these devices (to be managedby Hyper-V block
- * driver), we will take over if need be the major of the IDE controllers.
- *
- */
-
-int storvsc_get_major_info(struct storvsc_device_info *device_info,
- struct storvsc_major_info *major_info)
-{
- static bool ide0_registered;
- static bool ide1_registered;
-
- /*
- * For now we only support IDE disks.
- */
- major_info->devname = "ide";
- major_info->diskname = "hd";
-
- if (device_info->path_id) {
- major_info->major = 22;
- if (!ide1_registered) {
- major_info->do_register = true;
- ide1_registered = true;
- } else
- major_info->do_register = false;
-
- if (device_info->target_id)
- major_info->index = 3;
- else
- major_info->index = 2;
-
- return 0;
- } else {
- major_info->major = 3;
- if (!ide0_registered) {
- major_info->do_register = true;
- ide0_registered = true;
- } else
- major_info->do_register = false;
-
- if (device_info->target_id)
- major_info->index = 1;
- else
- major_info->index = 0;
-
- return 0;
- }
-
- return -ENODEV;
-}
static const char *driver_name = "storvsc";
struct hv_host_device {
--
1.7.4.1
next prev parent reply other threads:[~2011-06-29 14:39 UTC|newest]
Thread overview: 112+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 14:38 [PATCH 00/40] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-06-29 14:38 ` [PATCH 01/40] Staging: hv: storvsc: Do not aquire an unnecessary reference on stor_device K. Y. Srinivasan
2011-06-29 14:38 ` [PATCH 02/40] Staging: hv: storvsc: Rename must_get_stor_device() K. Y. Srinivasan
2011-06-29 14:38 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 03/40] Staging: hv: storvsc: Rename get_stor_device() K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 04/40] Staging: hv: storvsc: Cleanup alloc_stor_device() K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 05/40] Staging: hv: storvsc: Introduce state to manage the lifecycle of stor device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 06/40] Staging: hv: vmbus: Introduce a lock to protect the ext field in hv_device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 07/40] Staging: hv: storvsc: Use the newly introduced lock in accessing ext field K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 08/40] Staging: hv: storvsc: Prevent outgoing traffic when stor dev is destroyed K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 09/40] Staging: hv: storvsc: Get rid of release_stor_device() by inlining the code K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 10/40] Staging: hv: storvsc: Get rid of final_release_stor_device() by inlining code K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 11/40] Staging: hv: storvsc: Leverage the spinlock to manage ref_cnt K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 12/40] Staging: hv: storvsc: Further cleanup reference counting of stor_device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 13/40] Staging: hv: netvsc: Introduce code to properly manage outstanding sends K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 14/40] Staging: hv: netvsc: Inline the code for free_net_device() K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 15/40] Staging: hv: netvsc: Cleanup alloc_net_device() K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 16/40] Staging: hv: netvsc: Introduce state to manage the lifecycle of net device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 17/40] Staging: hv: netvsc: Use the newly introduced lock in accessing ext field K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 18/40] Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 19/40] Staging: hv: netvsc: Get rid of release_outbound_net_device() by inlining the code K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 20/40] Staging: hv: netvsc: Get rid of release_inbound_net_device() " K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 21/40] Staging: hv: netvsc: Leverage the spinlock to manage ref_cnt K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 22/40] Staging: hv: netvsc: Further cleanup reference counting of netvsc_device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 23/40] Staging: hv: storvsc: Introduce code to manage IDE devices using storvsc HBA K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-30 19:38 ` Christoph Hellwig
2011-06-30 21:38 ` KY Srinivasan
2011-07-01 8:19 ` Christoph Hellwig
2011-06-29 14:39 ` [PATCH 24/40] Staging: hv: storvsc: On I/O get the correct IDE device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-30 19:40 ` Christoph Hellwig
2011-06-30 19:40 ` Christoph Hellwig
2011-06-30 21:15 ` KY Srinivasan
2011-07-01 8:17 ` Christoph Hellwig
2011-07-01 8:17 ` Christoph Hellwig
2011-07-01 13:01 ` KY Srinivasan
2011-07-01 13:27 ` Christoph Hellwig
2011-06-29 14:39 ` [PATCH 25/40] Staging: hv: storvsc: Add state to manage the lifecycle of emulated HBA K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-30 19:44 ` Christoph Hellwig
2011-06-29 14:39 ` [PATCH 26/40] Staging: hv: storvsc: Handle probing IDE devices K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 27/40] Staging: hv: storvsc: Handle IDE devices correctly in storvsc_remove() K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 28/40] Staging: hv: storvsc: Handle IDE devices using the storvsc driver K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 29/40] Staging: hv: storvsc: Optimize bounce buffer handling for the "write" case K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 30/40] Staging: hv: storvsc: Optimize the bounce buffer handling in the "read" case K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 31/40] Staging: hv: storvsc: Get rid of blkvsc_drv.c as this code is not used K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 32/40] Staging: hv: storvsc: Include storvsc.c in storvsc_drv.c K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan [this message]
2011-06-29 14:39 ` [PATCH 33/40] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 34/40] Staging: hv: storvsc: Add the contents of hyperv_storage.h to storvsc_drv.c K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-30 19:45 ` Christoph Hellwig
2011-06-30 20:13 ` KY Srinivasan
2011-06-30 20:13 ` KY Srinivasan
2011-07-01 8:16 ` Christoph Hellwig
2011-07-01 12:48 ` KY Srinivasan
2011-07-05 16:12 ` Greg KH
2011-06-29 14:39 ` [PATCH 35/40] Staging: hv: storvsc: Make storvsc_dev_add() a static function K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-30 19:45 ` Christoph Hellwig
2011-06-29 14:39 ` [PATCH 36/40] Staging: hv: storvsc: Make storvsc_dev_remove() " K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 37/40] Staging: hv: storvsc: Make storvsc_do_io() " K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 38/40] Staging: hv: storvsc: Fixup srb_status for INQUIRY and MODE_SENSE K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-30 19:47 ` Christoph Hellwig
2011-06-30 19:59 ` KY Srinivasan
2011-07-01 8:00 ` Christoph Hellwig
2011-06-29 14:39 ` [PATCH 39/40] Staging: hv: storvsc: In case of scsi errors offline the device K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-06-29 14:39 ` [PATCH 40/40] Staging: hv: storvsc: No need to copy from bounce buffer in case of failure K. Y. Srinivasan
2011-06-29 14:39 ` K. Y. Srinivasan
2011-07-05 16:14 ` [PATCH 01/40] Staging: hv: storvsc: Do not aquire an unnecessary reference on stor_device Greg KH
2011-07-05 16:43 ` KY Srinivasan
2011-07-05 16:43 ` KY Srinivasan
2011-06-30 19:33 ` [PATCH 00/40] Staging: hv: Driver cleanup Christoph Hellwig
2011-06-30 23:28 ` KY Srinivasan
2011-07-01 8:21 ` Christoph Hellwig
2011-07-01 13:31 ` KY Srinivasan
2011-06-30 23:32 ` KY Srinivasan
2011-06-30 23:32 ` KY Srinivasan
2011-06-30 23:48 ` Stephen Hemminger
2011-07-01 0:19 ` KY Srinivasan
2011-07-01 4:45 ` Stephen Hemminger
2011-07-01 13:25 ` KY Srinivasan
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=1309358377-8537-33-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=v-abkane@microsoft.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.