- struct lu_ref *ref = p;
- struct lu_ref *next;
-
- cfs_spin_lock(&lu_ref_refs_guard);
- next = cfs_list_entry(ref->lf_linkage.next, struct lu_ref, lf_linkage);
- if ((&next->lf_linkage == &lu_ref_refs) || lu_ref_is_marker(next)) {
- cfs_spin_unlock(&lu_ref_refs_guard);
- return 0;
- }
-
- /* print the entry */
-
- cfs_spin_lock(&next->lf_guard);
- seq_printf(seq, "lu_ref: %p %d %d %s:%d\n",
- next, next->lf_refs, next->lf_failed,
- next->lf_func, next->lf_line);
- if (next->lf_refs > 64) {
- seq_printf(seq, " too many references, skip\n");
- } else {
- struct lu_ref_link *link;
- int i = 0;
-
- cfs_list_for_each_entry(link, &next->lf_list, ll_linkage)
- seq_printf(seq, " #%d link: %s %p\n",
- i++, link->ll_scope, link->ll_source);
- }
- cfs_spin_unlock(&next->lf_guard);
- cfs_spin_unlock(&lu_ref_refs_guard);
-
- return 0;
+ struct lu_ref *ref = p;
+ struct lu_ref *next;
+
+ spin_lock(&lu_ref_refs_guard);
+ next = list_entry(ref->lf_linkage.next, struct lu_ref, lf_linkage);
+ if ((&next->lf_linkage == &lu_ref_refs) || lu_ref_is_marker(next)) {
+ spin_unlock(&lu_ref_refs_guard);
+ return 0;
+ }
+
+ /* print the entry */
+ spin_lock(&next->lf_guard);
+ seq_printf(seq, "lu_ref: %p %d %d %s:%d\n",
+ next, next->lf_refs, next->lf_failed,
+ next->lf_func, next->lf_line);
+ if (next->lf_refs > 64) {
+ seq_puts(seq, " too many references, skip\n");
+ } else {
+ struct lu_ref_link *link;
+ int i = 0;
+
+ list_for_each_entry(link, &next->lf_list, ll_linkage)
+ seq_printf(seq, " #%d link: %s %p\n",
+ i++, link->ll_scope, link->ll_source);
+ }
+ spin_unlock(&next->lf_guard);
+ spin_unlock(&lu_ref_refs_guard);
+
+ return 0;