From: Jan Kara <jack@suse.cz>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jan Kara <jack@suse.cz>, LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Allow setting of number of raw devices as a module parameter
Date: Mon, 2 May 2011 23:11:41 +0200 [thread overview]
Message-ID: <20110502211141.GA14889@quack.suse.cz> (raw)
In-Reply-To: <201105022144.31612.arnd@arndb.de>
On Mon 02-05-11 21:44:31, Arnd Bergmann wrote:
> On Monday 02 May 2011, Jan Kara wrote:
> > On Sat 30-04-11 14:15:02, Arnd Bergmann wrote:
> > > On Friday 29 April 2011 00:24:29 Jan Kara wrote:
> > > > Allow setting of maximal number of raw devices as a module parameter. This
> > > > requires changing of static array into a vmalloced one (the array is going to
> > > > be too large for kmalloc).
> > > >
> > > > Signed-off-by: Jan Kara <jack@suse.cz>
> > >
> > > Why don't you get rid of the global raw_devices array instead?
> > >
> > > I suppose if you embed the struct cdev in raw_device_data and
> > > register it during RAW_SETBIND separately for each raw device
> > > instead of globally at raw_init time, you can support any number
> > > of devices while making the code smaller and simpler. I suppose
> > > you can even remove the raw_mutex then.
> > OK, I see. This might be a reasonable option. I'd then use kobj_lookup()
> > to find my structure where I need it instead of array indexing, right?
> > I have really zero experience with writing device drivers so I'm asking
> > simple questions :).
>
> The character device layer uses kobj_lookup internally when opening
> the device. When you are inside the driver, you can access it through
> file->f_path.dentry->d_inode->i_cdev, from where you go to your own data
> structure using container_of.
OK, but if I don't have the inode of the character device (like in
RAW_GETBIND case)?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-05-02 21:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 22:24 Jan Kara
2011-04-29 23:19 ` Greg KH
2011-04-29 23:28 ` Andrew Morton
2011-04-30 0:07 ` Greg KH
2011-04-30 5:09 ` Dave Jones
2011-04-30 5:42 ` Greg KH
2011-04-30 10:29 ` Alan Cox
2011-04-30 15:34 ` Greg KH
2011-04-30 15:41 ` Alan Cox
2011-04-30 15:47 ` Greg KH
2011-05-02 19:22 ` Jan Kara
2011-05-03 9:42 ` Alan Cox
2011-04-30 12:15 ` Arnd Bergmann
2011-05-02 19:39 ` Jan Kara
2011-05-02 19:44 ` Arnd Bergmann
2011-05-02 21:11 ` Jan Kara [this message]
2011-05-03 10:55 ` Arnd Bergmann
2011-05-03 16:26 ` Jan Kara
2011-05-03 17:30 ` Arnd Bergmann
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=20110502211141.GA14889@quack.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome