From: kuebelr@email.uc.edu
To: Kristian Peters <kristian.peters@korseby.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH] cdrom per drive sysctl's
Date: Tue, 20 Aug 2002 07:59:42 -0400 [thread overview]
Message-ID: <20020820115942.GA27724@cartman> (raw)
In-Reply-To: <20020820093539.5b8fef35.kristian.peters@korseby.net>
On Tue, Aug 20, 2002 at 09:35:39AM +0200, Kristian Peters wrote:
...
> > + /* copy the default settings for the new drive */
> > + memcpy(cst, &cdrom_table, sizeof(struct cdrom_sysctl_table));
>
> Hm. I don't understand this. Why are you applying the default settings to a new entry hence they're overwritten later ?
>
> > + cst->options_table[0].data = &cst->options.autoclose;
> > + cst->options_table[1].data = &cst->options.autoeject;
> > + cst->options_table[2].data = &cst->options.debug;
> > + cst->options_table[3].data = &cst->options.lock;
> > + cst->options_table[4].data = &cst->options.check_media;
> > + cst->options_table[5].procname = "info";
> > + cst->options_table[5].extra1 = cdi;
> > + cst->drive_table[0].child = cst->options_table;
> > + cst->drive_table[0].procname = cdi->name;
> > + cst->drive_table[0].ctl_name = kdev_t_to_nr(cdi->dev);
> > + cst->cdrom_table[0].child = cst->drive_table;
> > + cst->dev_table[0].child = cst->cdrom_table;
> > +
...
the values of the default settings are copied w/ memcpy(), but the new
structure has to point to its own settings (so changing sr0/debug
changes sr0's data not the default settings). that is why i manipulate
the pointers later.
rob.
prev parent reply other threads:[~2002-08-20 11:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-19 20:09 [RFC] [PATCH] cdrom per drive sysctl's kuebelr
2002-08-20 7:35 ` Kristian Peters
2002-08-20 11:59 ` kuebelr [this message]
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=20020820115942.GA27724@cartman \
--to=kuebelr@email.uc.edu \
--cc=kristian.peters@korseby.net \
--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