[sheepdog] [PATCH v4 RESEND 5/8] sheepdev: make it possible to add or remove a sheep device

Liu Yuan namei.unix at gmail.com
Wed Jan 23 10:18:40 CET 2013


On 01/23/2013 04:16 PM, levin li wrote:
> +
> +	spin_lock_init(&dev->que_lock);
> +	spin_lock_init(&dev->dev_lock);
> +	spin_lock_init(&dev->sd_req_lock);
> +	rwlock_init(&dev->creating_lock);
> +	rwlock_init(&dev->sock_lock);

I think we should rethink if the so many locks is necessary.

> +	init_waitqueue_head(&dev->req_wait);
> +	init_waitqueue_head(&dev->fin_wait);
> +	init_waitqueue_head(&dev->creating_wait);
> +	INIT_LIST_HEAD(&dev->pending_list);
> +	INIT_LIST_HEAD(&dev->finish_list);
> +	INIT_LIST_HEAD(&dev->dev_list);
> +	INIT_LIST_HEAD(&dev->deletion_list);
> +	INIT_LIST_HEAD(&dev->sd_req_list);

It looks that you support multiple users to the same block device, which
shouldn't be the case we'd care about. We should only allow one users to
use one block device only.

Thanks,
Yuan



More information about the sheepdog mailing list