mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: try_then_request_module
Date: Mon, 19 May 2003 11:08:32 +0200	[thread overview]
Message-ID: <20030519110832.G626@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <20030519014233.5BF032C08C@lists.samba.org>; from rusty@rustcorp.com.au on Mon, May 19, 2003 at 11:41:20AM +1000

Hi Rusty,
hi LKML,

On Mon, May 19, 2003 at 11:41:20AM +1000, Rusty Russell wrote:
> If someone is feeling eager, many callers could change to
> try_then_request_module(), eg:

[search || request_module]

Many implementation do this with a search and retry the search 
(if clever with a goto and a flag variable to save kernel size)
after module loading.

All that implemented in the search routine, which you have to
supply anyway.

So try_then_request_module() will consolidate the the
branch or in the worst case just duplicating that code
everywhere (depends on wether you implement it as a non-inline
function or define).

Usally this is all as simple as:

   int module_loaded_flag=0;
retry_with_module_loaded:
   
   /* search code */
   
   if (!module_loaded_flag && !found) {
      module_loaded_flag=1;
      if (!request_module(bla))
         goto retry_with_module_loaded;
   }
   return found;


which is very space effecient and also still readable.

Regards

Ingo Oeser

  reply	other threads:[~2003-05-19 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-19  1:41 try_then_request_module Rusty Russell
2003-05-19  9:08 ` Ingo Oeser [this message]
2003-05-19 18:50   ` try_then_request_module Riley Williams
2003-05-20  7:39     ` try_then_request_module Ingo Oeser
2003-05-21 23:18       ` try_then_request_module Riley Williams
2003-05-20  0:19   ` try_then_request_module Rusty Russell

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=20030519110832.G626@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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®