[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150406145048.GC2703@infradead.org>
Date: Mon, 6 Apr 2015 07:50:48 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Ming Lei <ming.lei@...onical.com>
Cc: Christoph Hellwig <hch@...radead.org>,
Jens Axboe <axboe@...nel.dk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Tejun Heo <tj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jarod Wilson <jarod@...hat.com>,
David Herrmann <dh.herrmann@...il.com>,
Markus Pargmann <mpa@...gutronix.de>,
"nbd-general@...ts.sourceforge.net"
<nbd-general@...ts.sourceforge.net>,
Stefan Haberland <stefan.haberland@...ibm.com>,
Sebastian Ott <sebott@...ux.vnet.ibm.com>,
Fabian Frederick <fabf@...net.be>, linux-s390@...r.kernel.org
Subject: Re: [PATCH 1/6] block: export blkdev_reread_part()
On Mon, Apr 06, 2015 at 12:40:12AM +0800, Ming Lei wrote:
> > int blkdev_reread_part(struct block_device *bdev)
> > {
> > if (!mutex_trylock(&bdev->bd_mutex))
> > return -EBUSY;
> > blkdev_reread_part_nolock(bdev);
> > mutex_unlock(&bdev->bd_mutex);
> > }
>
> Yes, it is more clean, but with extra acquiring lock cost for the
> failure cases, especially when we replace trylock with mutex_lock().
It's just a few fairly trivial checks, so 'm not really worried about
it, especially given that blkdev_reread_part isn't called from a fast
path.
--
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