File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,25 @@ static ssize_t iscsi_conn_target_ip_show(struct kobject *kobj, struct kobj_attri
166166static struct kobj_attribute iscsi_conn_target_ip_attr =
167167 __ATTR (target_ip , 0444 , iscsi_conn_target_ip_show , NULL );
168168
169+ static ssize_t iscsi_conn_transport_show (struct kobject * kobj , struct kobj_attribute * attr ,
170+ char * buf )
171+ {
172+ int pos ;
173+ struct iscsi_conn * conn ;
174+
175+ TRACE_ENTRY ();
176+
177+ conn = container_of (kobj , struct iscsi_conn , conn_kobj );
178+
179+ pos = snprintf (buf , SCST_SYSFS_BLOCK_SIZE , "%s\n" , conn -> transport -> name );
180+
181+ TRACE_EXIT_RES (pos );
182+ return pos ;
183+ }
184+
185+ static struct kobj_attribute iscsi_conn_transport_attr =
186+ __ATTR (transport , 0444 , iscsi_conn_transport_show , NULL );
187+
169188static ssize_t iscsi_conn_cid_show (struct kobject * kobj , struct kobj_attribute * attr , char * buf )
170189{
171190 int pos ;
@@ -287,6 +306,13 @@ int conn_sysfs_add(struct iscsi_conn *conn)
287306 goto out_err ;
288307 }
289308
309+ res = sysfs_create_file (& conn -> conn_kobj , & iscsi_conn_transport_attr .attr );
310+ if (res != 0 ) {
311+ PRINT_ERROR ("Unable create sysfs attribute %s for conn %s" ,
312+ iscsi_conn_transport_attr .attr .name , addr );
313+ goto out_err ;
314+ }
315+
290316out :
291317 TRACE_EXIT_RES (res );
292318 return res ;
You can’t perform that action at this time.
0 commit comments