From: "Jan Beulich" <JBeulich@novell.com>
To: Daniel Stodden <daniel.stodden@citrix.com>,
Laszlo Ersek <lersek@redhat.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH linux-2.6.18-xen] blktap: make max # of tap devices a module parameter
Date: Wed, 23 Feb 2011 10:38:07 +0000 [thread overview]
Message-ID: <4D64F19F0200007800033455@vpn.id2.novell.com> (raw)
In-Reply-To: <1298396687.27394.10.camel@agari.van.xensource.com>
>>> On 22.02.11 at 18:44, Daniel Stodden <daniel.stodden@citrix.com> wrote:
> On Tue, 2011-02-22 at 12:34 -0500, Laszlo Ersek wrote:
>> On 02/22/11 16:49, Jan Beulich wrote:
>> >>>> On 22.02.11 at 15:20, Laszlo Ersek<lersek@redhat.com> wrote:
>> >> Hi,
>> >>
>> >> should anybody still use the blktap(1) driver in linux-2.6.18-xen, the
>> >> following patch intends to make the maximum number of tapdevs
>> >> configurable at module insertion time. The number is clamped to [256 ..
>> >> NR_EVENT_CHANNELS]. I removed the definition of MAX_DEV_NAME because it
>> >> didn't seem to be used at all.
>> >>
>> >> Thanks for considering,
>> >> Laszlo Ersek
>> >
>> > Without replacing the call to register_chrdev() with one to
>> > __register_chrdev() (available only with 2.6.32 and newer) I
>> > can't see how you would get beyond 256 devices with the
>> > changes you propose.
>>
>> Oops, sorry; I naively assumed that minor device numbers were already
>> covered by an earlier change.
>>
>> I figure register_chrdev() could be reimplemented in blktap, based on
>> lower-level char_dev.c (and kobject) primitives, but I'm not sure if the
>> original goal is worth that ugliness. In any case, should I bother
>> posting a version like that eventually, or would it have no chance of
>> being accepted?
>
> I'm pretty sure minors > 256 date way before 2.6.32. Here's the module
> init fragment from blktap2, replacing the register_chrdev() call:
Sure, just that you have do more things "manually".
> int __init
> blktap_ring_init(void)
> {
> dev_t dev = 0;
> int err;
>
> cdev_init(&blktap_ring_cdev, &blktap_ring_file_operations);
> blktap_ring_cdev.owner = THIS_MODULE;
>
> err = alloc_chrdev_region(&dev, 0, MAX_BLKTAP_DEVICE, "blktap2");
> if (err < 0) {
> BTERR("error registering ring devices: %d\n", err);
> return err;
> }
>
> err = cdev_add(&blktap_ring_cdev, dev, MAX_BLKTAP_DEVICE);
> if (err) {
> BTERR("error adding ring device: %d\n", err);
> unregister_chrdev_region(dev, MAX_BLKTAP_DEVICE);
> return err;
> }
>
> blktap_ring_major = MAJOR(dev);
> BTINFO("blktap ring major: %d\n", blktap_ring_major);
>
> return 0;
> }
Any reason why in .32 and newer you still don't use
__register_chrdev() (and __unregister_chrdev())? And even
if this still needs to be this way, I note that unregister_chrdev()
calls __unregister_chrdev_region() before cdev_del(), while
blktap_ring_exit() does it the other way around?
Jan
next prev parent reply other threads:[~2011-02-23 10:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 14:20 [PATCH linux-2.6.18-xen] blktap: make max # of tap devices a module parameter Laszlo Ersek
2011-02-22 15:49 ` Jan Beulich
2011-02-22 17:34 ` Laszlo Ersek
2011-02-22 17:44 ` Daniel Stodden
2011-02-22 18:08 ` Laszlo Ersek
2011-02-22 18:59 ` Daniel Stodden
2011-02-23 10:38 ` Jan Beulich [this message]
2011-02-24 16:40 ` Jan Beulich
2011-02-24 19:59 ` Daniel Stodden
2011-02-24 20:10 ` Daniel Stodden
2011-02-23 9:42 ` Jan Beulich
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=4D64F19F0200007800033455@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=daniel.stodden@citrix.com \
--cc=lersek@redhat.com \
--cc=xen-devel@lists.xensource.com \
/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).