Lines Matching refs:srv
156 struct rtrs_srv *srv = sess->srv; in rtrs_srv_create_once_sysfs_root_folders() local
159 mutex_lock(&srv->paths_mutex); in rtrs_srv_create_once_sysfs_root_folders()
160 if (srv->dev_ref++) { in rtrs_srv_create_once_sysfs_root_folders()
166 srv->dev.class = rtrs_dev_class; in rtrs_srv_create_once_sysfs_root_folders()
167 err = dev_set_name(&srv->dev, "%s", sess->s.sessname); in rtrs_srv_create_once_sysfs_root_folders()
175 dev_set_uevent_suppress(&srv->dev, true); in rtrs_srv_create_once_sysfs_root_folders()
176 err = device_add(&srv->dev); in rtrs_srv_create_once_sysfs_root_folders()
179 put_device(&srv->dev); in rtrs_srv_create_once_sysfs_root_folders()
182 srv->kobj_paths = kobject_create_and_add("paths", &srv->dev.kobj); in rtrs_srv_create_once_sysfs_root_folders()
183 if (!srv->kobj_paths) { in rtrs_srv_create_once_sysfs_root_folders()
186 device_del(&srv->dev); in rtrs_srv_create_once_sysfs_root_folders()
187 put_device(&srv->dev); in rtrs_srv_create_once_sysfs_root_folders()
190 dev_set_uevent_suppress(&srv->dev, false); in rtrs_srv_create_once_sysfs_root_folders()
191 kobject_uevent(&srv->dev.kobj, KOBJ_ADD); in rtrs_srv_create_once_sysfs_root_folders()
193 mutex_unlock(&srv->paths_mutex); in rtrs_srv_create_once_sysfs_root_folders()
201 struct rtrs_srv *srv = sess->srv; in rtrs_srv_destroy_once_sysfs_root_folders() local
203 mutex_lock(&srv->paths_mutex); in rtrs_srv_destroy_once_sysfs_root_folders()
204 if (!--srv->dev_ref) { in rtrs_srv_destroy_once_sysfs_root_folders()
205 kobject_del(srv->kobj_paths); in rtrs_srv_destroy_once_sysfs_root_folders()
206 kobject_put(srv->kobj_paths); in rtrs_srv_destroy_once_sysfs_root_folders()
207 mutex_unlock(&srv->paths_mutex); in rtrs_srv_destroy_once_sysfs_root_folders()
208 device_del(&srv->dev); in rtrs_srv_destroy_once_sysfs_root_folders()
209 put_device(&srv->dev); in rtrs_srv_destroy_once_sysfs_root_folders()
211 put_device(&srv->dev); in rtrs_srv_destroy_once_sysfs_root_folders()
212 mutex_unlock(&srv->paths_mutex); in rtrs_srv_destroy_once_sysfs_root_folders()
260 struct rtrs_srv *srv = sess->srv; in rtrs_srv_create_sess_files() local
274 err = kobject_init_and_add(&sess->kobj, &ktype, srv->kobj_paths, in rtrs_srv_create_sess_files()