* [PATCH 00/25] Staging: hv: Cleanup vmbus driver code
From: K. Y. Srinivasan @ 2011-04-26 16:19 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: K. Y. Srinivasan
This patch-set addresses some of the bus/driver model cleanup that
Greg sugested over the last couple of days. In this patch-set we
deal with the following issues:
1) Cleanup unnecessary state in struct hv_device and
struct hv_driver to be compliant with the Linux
Driver model.
2) Cleanup the vmbus_match() function to conform with the
Linux Driver model.
3) Cleanup error handling in the vmbus_probe() and
vmbus_child_device_register() functions. Fixed a
bug in the probe failure path as part of this cleanup.
4) The Windows host cannot handle the vmbus_driver being
unloaded and subsequently loaded. Cleanup the driver with
this in mind.
5) Get rid of struct hv_bus that embedded struct bus_type to
conform with the LDM.
6) Add probe/remove/shutdown functions to struct hv_driver to
conform to LDM.
7) On some older Hyper-V hosts, the Linux PCI sub-sytem is not able
to allocate irq resources to the vmbus driver. I recently learnt
that the vmbus driver is an acpi enumerated device on the Hyper-V
platform. Added code to retrieve irq information from DSDT.
Regards,
K. Y
^ permalink raw reply
* Re: [PATCH] virtio, ring: Use ALIGN macros in virtio_ring.h
From: Liu Yuan @ 2011-04-26 7:50 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: linux-kernel, virtualization
In-Reply-To: <20110426074230.GA10364@redhat.com>
On 04/26/2011 03:42 PM, Michael S. Tsirkin wrote:
> On Tue, Apr 26, 2011 at 12:11:10PM +0800, Liu Yuan wrote:
>> From: Liu Yuan<tailai.ly@taobao.com>
>>
>>
>> Signed-off-by: Liu Yuan<tailai.ly@taobao.com>
> Issue is, these functions are exported to userspace,
> which does not have these macros.
>
Ah, thanks, I should have noticed the '#ifdef __KERNEL__' just below the
lines I touched.
Thanks,
Yuan
^ permalink raw reply
* Re: [PATCH] virtio, ring: Use ALIGN macros in virtio_ring.h
From: Michael S. Tsirkin @ 2011-04-26 7:42 UTC (permalink / raw)
To: Liu Yuan; +Cc: linux-kernel, virtualization
In-Reply-To: <1303791070-15196-1-git-send-email-namei.unix@gmail.com>
On Tue, Apr 26, 2011 at 12:11:10PM +0800, Liu Yuan wrote:
> From: Liu Yuan <tailai.ly@taobao.com>
>
>
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Issue is, these functions are exported to userspace,
which does not have these macros.
> ---
> include/linux/virtio_ring.h | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
> index e4d144b..6299050 100644
> --- a/include/linux/virtio_ring.h
> +++ b/include/linux/virtio_ring.h
> @@ -99,15 +99,13 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
> vr->num = num;
> vr->desc = p;
> vr->avail = p + num*sizeof(struct vring_desc);
> - vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1)
> - & ~(align - 1));
> + vr->used = (void *)PTR_ALIGN(&vr->avail->ring[num], align);
> }
>
> static inline unsigned vring_size(unsigned int num, unsigned long align)
> {
> - return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
> - + align - 1) & ~(align - 1))
> - + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num;
> + return ((sizeof(struct vring_desc) * num + ALIGN(sizeof(__u16) * (2 + num), align))
> + + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num);
> }
>
> #ifdef __KERNEL__
> --
> 1.7.1
^ permalink raw reply
* [PATCH] virtio, ring: Use ALIGN macros in virtio_ring.h
From: Liu Yuan @ 2011-04-26 4:11 UTC (permalink / raw)
To: Rusty Russell, Michael S. Tsirkin; +Cc: linux-kernel, virtualization
From: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
---
include/linux/virtio_ring.h | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index e4d144b..6299050 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -99,15 +99,13 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
vr->num = num;
vr->desc = p;
vr->avail = p + num*sizeof(struct vring_desc);
- vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1)
- & ~(align - 1));
+ vr->used = (void *)PTR_ALIGN(&vr->avail->ring[num], align);
}
static inline unsigned vring_size(unsigned int num, unsigned long align)
{
- return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
- + align - 1) & ~(align - 1))
- + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num;
+ return ((sizeof(struct vring_desc) * num + ALIGN(sizeof(__u16) * (2 + num), align))
+ + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num);
}
#ifdef __KERNEL__
--
1.7.1
^ permalink raw reply related
* Re: Hyper-V vmbus driver
From: Greg KH @ 2011-04-25 3:03 UTC (permalink / raw)
To: KY Srinivasan
Cc: virtualization@lists.osdl.org, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org
In-Reply-To: <6E21E5352C11B742B20C142EB499E0481D45ED@TK5EX14MBXC122.redmond.corp.microsoft.com>
On Mon, Apr 25, 2011 at 02:15:47AM +0000, KY Srinivasan wrote:
> > On Sun, Apr 24, 2011 at 04:18:24PM +0000, KY Srinivasan wrote:
> > > > On Mon, Apr 11, 2011 at 12:07:08PM -0700, Greg KH wrote:
> > > >
> > > > Due to other external issues, my patch backlog is still not gotten
> > > > through yet, sorry. Sometimes "real life" intrudes on the best of
> > > > plans.
> > > >
> > > > I'll get to this when I get through the rest of your hv patches, and the
> > > > other patches pending that I have in my queues.
> > >
> > > Thanks Greg. The latest re-send of my hv patches are against the tree:
> > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
> > > that I picked up on April 22, 2011. I hope there won't be any issues
> > > this time around.
> >
> > Me too :)
>
> Just curious; when are you planning to drain the hv patch queue next.
When I get a chance to get to it :)
> > > > But, I would recommend you going through and looking at the code and
> > > > verifying that you feel the bus code is "ready". At a very quick
> > > > glance, you should not have individual drivers have to set their 'struct
> > > > device' pointers directly, that is something that the bus does, not the
> > > > driver. The driver core will call your bus and your bus will then do
> > > > the matching and call the probe function of the driver if needed.
> > >
> > > Are you referring to the fact that in the vmbus_match function,
> > > the current code binds the device specific driver to the
> > > corresponding hv_device structure?
> >
> > Yes, that's the problem (well, kind of the problem.)
> >
> > You seem to be doing things a bit "odd" and that's due to the old way
> > the code was written.
> >
> > First off, don't embed a struct bus_type in another structure, that's
> > not needed at all. Why is that done? Anyway...
>
> Currently, struct bus_type is embedded in struct hv_bus that has very minimal
> additional state. I will clean this up.
Thanks.
> > In your vmbus_match function, you should be matching to see if your
> > device matches the driver that is passed to you. You do this by looking
> > at some type of "id". For the vmbus you should do this by looking at
> > the GUID, right? And it looks like you do do this, so that's fine.
> >
> > And then your vmbus_probe() function calls the driver probe function,
> > with the device it is to bind to. BUT, you need to have your probe
> > function pass in the correct device type (i.e. struct hv_device, NOT
> > struct device.)
>
> I will clean this up.
Thanks.
> > That way, your hv_driver will have a type all its own, with probe
> > functions that look nothing like the probe functions that 'struct
> > driver' has in it. Look at 'struct pci_driver' for an example of this.
> > Don't try to overload the probe/remove/suspend/etc functions of your
> > hv_driver by using the "base" 'struct device_driver' callbacks, that's
> > putting knowledge of the driver core into the individual hv drivers,
> > where it's not needed at all.
> >
> > And, by doing that, you should be able to drop your private pointer in
> > the hv_driver function completly, right? That shouldn't be needed at
> > all.
>
> After sending you the mail this afternoon, I worked on patches that do exactly that.
> I did this with the current model where probe/remove/ etc. get a pointer
> to struct device. Within a specific driver you can always map a struct device
> pointer to the class specific device driver. I will keep that code; I will however
> do what you are suggesting here and make probe/remove etc. take a pointer
> to struct hv_device.
Great.
> > > > See the PCI driver structure for an example of this if you are curious.
> > > > It should also allow you to get rid of that unneeded *priv pointer in
> > > > the struct hv_driver.
> > >
> > > I am pretty sure, I can get rid of this. The way this code was originally
> > > structured, in the vmbus_match() function, you needed to get at the
> > > device specific driver pointer so that we could do the binding between
> > > the hv_device and the correspond device specific driver. The earlier code
> > > depended on the structure layout to map a pointer to the hv_driver to
> > > the corresponding device specific driver (net, block etc.) To get rid of
> > > this layout dependency, I introduced an addition field (priv) in the hv_driver.
> > >
> > > There is, I suspect sufficient state available to:
> > >
> > > (a) Not require the vmbus_match() function to do the binding.
> >
> > No, you still want that, see above.
>
> The current code has the following
> assignment after a match is found:
>
> device_ctx->drv = drv->priv;
>
> What I meant was that I would get rid of this assignment (binding)
> since I can get that information quite easily in the class specific
> (net, block, etc.) where it is needed.
Yes, that is good as it is not needed.
It's also a flaw in that you would not allow multiple devices attached
to the same driver, but as you can't run this bus that way, it was never
noticed.
> > > (b) And to get at the device specific driver structure from the generic
> > > driver structure without having to have an explicit mapping
> > > maintained in the hv_driver structure.
> >
> > Kind of, see above for more details.
> >
> > If you want a good example, again, look at the PCI core code, it's
> > pretty simple in this area (hint, don't look at the USB code, it does
> > much more complex things than you want, due to things that the USB bus
> > imposes on devices, that's never a good example to look at.)
> >
> > Hope this helps. Please let me know if it doesn't :)
>
> Thanks for this detailed mail Greg. As I am writing this email, I have
> pretty much completed the code for much of what we have discussed
> here. These are on top of my patches that are yet to be applied (the
> ones that I sent on April 22). Since some of these changes also affect
> netvsc code and Haiyang had sent some patches to deal with forward
> declarations in the netvsc code, I have locally applied haiyang's
> patches. I will send you these patches soon.
Great.
thanks,
greg k-h
^ permalink raw reply
* RE: Hyper-V vmbus driver
From: KY Srinivasan @ 2011-04-25 2:15 UTC (permalink / raw)
To: Greg KH
Cc: Greg KH, devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, virtualization@lists.osdl.org
In-Reply-To: <20110425001344.GA7046@suse.de>
> -----Original Message-----
> From: Greg KH [mailto:gregkh@suse.de]
> Sent: Sunday, April 24, 2011 8:14 PM
> To: KY Srinivasan
> Cc: Greg KH; devel@linuxdriverproject.org; linux-kernel@vger.kernel.org;
> virtualization@lists.osdl.org
> Subject: Re: Hyper-V vmbus driver
>
> On Sun, Apr 24, 2011 at 04:18:24PM +0000, KY Srinivasan wrote:
> > > On Mon, Apr 11, 2011 at 12:07:08PM -0700, Greg KH wrote:
> > >
> > > Due to other external issues, my patch backlog is still not gotten
> > > through yet, sorry. Sometimes "real life" intrudes on the best of
> > > plans.
> > >
> > > I'll get to this when I get through the rest of your hv patches, and the
> > > other patches pending that I have in my queues.
> >
> > Thanks Greg. The latest re-send of my hv patches are against the tree:
> > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
> > that I picked up on April 22, 2011. I hope there won't be any issues
> > this time around.
>
> Me too :)
Just curious; when are you planning to drain the hv patch queue next.
>
> > > But, I would recommend you going through and looking at the code and
> > > verifying that you feel the bus code is "ready". At a very quick
> > > glance, you should not have individual drivers have to set their 'struct
> > > device' pointers directly, that is something that the bus does, not the
> > > driver. The driver core will call your bus and your bus will then do
> > > the matching and call the probe function of the driver if needed.
> >
> > Are you referring to the fact that in the vmbus_match function,
> > the current code binds the device specific driver to the
> > corresponding hv_device structure?
>
> Yes, that's the problem (well, kind of the problem.)
>
> You seem to be doing things a bit "odd" and that's due to the old way
> the code was written.
>
> First off, don't embed a struct bus_type in another structure, that's
> not needed at all. Why is that done? Anyway...
Currently, struct bus_type is embedded in struct hv_bus that has very minimal
additional state. I will clean this up.
>
> In your vmbus_match function, you should be matching to see if your
> device matches the driver that is passed to you. You do this by looking
> at some type of "id". For the vmbus you should do this by looking at
> the GUID, right? And it looks like you do do this, so that's fine.
>
> And then your vmbus_probe() function calls the driver probe function,
> with the device it is to bind to. BUT, you need to have your probe
> function pass in the correct device type (i.e. struct hv_device, NOT
> struct device.)
I will clean this up.
>
> That way, your hv_driver will have a type all its own, with probe
> functions that look nothing like the probe functions that 'struct
> driver' has in it. Look at 'struct pci_driver' for an example of this.
> Don't try to overload the probe/remove/suspend/etc functions of your
> hv_driver by using the "base" 'struct device_driver' callbacks, that's
> putting knowledge of the driver core into the individual hv drivers,
> where it's not needed at all.
>
> And, by doing that, you should be able to drop your private pointer in
> the hv_driver function completly, right? That shouldn't be needed at
> all.
After sending you the mail this afternoon, I worked on patches that do exactly that.
I did this with the current model where probe/remove/ etc. get a pointer
to struct device. Within a specific driver you can always map a struct device
pointer to the class specific device driver. I will keep that code; I will however
do what you are suggesting here and make probe/remove etc. take a pointer
to struct hv_device.
>
> > > See the PCI driver structure for an example of this if you are curious.
> > > It should also allow you to get rid of that unneeded *priv pointer in
> > > the struct hv_driver.
> >
> > I am pretty sure, I can get rid of this. The way this code was originally
> > structured, in the vmbus_match() function, you needed to get at the
> > device specific driver pointer so that we could do the binding between
> > the hv_device and the correspond device specific driver. The earlier code
> > depended on the structure layout to map a pointer to the hv_driver to
> > the corresponding device specific driver (net, block etc.) To get rid of
> > this layout dependency, I introduced an addition field (priv) in the hv_driver.
> >
> > There is, I suspect sufficient state available to:
> >
> > (a) Not require the vmbus_match() function to do the binding.
>
> No, you still want that, see above.
The current code has the following
assignment after a match is found:
device_ctx->drv = drv->priv;
What I meant was that I would get rid of this assignment (binding)
since I can get that information quite easily in the class specific
(net, block, etc.) where it is needed.
>
> > (b) And to get at the device specific driver structure from the generic
> > driver structure without having to have an explicit mapping
> > maintained in the hv_driver structure.
>
> Kind of, see above for more details.
>
> If you want a good example, again, look at the PCI core code, it's
> pretty simple in this area (hint, don't look at the USB code, it does
> much more complex things than you want, due to things that the USB bus
> imposes on devices, that's never a good example to look at.)
>
> Hope this helps. Please let me know if it doesn't :)
Thanks for this detailed mail Greg. As I am writing this email, I have pretty much
completed the code for much of what we have discussed here. These are on top
of my patches that are yet to be applied (the ones that I sent on April 22). Since some of
these changes also affect netvsc code and Haiyang had sent some patches to deal with
forward declarations in the netvsc code, I have locally applied haiyang's patches. I will send you
these patches soon.
Regards,
K. Y
>
> thanks,
>
> greg k-h
^ permalink raw reply
* Re: Hyper-V vmbus driver
From: Greg KH @ 2011-04-25 0:13 UTC (permalink / raw)
To: KY Srinivasan
Cc: Greg KH, devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, virtualization@lists.osdl.org
In-Reply-To: <6E21E5352C11B742B20C142EB499E0481D3562@TK5EX14MBXC122.redmond.corp.microsoft.com>
On Sun, Apr 24, 2011 at 04:18:24PM +0000, KY Srinivasan wrote:
> > On Mon, Apr 11, 2011 at 12:07:08PM -0700, Greg KH wrote:
> >
> > Due to other external issues, my patch backlog is still not gotten
> > through yet, sorry. Sometimes "real life" intrudes on the best of
> > plans.
> >
> > I'll get to this when I get through the rest of your hv patches, and the
> > other patches pending that I have in my queues.
>
> Thanks Greg. The latest re-send of my hv patches are against the tree:
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
> that I picked up on April 22, 2011. I hope there won't be any issues
> this time around.
Me too :)
> > But, I would recommend you going through and looking at the code and
> > verifying that you feel the bus code is "ready". At a very quick
> > glance, you should not have individual drivers have to set their 'struct
> > device' pointers directly, that is something that the bus does, not the
> > driver. The driver core will call your bus and your bus will then do
> > the matching and call the probe function of the driver if needed.
>
> Are you referring to the fact that in the vmbus_match function,
> the current code binds the device specific driver to the
> corresponding hv_device structure?
Yes, that's the problem (well, kind of the problem.)
You seem to be doing things a bit "odd" and that's due to the old way
the code was written.
First off, don't embed a struct bus_type in another structure, that's
not needed at all. Why is that done? Anyway...
In your vmbus_match function, you should be matching to see if your
device matches the driver that is passed to you. You do this by looking
at some type of "id". For the vmbus you should do this by looking at
the GUID, right? And it looks like you do do this, so that's fine.
And then your vmbus_probe() function calls the driver probe function,
with the device it is to bind to. BUT, you need to have your probe
function pass in the correct device type (i.e. struct hv_device, NOT
struct device.)
That way, your hv_driver will have a type all its own, with probe
functions that look nothing like the probe functions that 'struct
driver' has in it. Look at 'struct pci_driver' for an example of this.
Don't try to overload the probe/remove/suspend/etc functions of your
hv_driver by using the "base" 'struct device_driver' callbacks, that's
putting knowledge of the driver core into the individual hv drivers,
where it's not needed at all.
And, by doing that, you should be able to drop your private pointer in
the hv_driver function completly, right? That shouldn't be needed at
all.
> > See the PCI driver structure for an example of this if you are curious.
> > It should also allow you to get rid of that unneeded *priv pointer in
> > the struct hv_driver.
>
> I am pretty sure, I can get rid of this. The way this code was originally
> structured, in the vmbus_match() function, you needed to get at the
> device specific driver pointer so that we could do the binding between
> the hv_device and the correspond device specific driver. The earlier code
> depended on the structure layout to map a pointer to the hv_driver to
> the corresponding device specific driver (net, block etc.) To get rid of
> this layout dependency, I introduced an addition field (priv) in the hv_driver.
>
> There is, I suspect sufficient state available to:
>
> (a) Not require the vmbus_match() function to do the binding.
No, you still want that, see above.
> (b) And to get at the device specific driver structure from the generic
> driver structure without having to have an explicit mapping
> maintained in the hv_driver structure.
Kind of, see above for more details.
If you want a good example, again, look at the PCI core code, it's
pretty simple in this area (hint, don't look at the USB code, it does
much more complex things than you want, due to things that the USB bus
imposes on devices, that's never a good example to look at.)
Hope this helps. Please let me know if it doesn't :)
thanks,
greg k-h
^ permalink raw reply
* RE: Hyper-V vmbus driver
From: KY Srinivasan @ 2011-04-24 16:18 UTC (permalink / raw)
To: Greg KH, Greg KH
Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
virtualization@lists.osdl.org
In-Reply-To: <20110423152055.GA29109@kroah.com>
> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Saturday, April 23, 2011 11:21 AM
> To: Greg KH
> Cc: KY Srinivasan; devel@linuxdriverproject.org; linux-kernel@vger.kernel.org;
> virtualization@lists.osdl.org
> Subject: Re: Hyper-V vmbus driver
>
> On Mon, Apr 11, 2011 at 12:07:08PM -0700, Greg KH wrote:
>
> Due to other external issues, my patch backlog is still not gotten
> through yet, sorry. Sometimes "real life" intrudes on the best of
> plans.
>
> I'll get to this when I get through the rest of your hv patches, and the
> other patches pending that I have in my queues.
Thanks Greg. The latest re-send of my hv patches are against the tree:
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git
that I picked up on April 22, 2011. I hope there won't be any issues
this time around.
>
> But, I would recommend you going through and looking at the code and
> verifying that you feel the bus code is "ready". At a very quick
> glance, you should not have individual drivers have to set their 'struct
> device' pointers directly, that is something that the bus does, not the
> driver. The driver core will call your bus and your bus will then do
> the matching and call the probe function of the driver if needed.
Are you referring to the fact that in the vmbus_match function,
the current code binds the device specific driver to the
corresponding hv_device structure?
>
> See the PCI driver structure for an example of this if you are curious.
> It should also allow you to get rid of that unneeded *priv pointer in
> the struct hv_driver.
I am pretty sure, I can get rid of this. The way this code was originally
structured, in the vmbus_match() function, you needed to get at the
device specific driver pointer so that we could do the binding between
the hv_device and the correspond device specific driver. The earlier code
depended on the structure layout to map a pointer to the hv_driver to
the corresponding device specific driver (net, block etc.) To get rid of
this layout dependency, I introduced an addition field (priv) in the hv_driver.
There is, I suspect sufficient state available to:
(a) Not require the vmbus_match() function to do the binding.
(b) And to get at the device specific driver structure from the generic
driver structure without having to have an explicit mapping
maintained in the hv_driver structure.
Before, I go ahead and make these changes, Greg, can you confirm
if I have captured your concerns correctly.
> You should be able to set that structure
> constant, like all other busses. Right now you can not which shows a
> design issue.
I am a little confused here. While I agree with you that perhaps we could
get rid the priv element in the hv_driver structure, what else would you
want done here.
>
> So, take a look at that and let me know what you think.
Once I hear from you, I will work on getting rid of the
priv pointer from hv_driver structure as well as the code that
currently does the binding in vmbus_match.
Regards,
K. Y
^ permalink raw reply
* SNAPI2011 Early Registration Deadline Extended (7th IEEE International Workshop on Storage Network Architecture and Parallel I/O)
From: Ming Zhao @ 2011-04-24 10:46 UTC (permalink / raw)
To: virtualization
Updates:
* Early registration deadline extended to April 29th, 2011.
========================================================================
Call for Participation
7th IEEE International Workshop on
Storage Network Architecture and Parallel I/Os
(SNAPI 2011)
http://snapi2011.cis.fiu.edu
May 25, 2011 Denver, Colorado, USA
In conjunction with the 27th IEEE Conference on
Mass Storage Systems and Technologies (MSST 2011)
========================================================================
SNAPI 2011, the 7th IEEE International Workshop on Storage Network
Architecture and Parallel I/O, will highlight the latest research in the
architecture, design, implementation, and evaluation of local and networked
storage and parallel I/O systems. This year, the program includes the
latest breakthroughs in solid-state storage technology, the latest
improvements in conventional storage technologies, and new horizons in
large-scale storage systems and parallel I/O. The workshop starts off with
a keynote by Dr. Gary Grider, Deputy Division Director (HPC) at Los Alamos
National Lab on storage issues in next generation of exascale computing
machines. With adequate material for practitioners and researchers,
industry folk and academics, SNAPI 2011 has something new for everyone
related to storage.
The SNAPI 2011 program is now available here:
http://snapi2011.cis.fiu.edu/General/Program
SNAPI will be held on May 25th in the beautiful, historic Brown Palace
hotel in Denver and is co-located with the 27th IEEE Symposium on Mass
Storage Systems and Technologies:
http://www.brownpalace.com
We have a limited number of rooms reserved at the Brown Palace and the
adjacent Comfort Inn. The conference rates vary between the two facilities,
so please reserve your room early to get your choice of room and rate.
You will find the preliminary programs, hotel information, photos of the
hotel and the area, and other information at:
http://storageconference.org
Early registration ends in approximately one week. Please register early to
avail the discount!
^ permalink raw reply
* [RFC PATCH TRIVIAL] Reading the virtio code...
From: Rob Landley @ 2011-04-23 23:13 UTC (permalink / raw)
To: rusty, virtualization
From: Rob Landley <rlandley@parallels.com>
Going indirect for only two buffers isn't likely to be a performance win
because the kmalloc/kfree overhead for the indirect block can't be cheaper
than one extra linked list traversal.
Properly "tuning" the threshold would probably be workload-specific.
(One big downside of not going indirect is extra pressure on the table
entries, and table size varies.) But I think that in the general case,
2 is a defensible minimum?
Signed-off-by: Rob Landley <rlandley@parallels.com>
---
drivers/virtio/virtio_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index b0043fb..2b69441 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -173,7 +173,7 @@ int virtqueue_add_buf_gfp(struct virtqueue *_vq,
/* If the host supports indirect descriptor tables, and we have multiple
* buffers, then go indirect. FIXME: tune this threshold */
- if (vq->indirect && (out + in) > 1 && vq->num_free) {
+ if (vq->indirect && (out + in) > 2 && vq->num_free) {
head = vring_add_indirect(vq, sg, out, in, gfp);
if (likely(head >= 0))
goto add_head;
^ permalink raw reply related
* Re: Hyper-V vmbus driver
From: Greg KH @ 2011-04-23 15:20 UTC (permalink / raw)
To: Greg KH
Cc: devel@linuxdriverproject.org, linux-kernel@vger.kernel.org,
virtualization@lists.osdl.org
In-Reply-To: <20110411190708.GA21355@suse.de>
On Mon, Apr 11, 2011 at 12:07:08PM -0700, Greg KH wrote:
> > With that patch-set, I think I have addressed all architectural issues that I
> > am aware of.
> >
> > I was wondering if you would have the time to let me know what else would have
> > to be addressed
> >
> > in the vmbus driver, before it could be considered ready for exiting staging.
> > As always your help is
> >
> > greatly appreciated.
>
> Anyway, yes, I discussed this with Hank last week at the LF Collab
> summit. I'll look at the vmbus code later this week when I catch up on
> all of my other work (stable, usb, tty, staging, etc.) that has piled up
> during my 2 week absence, and get back to you with what I feel is still
> needed to be done, if anything.
Due to other external issues, my patch backlog is still not gotten
through yet, sorry. Sometimes "real life" intrudes on the best of
plans.
I'll get to this when I get through the rest of your hv patches, and the
other patches pending that I have in my queues.
But, I would recommend you going through and looking at the code and
verifying that you feel the bus code is "ready". At a very quick
glance, you should not have individual drivers have to set their 'struct
device' pointers directly, that is something that the bus does, not the
driver. The driver core will call your bus and your bus will then do
the matching and call the probe function of the driver if needed.
See the PCI driver structure for an example of this if you are curious.
It should also allow you to get rid of that unneeded *priv pointer in
the struct hv_driver. You should be able to set that structure
constant, like all other busses. Right now you can not which shows a
design issue.
So, take a look at that and let me know what you think.
thanks,
greg k-h
^ permalink raw reply
* [PATCH 21/21] Staging: hv: Get rid of IDE details from blkvsc_drv.c
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization
Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
Now get rid of IDE details from blkvsc_drv.c.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 55 +++++++++++---------------------------
drivers/staging/hv/storvsc.c | 18 ++++++------
2 files changed, 25 insertions(+), 48 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 3229ebc..acc5435 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -953,11 +953,8 @@ static int blkvsc_probe(struct device *device)
struct block_device_context *blkdev = NULL;
struct storvsc_device_info device_info;
- int major = 0;
- int devnum = 0;
+ struct storvsc_major_info major_info;
int ret = 0;
- static int ide0_registered;
- static int ide1_registered;
blkdev = kzalloc(sizeof(struct block_device_context), GFP_KERNEL);
@@ -994,43 +991,23 @@ static int blkvsc_probe(struct device *device)
dev_set_drvdata(device, blkdev);
- /* Calculate the major and device num */
- if (blkdev->path == 0) {
- major = IDE0_MAJOR;
- devnum = blkdev->path + blkdev->target; /* 0 or 1 */
-
- if (!ide0_registered) {
- ret = register_blkdev(major, "ide");
- if (ret != 0) {
- DPRINT_ERR(BLKVSC_DRV,
- "register_blkdev() failed! ret %d",
- ret);
- goto remove;
- }
+ ret = stor_vsc_get_major_info(&device_info, &major_info);
- ide0_registered = 1;
- }
- } else if (blkdev->path == 1) {
- major = IDE1_MAJOR;
- devnum = blkdev->path + blkdev->target + 1; /* 2 or 3 */
-
- if (!ide1_registered) {
- ret = register_blkdev(major, "ide");
- if (ret != 0) {
- DPRINT_ERR(BLKVSC_DRV,
- "register_blkdev() failed! ret %d",
- ret);
- goto remove;
- }
+ if (ret)
+ goto cleanup;
+
+ if (major_info.do_register) {
+ ret = register_blkdev(major_info.major, major_info.devname);
- ide1_registered = 1;
+ if (ret != 0) {
+ DPRINT_ERR(BLKVSC_DRV,
+ "register_blkdev() failed! ret %d", ret);
+ goto remove;
}
- } else {
- ret = -1;
- goto cleanup;
}
- DPRINT_INFO(BLKVSC_DRV, "blkvsc registered for major %d!!", major);
+ DPRINT_INFO(BLKVSC_DRV, "blkvsc registered for major %d!!",
+ major_info.major);
blkdev->gd = alloc_disk(BLKVSC_MINORS);
if (!blkdev->gd) {
@@ -1046,8 +1023,8 @@ static int blkvsc_probe(struct device *device)
blk_queue_bounce_limit(blkdev->gd->queue, BLK_BOUNCE_ANY);
blk_queue_dma_alignment(blkdev->gd->queue, 511);
- blkdev->gd->major = major;
- if (devnum == 1 || devnum == 3)
+ blkdev->gd->major = major_info.major;
+ if (major_info.index == 1 || major_info.index == 3)
blkdev->gd->first_minor = BLKVSC_MINORS;
else
blkdev->gd->first_minor = 0;
@@ -1055,7 +1032,7 @@ static int blkvsc_probe(struct device *device)
blkdev->gd->events = DISK_EVENT_MEDIA_CHANGE;
blkdev->gd->private_data = blkdev;
blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device);
- sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum);
+ sprintf(blkdev->gd->disk_name, "hd%c", 'a' + major_info.index);
blkvsc_do_operation(blkdev, DO_INQUIRY);
blkvsc_do_operation(blkdev, DO_CAPACITY);
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index e2b3410..85bae5a 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -629,26 +629,26 @@ int stor_vsc_get_major_info(struct storvsc_device_info *device_info,
if (device_info->path_id) {
major_info->major = 22;
- if (!ide1_registered)
+ if (!ide1_registered) {
major_info->do_register = true;
- else {
- major_info->do_register = false;
ide1_registered = true;
- }
+ } else
+ major_info->do_register = false;
+
if (device_info->target_id)
major_info->index = 3;
- else
+ else
major_info->index = 2;
return 0;
} else {
major_info->major = 3;
- if (!ide0_registered)
+ if (!ide0_registered) {
major_info->do_register = true;
- else {
- major_info->do_register = false;
ide0_registered = true;
- }
+ } else
+ major_info->do_register = false;
+
if (device_info->target_id)
major_info->index = 1;
else
--
1.7.4.1
^ permalink raw reply related
* [PATCH 20/21] Staging: hv: Introduce a function to map channel properties onto block device info
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
In preparation for removing the IDE details from the block driver, implement
a function that maps channel properties to block device information.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/storvsc.c | 68 ++++++++++++++++++++++++++++++++++++++
drivers/staging/hv/storvsc_api.h | 10 +++++
2 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index d7ce393..e2b3410 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -17,6 +17,8 @@
* Authors:
* Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com>
+ *
+ * 4/3/2011: K. Y. Srinivasan - Significant restructuring and cleanup.
*/
#include <linux/kernel.h>
#include <linux/sched.h>
@@ -593,6 +595,72 @@ int stor_vsc_on_io_request(struct hv_device *device,
}
/*
+ * 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 stor_vsc_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;
+ else {
+ major_info->do_register = false;
+ ide1_registered = true;
+ }
+ 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;
+ else {
+ major_info->do_register = false;
+ ide0_registered = true;
+ }
+ if (device_info->target_id)
+ major_info->index = 1;
+ else
+ major_info->index = 0;
+
+ return 0;
+ }
+
+ return -ENODEV;
+}
+
+/*
* stor_vsc_on_cleanup - Perform any cleanup when the driver is removed
*/
void stor_vsc_on_cleanup(struct hv_driver *driver)
diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h
index d7db949..c98139c 100644
--- a/drivers/staging/hv/storvsc_api.h
+++ b/drivers/staging/hv/storvsc_api.h
@@ -92,6 +92,14 @@ struct storvsc_device_info {
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;
@@ -155,5 +163,7 @@ int stor_vsc_on_io_request(struct hv_device *device,
struct hv_storvsc_request *request);
void stor_vsc_on_cleanup(struct hv_driver *driver);
+int stor_vsc_get_major_info(struct storvsc_device_info *device_info,
+ struct storvsc_major_info *major_info);
#endif /* _STORVSC_API_H_ */
--
1.7.4.1
^ permalink raw reply related
* [PATCH 19/21] Staging: hv: Fix a jump label (Remove) in blkvsc_drv.c
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
One of the jump labels was named Remove; change it to remove.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index a47581c..3229ebc 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -1005,7 +1005,7 @@ static int blkvsc_probe(struct device *device)
DPRINT_ERR(BLKVSC_DRV,
"register_blkdev() failed! ret %d",
ret);
- goto Remove;
+ goto remove;
}
ide0_registered = 1;
@@ -1020,7 +1020,7 @@ static int blkvsc_probe(struct device *device)
DPRINT_ERR(BLKVSC_DRV,
"register_blkdev() failed! ret %d",
ret);
- goto Remove;
+ goto remove;
}
ide1_registered = 1;
@@ -1071,7 +1071,7 @@ static int blkvsc_probe(struct device *device)
return ret;
-Remove:
+remove:
storvsc_drv_obj->base.dev_rm(device_obj);
cleanup:
--
1.7.4.1
^ permalink raw reply related
* [PATCH 18/21] Staging: hv: Fix a jump label (Cleanup) in blkvsc_drv
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
One of the goto labels was named Cleanup; change it to cleanup.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index bf8647e..a47581c 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -963,7 +963,7 @@ static int blkvsc_probe(struct device *device)
blkdev = kzalloc(sizeof(struct block_device_context), GFP_KERNEL);
if (!blkdev) {
ret = -ENOMEM;
- goto Cleanup;
+ goto cleanup;
}
INIT_LIST_HEAD(&blkdev->pending_list);
@@ -977,14 +977,14 @@ static int blkvsc_probe(struct device *device)
SLAB_HWCACHE_ALIGN, NULL);
if (!blkdev->request_pool) {
ret = -ENOMEM;
- goto Cleanup;
+ goto cleanup;
}
/* Call to the vsc driver to add the device */
ret = storvsc_drv_obj->base.dev_add(device_obj, &device_info);
if (ret != 0)
- goto Cleanup;
+ goto cleanup;
blkdev->device_ctx = device_obj;
/* this identified the device 0 or 1 */
@@ -1027,7 +1027,7 @@ static int blkvsc_probe(struct device *device)
}
} else {
ret = -1;
- goto Cleanup;
+ goto cleanup;
}
DPRINT_INFO(BLKVSC_DRV, "blkvsc registered for major %d!!", major);
@@ -1035,7 +1035,7 @@ static int blkvsc_probe(struct device *device)
blkdev->gd = alloc_disk(BLKVSC_MINORS);
if (!blkdev->gd) {
ret = -1;
- goto Cleanup;
+ goto cleanup;
}
blkdev->gd->queue = blk_init_queue(blkvsc_request, &blkdev->lock);
@@ -1074,7 +1074,7 @@ static int blkvsc_probe(struct device *device)
Remove:
storvsc_drv_obj->base.dev_rm(device_obj);
-Cleanup:
+cleanup:
if (blkdev) {
if (blkdev->request_pool) {
kmem_cache_destroy(blkdev->request_pool);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 17/21] Staging: hv: Cleanup blkvsc_open()
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
Given that we don't support removable media, cleanup blkvsc_open().
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 3060bab..bf8647e 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -255,20 +255,12 @@ static int blkvsc_open(struct block_device *bdev, fmode_t mode)
{
struct block_device_context *blkdev = bdev->bd_disk->private_data;
-
- mutex_lock(&blkvsc_mutex);
spin_lock(&blkdev->lock);
- if (!blkdev->users && blkdev->device_type == DVD_TYPE) {
- spin_unlock(&blkdev->lock);
- check_disk_change(bdev);
- spin_lock(&blkdev->lock);
- }
-
blkdev->users++;
spin_unlock(&blkdev->lock);
- mutex_unlock(&blkvsc_mutex);
+
return 0;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 16/21] Staging: hv: Get rid of an unnecessary check in blkvsc_probe()
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
It is never the case that the dev_add function pointer will not be set
(we set it in this code!). Get rid of this meaningless check.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 35ad3d5..3060bab 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -968,11 +968,6 @@ static int blkvsc_probe(struct device *device)
static int ide1_registered;
- if (!storvsc_drv_obj->base.dev_add) {
- ret = -1;
- goto Cleanup;
- }
-
blkdev = kzalloc(sizeof(struct block_device_context), GFP_KERNEL);
if (!blkdev) {
ret = -ENOMEM;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 15/21] Staging: hv: Get rid of some DPRINT_ERR() calls
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
Get rid of some DPRINT_ERR() calls.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 92614d5..35ad3d5 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -17,6 +17,8 @@
* Authors:
* Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com>
+ *
+ * 4/3/2011: K. Y. Srinivasan - Significant restructuring and cleanup.
*/
#include <linux/init.h>
#include <linux/module.h>
@@ -967,7 +969,6 @@ static int blkvsc_probe(struct device *device)
if (!storvsc_drv_obj->base.dev_add) {
- DPRINT_ERR(BLKVSC_DRV, "OnDeviceAdd() not set");
ret = -1;
goto Cleanup;
}
@@ -995,10 +996,8 @@ static int blkvsc_probe(struct device *device)
/* Call to the vsc driver to add the device */
ret = storvsc_drv_obj->base.dev_add(device_obj, &device_info);
- if (ret != 0) {
- DPRINT_ERR(BLKVSC_DRV, "unable to add blkvsc device");
+ if (ret != 0)
goto Cleanup;
- }
blkdev->device_ctx = device_obj;
/* this identified the device 0 or 1 */
@@ -1040,7 +1039,6 @@ static int blkvsc_probe(struct device *device)
ide1_registered = 1;
}
} else {
- DPRINT_ERR(BLKVSC_DRV, "invalid pathid");
ret = -1;
goto Cleanup;
}
@@ -1049,7 +1047,6 @@ static int blkvsc_probe(struct device *device)
blkdev->gd = alloc_disk(BLKVSC_MINORS);
if (!blkdev->gd) {
- DPRINT_ERR(BLKVSC_DRV, "register_blkdev() failed! ret %d", ret);
ret = -1;
goto Cleanup;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 14/21] Staging: hv: Get rid of the code to manage removable media
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
The Hyper-V block driver does not handle removable media.
Get rid of the code to manage removable media.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 7974e6c..92614d5 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -437,8 +437,6 @@ static int blkvsc_do_operation(struct block_device_context *blkdev,
if (device_type == 0x0)
blkdev->device_type = HARDDISK_TYPE;
- else if (device_type == 0x5)
- blkdev->device_type = DVD_TYPE;
else
blkdev->device_type = UNKNOWN_DEV_TYPE;
@@ -1076,12 +1074,7 @@ static int blkvsc_probe(struct device *device)
sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum);
blkvsc_do_operation(blkdev, DO_INQUIRY);
- if (blkdev->device_type == DVD_TYPE) {
- set_disk_ro(blkdev->gd, 1);
- blkdev->gd->flags |= GENHD_FL_REMOVABLE;
- blkvsc_do_operation(blkdev, DO_CAPACITY);
- } else
- blkvsc_do_operation(blkdev, DO_CAPACITY);
+ blkvsc_do_operation(blkdev, DO_CAPACITY);
set_capacity(blkdev->gd, blkdev->capacity * (blkdev->sector_size/512));
blk_queue_logical_block_size(blkdev->gd->queue, blkdev->sector_size);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 13/21] Staging: hv: Cleanup storvsc_remove()
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
storvsc_remove() cannot fail, clean it up accordingly.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/storvsc_drv.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index ae61735..f819c6a 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -404,7 +404,6 @@ static int storvsc_probe(struct device *device)
*/
static int storvsc_remove(struct device *device)
{
- int ret;
struct hv_driver *drv =
drv_to_hv_drv(device->driver);
struct storvsc_driver_object *storvsc_drv_obj = drv->priv;
@@ -413,20 +412,11 @@ static int storvsc_remove(struct device *device)
struct host_device_context *host_device_ctx =
(struct host_device_context *)host->hostdata;
-
- if (!storvsc_drv_obj->base.dev_rm)
- return -1;
-
/*
* Call to the vsc driver to let it know that the device is being
* removed
*/
- ret = storvsc_drv_obj->base.dev_rm(device_obj);
- if (ret != 0) {
- /* TODO: */
- DPRINT_ERR(STORVSC, "unable to remove vsc device (ret %d)",
- ret);
- }
+ storvsc_drv_obj->base.dev_rm(device_obj);
if (host_device_ctx->request_pool) {
kmem_cache_destroy(host_device_ctx->request_pool);
@@ -438,7 +428,7 @@ static int storvsc_remove(struct device *device)
DPRINT_INFO(STORVSC, "releasing host adapter (%p)...", host);
scsi_host_put(host);
- return ret;
+ return 0;
}
/*
--
1.7.4.1
^ permalink raw reply related
* [PATCH 12/21] Staging: hv: Cleanup blkvsc_remove()
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
blkvsc_remove() cannot fail. Clean it up accordingly.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 58d4a2d..7974e6c 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -556,22 +556,12 @@ static int blkvsc_remove(struct device *device)
struct hv_device *device_obj = device_to_hv_device(device);
struct block_device_context *blkdev = dev_get_drvdata(device);
unsigned long flags;
- int ret;
-
-
- if (!storvsc_drv_obj->base.dev_rm)
- return -1;
/*
* Call to the vsc driver to let it know that the device is being
* removed
*/
- ret = storvsc_drv_obj->base.dev_rm(device_obj);
- if (ret != 0) {
- /* TODO: */
- DPRINT_ERR(BLKVSC_DRV,
- "unable to remove blkvsc device (ret %d)", ret);
- }
+ storvsc_drv_obj->base.dev_rm(device_obj);
/* Get to a known state */
spin_lock_irqsave(&blkdev->lock, flags);
@@ -604,7 +594,8 @@ static int blkvsc_remove(struct device *device)
kfree(blkdev);
- return ret;
+ return 0;
+
}
static void blkvsc_shutdown(struct device *device)
--
1.7.4.1
^ permalink raw reply related
* [PATCH 11/21] Staging: hv: Get rid of some DPRINT_DBG() calls
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
Get rid of some of the DPRINT_DBG() statements.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 84 ---------------------------------------
1 files changed, 0 insertions(+), 84 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 09633cc..58d4a2d 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -220,14 +220,6 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
struct vmscsi_request *vm_srb;
int ret;
- DPRINT_DBG(BLKVSC_DRV, "blkvsc_submit_request() - "
- "req %p type %s start_sector %lu count %ld offset %d "
- "len %d\n", blkvsc_req,
- (blkvsc_req->write) ? "WRITE" : "READ",
- (unsigned long) blkvsc_req->sector_start,
- blkvsc_req->sector_count,
- blkvsc_req->request.data_buffer.offset,
- blkvsc_req->request.data_buffer.len);
storvsc_req = &blkvsc_req->request;
vm_srb = &storvsc_req->vstor_packet.vm_srb;
@@ -261,8 +253,6 @@ static int blkvsc_open(struct block_device *bdev, fmode_t mode)
{
struct block_device_context *blkdev = bdev->bd_disk->private_data;
- DPRINT_DBG(BLKVSC_DRV, "- users %d disk %s\n", blkdev->users,
- blkdev->gd->disk_name);
mutex_lock(&blkvsc_mutex);
spin_lock(&blkdev->lock);
@@ -352,8 +342,6 @@ static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
struct scsi_sense_hdr sense_hdr;
struct vmscsi_request *vm_srb;
- DPRINT_DBG(BLKVSC_DRV, "blkvsc_cmd_completion() - req %p\n",
- blkvsc_req);
vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
blkdev->num_outstanding_reqs--;
@@ -496,7 +484,6 @@ static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev)
int ret = 0;
- DPRINT_DBG(BLKVSC_DRV, "blkvsc_cancel_pending_reqs()");
/* Flush the pending list first */
list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list,
@@ -509,11 +496,6 @@ static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev)
list_for_each_entry_safe(comp_req, tmp2,
&pend_req->group->blkvsc_req_list,
req_entry) {
- DPRINT_DBG(BLKVSC_DRV, "completing blkvsc_req %p "
- "sect_start %lu sect_count %ld\n",
- comp_req,
- (unsigned long) comp_req->sector_start,
- comp_req->sector_count);
if (comp_req == pend_req)
break;
@@ -537,9 +519,6 @@ static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev)
kmem_cache_free(blkdev->request_pool, comp_req);
}
- DPRINT_DBG(BLKVSC_DRV, "cancelling pending request - %p\n",
- pend_req);
-
list_del(&pend_req->pend_entry);
list_del(&pend_req->req_entry);
@@ -552,9 +531,6 @@ static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev)
* All the sectors have been xferred ie the
* request is done
*/
- DPRINT_DBG(BLKVSC_DRV,
- "blkvsc_cancel_pending_reqs() - "
- "req %p COMPLETED\n", pend_req->req);
kmem_cache_free(blkdev->request_pool,
pend_req->group);
}
@@ -582,7 +558,6 @@ static int blkvsc_remove(struct device *device)
unsigned long flags;
int ret;
- DPRINT_DBG(BLKVSC_DRV, "blkvsc_remove()\n");
if (!storvsc_drv_obj->base.dev_rm)
return -1;
@@ -640,9 +615,6 @@ static void blkvsc_shutdown(struct device *device)
if (!blkdev)
return;
- DPRINT_DBG(BLKVSC_DRV, "blkvsc_shutdown - users %d disk %s\n",
- blkdev->users, blkdev->gd->disk_name);
-
spin_lock_irqsave(&blkdev->lock, flags);
blkdev->shutting_down = 1;
@@ -670,9 +642,6 @@ static int blkvsc_release(struct gendisk *disk, fmode_t mode)
{
struct block_device_context *blkdev = disk->private_data;
- DPRINT_DBG(BLKVSC_DRV, "- users %d disk %s\n", blkdev->users,
- blkdev->gd->disk_name);
-
mutex_lock(&blkvsc_mutex);
spin_lock(&blkdev->lock);
if (blkdev->users == 1) {
@@ -710,9 +679,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
int pending = 0;
struct blkvsc_request_group *group = NULL;
- DPRINT_DBG(BLKVSC_DRV, "blkdev %p req %p sect %lu\n", blkdev, req,
- (unsigned long)blk_rq_pos(req));
-
/* Create a group to tie req to list of blkvsc_reqs */
group = kmem_cache_zalloc(blkdev->request_pool, GFP_ATOMIC);
if (!group)
@@ -730,11 +696,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
* Map this bio into an existing or new storvsc request
*/
bio_for_each_segment(bvec, bio, seg_idx) {
- DPRINT_DBG(BLKVSC_DRV, "bio_for_each_segment() "
- "- req %p bio %p bvec %p seg_idx %d "
- "databuf_idx %d\n", req, bio, bvec,
- seg_idx, databuf_idx);
-
/* Get a new storvsc request */
/* 1st-time */
if ((!blkvsc_req) ||
@@ -827,10 +788,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
/* Handle the last one */
if (blkvsc_req) {
- DPRINT_DBG(BLKVSC_DRV, "blkdev %p req %p group %p count %d\n",
- blkdev, req, blkvsc_req->group,
- blkvsc_req->group->outstanding);
-
blkvsc_req->sector_start = start_sector;
sector_div(blkvsc_req->sector_start,
(blkdev->sector_size >> 9));
@@ -843,13 +800,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
list_for_each_entry(blkvsc_req, &group->blkvsc_req_list, req_entry) {
if (pending) {
- DPRINT_DBG(BLKVSC_DRV, "adding blkvsc_req to "
- "pending_list - blkvsc_req %p start_sect %lu"
- " sect_count %ld (%lu %ld)\n", blkvsc_req,
- (unsigned long)blkvsc_req->sector_start,
- blkvsc_req->sector_count,
- (unsigned long)start_sector,
- (unsigned long)num_sectors);
list_add_tail(&blkvsc_req->pend_entry,
&blkdev->pending_list);
@@ -862,13 +812,6 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
&blkdev->pending_list);
}
- DPRINT_DBG(BLKVSC_DRV, "submitted blkvsc_req %p "
- "start_sect %lu sect_count %ld (%lu %ld) "
- "ret %d\n", blkvsc_req,
- (unsigned long)blkvsc_req->sector_start,
- blkvsc_req->sector_count,
- (unsigned long)start_sector,
- num_sectors, ret);
}
}
@@ -883,8 +826,6 @@ static int blkvsc_do_pending_reqs(struct block_device_context *blkdev)
/* Flush the pending list first */
list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list,
pend_entry) {
- DPRINT_DBG(BLKVSC_DRV, "working off pending_list - %p\n",
- pend_req);
ret = blkvsc_submit_request(pend_req,
blkvsc_request_completion);
@@ -904,9 +845,7 @@ static void blkvsc_request(struct request_queue *queue)
struct request *req;
int ret = 0;
- DPRINT_DBG(BLKVSC_DRV, "- enter\n");
while ((req = blk_peek_request(queue)) != NULL) {
- DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req);
blkdev = req->rq_disk->private_data;
if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS) {
@@ -917,8 +856,6 @@ static void blkvsc_request(struct request_queue *queue)
ret = blkvsc_do_pending_reqs(blkdev);
if (ret != 0) {
- DPRINT_DBG(BLKVSC_DRV,
- "- stop queue - pending_list not empty\n");
blk_stop_queue(queue);
break;
}
@@ -927,11 +864,9 @@ static void blkvsc_request(struct request_queue *queue)
ret = blkvsc_do_request(blkdev, req);
if (ret > 0) {
- DPRINT_DBG(BLKVSC_DRV, "- stop queue - no room\n");
blk_stop_queue(queue);
break;
} else if (ret < 0) {
- DPRINT_DBG(BLKVSC_DRV, "- stop queue - no mem\n");
blk_requeue_request(queue, req);
blk_stop_queue(queue);
break;
@@ -1041,7 +976,6 @@ static int blkvsc_probe(struct device *device)
static int ide0_registered;
static int ide1_registered;
- DPRINT_DBG(BLKVSC_DRV, "blkvsc_probe - enter");
if (!storvsc_drv_obj->base.dev_add) {
DPRINT_ERR(BLKVSC_DRV, "OnDeviceAdd() not set");
@@ -1196,17 +1130,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request)
struct vmscsi_request *vm_srb;
- DPRINT_DBG(BLKVSC_DRV, "blkdev %p blkvsc_req %p group %p type %s "
- "sect_start %lu sect_count %ld len %d group outstd %d "
- "total outstd %d\n",
- blkdev, blkvsc_req, blkvsc_req->group,
- (blkvsc_req->write) ? "WRITE" : "READ",
- (unsigned long)blkvsc_req->sector_start,
- blkvsc_req->sector_count,
- blkvsc_req->request.data_buffer.len,
- blkvsc_req->group->outstanding,
- blkdev->num_outstanding_reqs);
-
spin_lock_irqsave(&blkdev->lock, flags);
blkdev->num_outstanding_reqs--;
@@ -1221,11 +1144,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request)
list_for_each_entry_safe(comp_req, tmp,
&blkvsc_req->group->blkvsc_req_list,
req_entry) {
- DPRINT_DBG(BLKVSC_DRV, "completing blkvsc_req %p "
- "sect_start %lu sect_count %ld\n",
- comp_req,
- (unsigned long)comp_req->sector_start,
- comp_req->sector_count);
list_del(&comp_req->req_entry);
@@ -1238,8 +1156,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request)
* All the sectors have been xferred ie the
* request is done
*/
- DPRINT_DBG(BLKVSC_DRV, "req %p COMPLETED\n",
- comp_req->req);
kmem_cache_free(blkdev->request_pool,
comp_req->group);
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 10/21] Staging: hv: Get rid of some DPRINT_INFO() statements
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization
Cc: K. Y. Srinivasan, Haiyang Zhang, Hank Janssen
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
Get rid of some of the DPRINT_INFO() statements.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 5cf82f0..09633cc 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -331,7 +331,6 @@ static int blkvsc_ioctl(struct block_device *bd, fmode_t mode,
switch (cmd) {
case HDIO_GET_IDENTITY:
- DPRINT_INFO(BLKVSC_DRV, "HDIO_GET_IDENTITY\n");
if (copy_to_user((void __user *)arg, blkdev->device_id,
blkdev->device_id_len))
ret = -EFAULT;
@@ -1264,8 +1263,6 @@ static int __init blkvsc_init(void)
BUILD_BUG_ON(sizeof(sector_t) != 8);
- DPRINT_INFO(BLKVSC_DRV, "Blkvsc initializing....");
-
ret = blkvsc_drv_init();
return ret;
--
1.7.4.1
^ permalink raw reply related
* [PATCH 9/21] Staging: hv: Simplify blkvsc_init_rw()
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
Simplyfify blkvsc_init_rw() by using a single scsi command independent of
the start sector.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 58 +++++++++------------------------------
1 files changed, 13 insertions(+), 45 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index b2cd04a..5cf82f0 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -305,53 +305,21 @@ static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req)
blkvsc_req->cmd_len = 16;
- if (blkvsc_req->sector_start > 0xffffffff) {
- if (rq_data_dir(blkvsc_req->req)) {
- blkvsc_req->write = 1;
- blkvsc_req->cmnd[0] = WRITE_16;
- } else {
- blkvsc_req->write = 0;
- blkvsc_req->cmnd[0] = READ_16;
- }
-
- blkvsc_req->cmnd[1] |=
- (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;
-
- *(unsigned long long *)&blkvsc_req->cmnd[2] =
- cpu_to_be64(blkvsc_req->sector_start);
- *(unsigned int *)&blkvsc_req->cmnd[10] =
- cpu_to_be32(blkvsc_req->sector_count);
- } else if ((blkvsc_req->sector_count > 0xff) ||
- (blkvsc_req->sector_start > 0x1fffff)) {
- if (rq_data_dir(blkvsc_req->req)) {
- blkvsc_req->write = 1;
- blkvsc_req->cmnd[0] = WRITE_10;
- } else {
- blkvsc_req->write = 0;
- blkvsc_req->cmnd[0] = READ_10;
- }
-
- blkvsc_req->cmnd[1] |=
- (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;
-
- *(unsigned int *)&blkvsc_req->cmnd[2] =
- cpu_to_be32(blkvsc_req->sector_start);
- *(unsigned short *)&blkvsc_req->cmnd[7] =
- cpu_to_be16(blkvsc_req->sector_count);
+ if (rq_data_dir(blkvsc_req->req)) {
+ blkvsc_req->write = 1;
+ blkvsc_req->cmnd[0] = WRITE_16;
} else {
- if (rq_data_dir(blkvsc_req->req)) {
- blkvsc_req->write = 1;
- blkvsc_req->cmnd[0] = WRITE_6;
- } else {
- blkvsc_req->write = 0;
- blkvsc_req->cmnd[0] = READ_6;
- }
-
- *(unsigned int *)&blkvsc_req->cmnd[1] =
- cpu_to_be32(blkvsc_req->sector_start) >> 8;
- blkvsc_req->cmnd[1] &= 0x1f;
- blkvsc_req->cmnd[4] = (unsigned char)blkvsc_req->sector_count;
+ blkvsc_req->write = 0;
+ blkvsc_req->cmnd[0] = READ_16;
}
+
+ blkvsc_req->cmnd[1] |=
+ (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;
+
+ *(unsigned long long *)&blkvsc_req->cmnd[2] =
+ cpu_to_be64(blkvsc_req->sector_start);
+ *(unsigned int *)&blkvsc_req->cmnd[10] =
+ cpu_to_be32(blkvsc_req->sector_count);
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH 08/21] Staging: hv: Get rid of the function blkvsc_revalidate_disk()
From: K. Y. Srinivasan @ 2011-04-22 21:55 UTC (permalink / raw)
To: gregkh, linux-kernel, devel, virtualization; +Cc: Haiyang Zhang
In-Reply-To: <1303509326-3094-1-git-send-email-kys@microsoft.com>
The block driver in Hyper-V does not support removable media, get rid of the
blkvsc_revalidate_disk().
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
---
drivers/staging/hv/blkvsc_drv.c | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 4c248b7..b2cd04a 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -722,22 +722,6 @@ static int blkvsc_release(struct gendisk *disk, fmode_t mode)
}
-static int blkvsc_revalidate_disk(struct gendisk *gd)
-{
- struct block_device_context *blkdev = gd->private_data;
-
- DPRINT_DBG(BLKVSC_DRV, "- enter\n");
-
- if (blkdev->device_type == DVD_TYPE) {
- blkvsc_do_operation(blkdev, DO_CAPACITY);
- set_capacity(blkdev->gd, blkdev->capacity *
- (blkdev->sector_size/512));
- blk_queue_logical_block_size(gd->queue, blkdev->sector_size);
- }
- return 0;
-}
-
-
/*
* We break the request into 1 or more blkvsc_requests and submit
* them. If we cant submit them all, we put them on the
@@ -997,7 +981,6 @@ static const struct block_device_operations block_ops = {
.owner = THIS_MODULE,
.open = blkvsc_open,
.release = blkvsc_release,
- .revalidate_disk = blkvsc_revalidate_disk,
.getgeo = blkvsc_getgeo,
.ioctl = blkvsc_ioctl,
};
--
1.7.4.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox