LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Nathaniel Yazdani <n1ght.4nd.d4y@gmail.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH for-next 1/4] epoll: struct epoll userspace definiton
Date: Tue, 25 Feb 2014 16:13:38 -0800
Message-ID: <1393373618.2886.26.camel@linux-whg8.site> (raw)
In-Reply-To: <20140225101527.GA9963@dcvr.yhbt.net>

On Tue, 2014-02-25 at 10:15 +0000, Eric Wong wrote:
> (Did you intend to Cc LKML on your original reply?)
> 
> Nathaniel Yazdani <n1ght.4nd.d4y@gmail.com> wrote:
> > On Sun, Feb 23, 2014 at 9:29 PM, Eric Wong <normalperson@yhbt.net> wrote:
> > > Nathaniel Yazdani <n1ght.4nd.d4y@gmail.com> wrote:
> > >> +++ b/include/uapi/linux/eventpoll.h
> > >> @@ -61,6 +61,12 @@ struct epoll_event {
> > >>       __u64 data;
> > >>  } EPOLL_PACKED;
> > >>
> > >> +struct epoll {
> > >> +     int ep_fildes; /* file descriptor */
> > >> +     int ep_events; /* triggering events */
> > >> +     long long ep_ident; /* entry ID (cf. epoll_event->data) */
> > >> +} EPOLL_PACKED;
> > >
> > > Why not reuse the existing epoll_event struct?
> > >
> > >         struct epoll {
> > >                 int ep_fildes; /* file descriptor */
> > >                 struct epoll_event event;
> > >         } EPOLL_PACKED;
> > 
> > Well my first instinct was that doing it like that would be too messy,
> > but now that you mention it that'd probably be a much better
> > approach. In fact we could even do something like:
> > 
> > struct epoll {
> >         int ep_fildes; /* file descriptor */
> >         union {
> >                 struct epoll_event event;
> >                 struct {
> >                         int ep_events;
> >                         long long ep_ident;
> >                 } EPOLL_PACKED;
> >         };
> > } EPOLL_PACKED;
> > 
> > In order to keep things looking spiffy while also easing migration
> > from the old struct :)
> 
> I think you miss the point of my question.  What is the point of
> changing:
> 
> 	event.events => ep_events
> 	event.data   => ep_ident
> 
> in the first place?

Whoops, my bad, still haven't gotten my email client totally figured
out. I'll CC this back the mailing list so everyone else can follow
along.

My intent was just to give the struct a more Unix-like style (so
to speak), because when I started, it looked like entirely
different code paths would be needed for this sort of functionality.
Thankfully that wasn't the case, but still a new struct was
necessary. All that to say I don't have an issue embedding an
epoll_event over defining the fields directly, but I'd just
prefer not to.


  parent reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24  1:42 [RFC PATCH for-next 0/4] epoll: combined control/wait syscall Nathaniel Yazdani
2014-02-24  1:42 ` [RFC PATCH for-next 1/4] epoll: struct epoll userspace definiton Nathaniel Yazdani
2014-02-24  5:29   ` Eric Wong
     [not found]     ` <CAJ3m7Bq1y+MLn=HFY3AADnVc2HK31+WANahiYLUcdBw=hh_2pg@mail.gmail.com>
     [not found]       ` <20140225101527.GA9963@dcvr.yhbt.net>
2014-02-26  0:13         ` Nathaniel Yazdani [this message]
2014-02-24  1:42 ` [RFC PATCH for-next 2/4] epoll: epoll() syscall declaration Nathaniel Yazdani
2014-02-24  5:32   ` Eric Wong
2014-02-24  5:44     ` Nathaniel Yazdani
2014-02-25 10:30       ` Eric Wong
2014-02-25 23:44         ` Nathaniel Yazdani
2014-02-24  1:42 ` [RFC PATCH for-next 3/4] epoll: struct epoll support Nathaniel Yazdani
2014-02-24 18:59   ` Jonathan Corbet
2014-02-24 19:24     ` Nathaniel Yazdani
2014-02-24  1:42 ` [RFC PATCH for-next 4/4] epoll: epoll() syscall definition Nathaniel Yazdani
2014-02-25 10:21   ` Eric Wong
2014-02-25 23:46     ` Nathaniel Yazdani

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=1393373618.2886.26.camel@linux-whg8.site \
    --to=n1ght.4nd.d4y@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git