[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070323145622.GC4095@ftp.linux.org.uk>
Date: Fri, 23 Mar 2007 14:56:22 +0000
From: Al Viro <viro@....linux.org.uk>
To: Eric Dumazet <dada1@...mosbay.com>
Cc: Tomas M <tomas@...x.org>, linux-kernel@...r.kernel.org
Subject: Re: [patch] [bugfix] loop.c
On Fri, Mar 23, 2007 at 03:48:09PM +0100, Eric Dumazet wrote:
> On Fri, 23 Mar 2007 14:36:05 +0000
> Al Viro <viro@....linux.org.uk> wrote:
>
> > On Fri, Mar 23, 2007 at 03:19:56PM +0100, Eric Dumazet wrote:
> > > I cooked the following patch (untested), feel free to test it.
> >
> > Please, get the cleanup into saner shape. This is too ugly.
>
> out_mem:
> while (nba--)
> blk_cleanup_queue(loop_dev[nba]->lo_queue);
> while (nbl--) {
> put_disk(loop_dev[nbl]->lo_disk);
> kfree(loop_dev[nbl]);
> }
> if (loop_dev_vmalloced)
> vfree(loop_dev);
> else
> kfree(loop_dev);
> unregister_blkdev(LOOP_MAJOR, "loop");
>
>
> What is ugly in this code ?
Your counters. Two loops instead of one (no reason to allocate queues in
a a separate loop). vmalloc conditional on kmalloc failure.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists