Re: [PATCH 1/6] block: export blkdev_reread_part()

From: Christoph Hellwig
Date: Mon Apr 06 2015 - 10:50:55 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/