mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ulrich Drepper" <drepper@gmail.com>
To: "Davide Libenzi" <davidel@xmailserver.org>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Ingo Molnar" <mingo@elte.hu>
Subject: Re: [patch 3/6] sys_indirect RFC - sys_indirect core
Date: Fri, 29 Jun 2007 18:55:18 -0700	[thread overview]
Message-ID: <a36005b50706291855j4069e4d0j73c006e9bf180b42@mail.gmail.com> (raw)
In-Reply-To: <send-serie.davidel@xmailserver.org.28360.1183153736.3>

On 6/29/07, Davide Libenzi <davidel@xmailserver.org> wrote:
> +int indirect_set_context(struct fsa_context *ator,
> +                        const struct indirect_ctx __user * __user *ctxs,
> +                        unsigned int nctxs, struct indirect_op **first)
> +{
> +       unsigned int i;
> +       int error;
> +       u32 ctx;
> +       const struct indirect_ctx __user *pctx;
> +       struct indirect_op *new;
> +
> +       *first = NULL;
> +       for (i = 0; i < nctxs; i++) {
> +               if (get_user(pctx, &ctxs[i]) || get_user(ctx, &pctx->ctx))
> +                       return -EFAULT;
> +               if (unlikely(ctx >= ARRAY_SIZE(inprocs) || !inprocs[ctx].set))
> +                       return -EINVAL;
> +               error = (*inprocs[ctx].set)(ator, pctx, &new);
> +               if (unlikely(error))
> +                       return error;
> +               new->next = *first;
> +               *first = new;
> +       }

If you use one single struct as explained in my last mail all this
shouldn't be necessary.  The sys_indirect syscall would simply points
current->ind_ctx to a kernel-copy of the struct.  Then call the
syscall and on return clear current->ind_ctx.

In the affected syscalls we can then test whether current->ind_ctx is
NULL and if not, enable the extra functionality.

These callbacks etc seem to be far too expensive and complicated.

      reply	other threads:[~2007-06-30  1:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 21:48 Davide Libenzi
2007-06-30  1:55 ` Ulrich Drepper [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=a36005b50706291855j4069e4d0j73c006e9bf180b42@mail.gmail.com \
    --to=drepper@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®