Lines Matching refs:srv_path

18 	struct rtrs_srv_path *srv_path;  in rtrs_srv_release()  local
20 srv_path = container_of(kobj, struct rtrs_srv_path, kobj); in rtrs_srv_release()
21 kfree(srv_path); in rtrs_srv_release()
39 struct rtrs_srv_path *srv_path; in rtrs_srv_disconnect_store() local
43 srv_path = container_of(kobj, struct rtrs_srv_path, kobj); in rtrs_srv_disconnect_store()
44 s = &srv_path->s; in rtrs_srv_disconnect_store()
51 sockaddr_to_str((struct sockaddr *)&srv_path->s.dst_addr, str, in rtrs_srv_disconnect_store()
56 sysfs_remove_file_self(&srv_path->kobj, &attr->attr); in rtrs_srv_disconnect_store()
57 close_path(srv_path); in rtrs_srv_disconnect_store()
70 struct rtrs_srv_path *srv_path; in rtrs_srv_hca_port_show() local
73 srv_path = container_of(kobj, typeof(*srv_path), kobj); in rtrs_srv_hca_port_show()
74 usr_con = srv_path->s.con[0]; in rtrs_srv_hca_port_show()
86 struct rtrs_srv_path *srv_path; in rtrs_srv_hca_name_show() local
88 srv_path = container_of(kobj, struct rtrs_srv_path, kobj); in rtrs_srv_hca_name_show()
90 return sysfs_emit(page, "%s\n", srv_path->s.dev->ib_dev->name); in rtrs_srv_hca_name_show()
100 struct rtrs_srv_path *srv_path; in rtrs_srv_src_addr_show() local
103 srv_path = container_of(kobj, struct rtrs_srv_path, kobj); in rtrs_srv_src_addr_show()
104 cnt = sockaddr_to_str((struct sockaddr *)&srv_path->s.dst_addr, in rtrs_srv_src_addr_show()
116 struct rtrs_srv_path *srv_path; in rtrs_srv_dst_addr_show() local
119 srv_path = container_of(kobj, struct rtrs_srv_path, kobj); in rtrs_srv_dst_addr_show()
120 len = sockaddr_to_str((struct sockaddr *)&srv_path->s.src_addr, page, in rtrs_srv_dst_addr_show()
155 static int rtrs_srv_create_once_sysfs_root_folders(struct rtrs_srv_path *srv_path) in rtrs_srv_create_once_sysfs_root_folders() argument
157 struct rtrs_srv_sess *srv = srv_path->srv; in rtrs_srv_create_once_sysfs_root_folders()
168 err = dev_set_name(&srv->dev, "%s", srv_path->s.sessname); in rtrs_srv_create_once_sysfs_root_folders()
200 rtrs_srv_destroy_once_sysfs_root_folders(struct rtrs_srv_path *srv_path) in rtrs_srv_destroy_once_sysfs_root_folders() argument
202 struct rtrs_srv_sess *srv = srv_path->srv; in rtrs_srv_destroy_once_sysfs_root_folders()
232 static int rtrs_srv_create_stats_files(struct rtrs_srv_path *srv_path) in rtrs_srv_create_stats_files() argument
235 struct rtrs_path *s = &srv_path->s; in rtrs_srv_create_stats_files()
237 err = kobject_init_and_add(&srv_path->stats->kobj_stats, &ktype_stats, in rtrs_srv_create_stats_files()
238 &srv_path->kobj, "stats"); in rtrs_srv_create_stats_files()
241 kobject_put(&srv_path->stats->kobj_stats); in rtrs_srv_create_stats_files()
244 err = sysfs_create_group(&srv_path->stats->kobj_stats, in rtrs_srv_create_stats_files()
254 kobject_del(&srv_path->stats->kobj_stats); in rtrs_srv_create_stats_files()
255 kobject_put(&srv_path->stats->kobj_stats); in rtrs_srv_create_stats_files()
260 int rtrs_srv_create_path_files(struct rtrs_srv_path *srv_path) in rtrs_srv_create_path_files() argument
262 struct rtrs_srv_sess *srv = srv_path->srv; in rtrs_srv_create_path_files()
263 struct rtrs_path *s = &srv_path->s; in rtrs_srv_create_path_files()
267 .src = &srv_path->s.dst_addr, in rtrs_srv_create_path_files()
268 .dst = &srv_path->s.src_addr, in rtrs_srv_create_path_files()
272 err = rtrs_srv_create_once_sysfs_root_folders(srv_path); in rtrs_srv_create_path_files()
276 err = kobject_init_and_add(&srv_path->kobj, &ktype, srv->kobj_paths, in rtrs_srv_create_path_files()
282 err = sysfs_create_group(&srv_path->kobj, &rtrs_srv_path_attr_group); in rtrs_srv_create_path_files()
287 err = rtrs_srv_create_stats_files(srv_path); in rtrs_srv_create_path_files()
294 sysfs_remove_group(&srv_path->kobj, &rtrs_srv_path_attr_group); in rtrs_srv_create_path_files()
296 kobject_del(&srv_path->kobj); in rtrs_srv_create_path_files()
298 kobject_put(&srv_path->kobj); in rtrs_srv_create_path_files()
299 rtrs_srv_destroy_once_sysfs_root_folders(srv_path); in rtrs_srv_create_path_files()
304 void rtrs_srv_destroy_path_files(struct rtrs_srv_path *srv_path) in rtrs_srv_destroy_path_files() argument
306 if (srv_path->stats->kobj_stats.state_in_sysfs) { in rtrs_srv_destroy_path_files()
307 sysfs_remove_group(&srv_path->stats->kobj_stats, in rtrs_srv_destroy_path_files()
309 kobject_del(&srv_path->stats->kobj_stats); in rtrs_srv_destroy_path_files()
310 kobject_put(&srv_path->stats->kobj_stats); in rtrs_srv_destroy_path_files()
313 if (srv_path->kobj.state_in_sysfs) { in rtrs_srv_destroy_path_files()
314 sysfs_remove_group(&srv_path->kobj, &rtrs_srv_path_attr_group); in rtrs_srv_destroy_path_files()
315 kobject_put(&srv_path->kobj); in rtrs_srv_destroy_path_files()
316 rtrs_srv_destroy_once_sysfs_root_folders(srv_path); in rtrs_srv_destroy_path_files()