Steven Rostedt
2006-Sep-27 16:16 UTC
[Xen-devel] [PATCH 0/2] clean up blktap and change to use a dynamic major
The following two patches are to clean up blktap.c and to make it use a dynamic major instead of a hardcoded one. The first patch does two things: 1. cleans up the style to be more compatible with the Linux Style 2. gets rid of the private data structure used in filp->private_data The private data structure only has one item and that is the idx (index into the tapfds descriptors). This is allocated on open of the device and freed on close. The idx element always is the same as the minor number. Instead of using this (which would not be accepted into the kernel), I got rid of the private structure completely and instead I have filp->private_data point to the descriptor itself. This cleans up the code a bit. The second patch changes the blktap to use a dynamic major. Instead of a hardcoded 254, the number is dynamic, and the blktapctrl now reads /proc/devices to find the number to use to create the node. NOTE: Currently and after this patch, the blktapctrl daemon creates the device node. This is not the way Linux should work, and this needs to be done by udev. That update should be next (after I learn how udev works :) -- Steve _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Steven Rostedt
2006-Sep-27 16:19 UTC
[Xen-devel] [PATCH 1/2] clean up blktap and remove private structure
This patch cleans up the blktap.c code to make it form to the Linux coding style a little better. It also removes the private data structure that is only used to store the index of the tabfds descriptor. Instead the filp->private_data now points to the descriptor itself. -- Steve Signed-off-by: Steven Rostedt <srostedt@redhat.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Steven Rostedt
2006-Sep-27 16:21 UTC
[Xen-devel] [PATCH 2/2] have blktap use a dynamic major
blktap currently uses a hardcoded major of 254 for the device. This is not robust in anyway and needs to be dynamic. Note: it is better not to have the daemon create the node, and have udev create it instead. But since the daemon currently creates the node anyway, it is still the way this is done. That change needs to be made at another time. -- Steve Signed-off-by: Steven Rostedt <srostedt@redhat.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Andrew Warfield
2006-Sep-28 19:05 UTC
[Xen-devel] Re: [PATCH 1/2] clean up blktap and remove private structure
Applied, thank you. Great clean-up. a. On 9/27/06, Steven Rostedt <srostedt@redhat.com> wrote:> This patch cleans up the blktap.c code to make it form to the Linux > coding style a little better. > > It also removes the private data structure that is only used to store > the index of the tabfds descriptor. Instead the filp->private_data now > points to the descriptor itself. > > -- Steve > > Signed-off-by: Steven Rostedt <srostedt@redhat.com> > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Andrew Warfield
2006-Sep-28 19:48 UTC
[Xen-devel] Re: [PATCH 2/2] have blktap use a dynamic major
Applied, thank you. On 9/27/06, Steven Rostedt <srostedt@redhat.com> wrote:> blktap currently uses a hardcoded major of 254 for the device. This is > not robust in anyway and needs to be dynamic. > > Note: it is better not to have the daemon create the node, and have udev > create it instead. But since the daemon currently creates the node > anyway, it is still the way this is done. That change needs to be made > at another time. > > -- Steve > > Signed-off-by: Steven Rostedt <srostedt@redhat.com> > > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel