Lines Matching refs:srv_dev
472 static int rnbd_srv_check_update_open_perm(struct rnbd_srv_dev *srv_dev, in rnbd_srv_check_update_open_perm() argument
478 mutex_lock(&srv_dev->lock); in rnbd_srv_check_update_open_perm()
484 if (srv_dev->open_write_cnt == 0) { in rnbd_srv_check_update_open_perm()
485 srv_dev->open_write_cnt++; in rnbd_srv_check_update_open_perm()
488 srv_dev->name, srv_sess->sessname, in rnbd_srv_check_update_open_perm()
489 srv_dev->open_write_cnt, in rnbd_srv_check_update_open_perm()
495 if (srv_dev->open_write_cnt < 2) { in rnbd_srv_check_update_open_perm()
496 srv_dev->open_write_cnt++; in rnbd_srv_check_update_open_perm()
499 srv_dev->name, srv_sess->sessname, in rnbd_srv_check_update_open_perm()
500 srv_dev->open_write_cnt, in rnbd_srv_check_update_open_perm()
507 srv_dev->name, srv_sess->sessname, access_mode); in rnbd_srv_check_update_open_perm()
511 mutex_unlock(&srv_dev->lock); in rnbd_srv_check_update_open_perm()
571 struct rnbd_srv_dev *srv_dev) in rnbd_srv_create_set_sess_dev() argument
584 sdev->dev = srv_dev; in rnbd_srv_create_set_sess_dev()
685 struct rnbd_srv_dev *srv_dev; in process_msg_open() local
734 srv_dev = rnbd_srv_get_or_create_srv_dev(file_bdev(bdev_file), srv_sess, in process_msg_open()
736 if (IS_ERR(srv_dev)) { in process_msg_open()
738 full_path, srv_sess->sessname, srv_dev); in process_msg_open()
739 ret = PTR_ERR(srv_dev); in process_msg_open()
746 srv_dev); in process_msg_open()
758 mutex_lock(&srv_dev->lock); in process_msg_open()
759 if (!srv_dev->dev_kobj.state_in_sysfs) { in process_msg_open()
760 ret = rnbd_srv_create_dev_sysfs(srv_dev, file_bdev(bdev_file)); in process_msg_open()
762 mutex_unlock(&srv_dev->lock); in process_msg_open()
772 mutex_unlock(&srv_dev->lock); in process_msg_open()
779 list_add(&srv_sess_dev->dev_list, &srv_dev->sess_dev_list); in process_msg_open()
780 mutex_unlock(&srv_dev->lock); in process_msg_open()
782 rnbd_srv_info(srv_sess_dev, "Opened device '%s'\n", srv_dev->name); in process_msg_open()
797 mutex_lock(&srv_dev->lock); in process_msg_open()
798 srv_dev->open_write_cnt--; in process_msg_open()
799 mutex_unlock(&srv_dev->lock); in process_msg_open()
801 rnbd_put_srv_dev(srv_dev); in process_msg_open()