lkml.org 
[lkml]   [2007]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] Make prepare_namespace() wait for devices
    On Fri, 25 May 2007 06:03:54 +0200 Pierre Ossman <drzeus-list@drzeus.cx> wrote:

    > Andrew Morton wrote:
    > > On Thu, 24 May 2007 14:21:35 +0200
    > > Pierre Ossman <drzeus-list@drzeus.cx> wrote:
    > >
    > >
    > >> + /* wait for any asynchronous scanning to complete */
    > >> + if ((ROOT_DEV == 0) && root_wait) {
    > >> + printk(KERN_INFO "Waiting for root device %s...\n",
    > >> + saved_root_name);
    > >> + do {
    > >> + while (driver_probe_done() != 0)
    > >> + msleep(100);
    > >> + ROOT_DEV = name_to_dev_t(saved_root_name);
    > >> + if (ROOT_DEV == 0)
    > >> + msleep(100);
    > >> + } while (ROOT_DEV == 0);
    > >> + }
    > >>
    > >
    > > This seems overly complex. Can't we simply do
    > >
    > >
    > > while (driver_probe_done() || ROOT_DEV == 0)
    > > msleep(100);
    > >
    > > ?
    > >
    >
    > How would ROOT_DEV get updated in that loop?
    >

    Whatever. I think you can work it out ;)

    while (driver_probe_done() || (ROOT_DEV = name_to_dev_t(...)) == 0)

    perhaps?

    The loop-which-sleeps within a loop-which-sleeps seems poorly thought out?
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-05-25 06:21    [W:3.085 / U:0.464 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site