From: Artem Bityutskiy <dedekind1@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>,
Kevin Cernekee <cernekee@gmail.com>,
b35362@freescale.com, linux-mtd@lists.infradead.org,
David Woodhouse <dwmw2@infradead.org>,
Matthew Creech <mlcreech@gmail.com>
Subject: Re: [RFC 5/5] mtd: add MEMWRITEDATAOOB ioctl
Date: Tue, 23 Aug 2011 09:11:15 +0300 [thread overview]
Message-ID: <1314079881.2645.60.camel@sauron> (raw)
In-Reply-To: <CAN8TOE9kZa5g9baQ63ojUYK7uqrwA9GEf_6oYz1S-kacZRq+5Q@mail.gmail.com>
On Mon, 2011-08-22 at 17:04 -0700, Brian Norris wrote:
> On Mon, Aug 22, 2011 at 1:56 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Wed, 2011-08-17 at 16:50 -0700, Brian Norris wrote:
> >> + ops.datbuf = memdup_user(
> >> + (void __user *)(uintptr_t)buf.usr_ptr,
> >> + ops.len + ops.ooblen);
> >
> > I'd introduced a local variable for buf.usr_ptr and made the formatting
> > nicer.
>
> Sure. Will incorporate into v2.
>
> >> +struct mtd_data_oob_buf {
> >
> > Let's add some reserved space for future improvements - I think it is
> > always a good idea to do for ioctls:
> >
> > + __u8 padding[8]
>
> OK. Will consider for v2.
>
> >> +#define MEMWRITEDATAOOB _IOWR('M', 24, struct mtd_data_oob_buf)
> >
> > Would be greate to add a short comment about what this ioctl does. Of
> > course you can optionally do this for all of them, but at least for the
> > new one it does not hurt to have.
>
> Sure, will do. I'll probably add at least a few comments in the header
> for all the relevant ioctls we've been discussing, but that'll wait
> until we've finished the code.
>
> BTW, I'm considering splitting the usr_ptr into separate buffers for
> data and oob. This will probably be a little easier for the user
> interface as well as for internal kernel operations. Anyway, the
> resulting struct is looking more and more like the existing `struct
> mtd_oob_ops' (this is kind of by design); is it still a good idea to
> keep the user-facing struct independent of the internal mtd_oob_ops
> struct? I'm thinking it would leave some flexibility for the future.
BTW, being consistent and adding an "_user" or "_req" (request) or other
suffix to all the ioctl request structures is a good idea. But this is
again IMHO, and some people may consider this to be too pedantic.
Anyway, for UBI ioctls all the structures end with "_req", you can see
the example: include/mtd/ubi-user.h
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2011-08-23 6:09 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 23:50 [RFC 0/5] fix data+OOB writes, add ioctl Brian Norris
2011-08-17 23:50 ` [RFC 1/5] mtd: support MTD_MODE_RAW for writing OOB Brian Norris
2011-08-22 8:35 ` Artem Bityutskiy
2011-08-22 20:08 ` Brian Norris
2011-08-23 4:47 ` Artem Bityutskiy
2011-08-23 5:25 ` Jason Liu
2011-08-23 19:57 ` Brian Norris
2011-08-17 23:50 ` [RFC 2/5] mtd: support MTD_MODE_RAW for reading OOB Brian Norris
2011-08-22 8:38 ` Artem Bityutskiy
2011-08-17 23:50 ` [RFC 3/5] mtd: do not assume oobsize is power of 2 Brian Norris
2011-08-22 8:46 ` Artem Bityutskiy
2011-08-22 20:21 ` Brian Norris
2011-08-17 23:50 ` [RFC 4/5] mtd: move mtd_oob_mode_t to shared kernel/user space Brian Norris
2011-08-22 8:50 ` Artem Bityutskiy
2011-08-22 21:43 ` Brian Norris
2011-08-23 5:30 ` Artem Bityutskiy
2011-08-23 17:24 ` Brian Norris
2011-08-17 23:50 ` [RFC 5/5] mtd: add MEMWRITEDATAOOB ioctl Brian Norris
2011-08-22 8:56 ` Artem Bityutskiy
2011-08-23 0:04 ` Brian Norris
2011-08-23 6:05 ` Artem Bityutskiy
2011-08-23 6:06 ` Artem Bityutskiy
2011-08-23 6:11 ` Artem Bityutskiy [this message]
2011-08-22 10:02 ` [RFC 0/5] fix data+OOB writes, add ioctl Artem Bityutskiy
2011-08-22 12:04 ` Ivan Djelic
2011-08-22 12:16 ` Artem Bityutskiy
2011-08-23 6:48 ` Ricard Wanderlof
2011-08-23 16:47 ` Brian Norris
2011-08-24 15:36 ` Ricard Wanderlof
2011-08-24 18:01 ` Brian Norris
2011-08-25 7:21 ` Artem Bityutskiy
2011-08-25 9:33 ` Ricard Wanderlof
2011-08-25 17:54 ` Brian Norris
2011-08-26 12:41 ` Ricard Wanderlof
2011-08-22 23:42 ` Brian Norris
2011-08-23 6:01 ` Artem Bityutskiy
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=1314079881.2645.60.camel@sauron \
--to=dedekind1@gmail.com \
--cc=b35362@freescale.com \
--cc=cernekee@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mlcreech@gmail.com \
--cc=vapier.adi@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.