Thomas Gleixner | 2522fe4 | 2019-05-28 09:57:20 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 2 | /****************************************************************************** |
| 3 | ******************************************************************************* |
| 4 | ** |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 5 | ** Copyright (C) 2005-2009 Red Hat, Inc. All rights reserved. |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 6 | ** |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 7 | ** |
| 8 | ******************************************************************************* |
| 9 | ******************************************************************************/ |
| 10 | |
| 11 | #include <linux/pagemap.h> |
| 12 | #include <linux/seq_file.h> |
Paul Gortmaker | 7963b8a | 2016-09-19 16:44:50 -0400 | [diff] [blame] | 13 | #include <linux/init.h> |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 14 | #include <linux/ctype.h> |
| 15 | #include <linux/debugfs.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 16 | #include <linux/slab.h> |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 17 | |
| 18 | #include "dlm_internal.h" |
Alexander Aring | 5b2f981 | 2021-05-21 15:08:47 -0400 | [diff] [blame] | 19 | #include "midcomms.h" |
Josef Bacik | 916297a | 2007-05-16 15:56:13 -0400 | [diff] [blame] | 20 | #include "lock.h" |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 21 | |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 22 | #define DLM_DEBUG_BUF_LEN 4096 |
| 23 | static char debug_buf[DLM_DEBUG_BUF_LEN]; |
| 24 | static struct mutex debug_buf_lock; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 25 | |
| 26 | static struct dentry *dlm_root; |
Alexander Aring | 5b2f981 | 2021-05-21 15:08:47 -0400 | [diff] [blame] | 27 | static struct dentry *dlm_comms; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 28 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 29 | static char *print_lockmode(int mode) |
| 30 | { |
| 31 | switch (mode) { |
| 32 | case DLM_LOCK_IV: |
| 33 | return "--"; |
| 34 | case DLM_LOCK_NL: |
| 35 | return "NL"; |
| 36 | case DLM_LOCK_CR: |
| 37 | return "CR"; |
| 38 | case DLM_LOCK_CW: |
| 39 | return "CW"; |
| 40 | case DLM_LOCK_PR: |
| 41 | return "PR"; |
| 42 | case DLM_LOCK_PW: |
| 43 | return "PW"; |
| 44 | case DLM_LOCK_EX: |
| 45 | return "EX"; |
| 46 | default: |
| 47 | return "??"; |
| 48 | } |
| 49 | } |
| 50 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 51 | static void print_format1_lock(struct seq_file *s, struct dlm_lkb *lkb, |
| 52 | struct dlm_rsb *res) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 53 | { |
| 54 | seq_printf(s, "%08x %s", lkb->lkb_id, print_lockmode(lkb->lkb_grmode)); |
| 55 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 56 | if (lkb->lkb_status == DLM_LKSTS_CONVERT || |
| 57 | lkb->lkb_status == DLM_LKSTS_WAITING) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 58 | seq_printf(s, " (%s)", print_lockmode(lkb->lkb_rqmode)); |
| 59 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 60 | if (lkb->lkb_nodeid) { |
| 61 | if (lkb->lkb_nodeid != res->res_nodeid) |
| 62 | seq_printf(s, " Remote: %3d %08x", lkb->lkb_nodeid, |
| 63 | lkb->lkb_remid); |
| 64 | else |
| 65 | seq_printf(s, " Master: %08x", lkb->lkb_remid); |
| 66 | } |
| 67 | |
| 68 | if (lkb->lkb_wait_type) |
| 69 | seq_printf(s, " wait_type: %d", lkb->lkb_wait_type); |
| 70 | |
Markus Elfring | 653996c | 2017-05-06 08:12:31 +0200 | [diff] [blame] | 71 | seq_putc(s, '\n'); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 72 | } |
| 73 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 74 | static void print_format1(struct dlm_rsb *res, struct seq_file *s) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 75 | { |
| 76 | struct dlm_lkb *lkb; |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 77 | int i, lvblen = res->res_ls->ls_lvblen, recover_list, root_list; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 78 | |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 79 | lock_rsb(res); |
| 80 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 81 | seq_printf(s, "\nResource %p Name (len=%d) \"", res, res->res_length); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 82 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 83 | for (i = 0; i < res->res_length; i++) { |
| 84 | if (isprint(res->res_name[i])) |
| 85 | seq_printf(s, "%c", res->res_name[i]); |
| 86 | else |
| 87 | seq_printf(s, "%c", '.'); |
| 88 | } |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 89 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 90 | if (res->res_nodeid > 0) |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 91 | seq_printf(s, "\"\nLocal Copy, Master is node %d\n", |
| 92 | res->res_nodeid); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 93 | else if (res->res_nodeid == 0) |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 94 | seq_puts(s, "\"\nMaster Copy\n"); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 95 | else if (res->res_nodeid == -1) |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 96 | seq_printf(s, "\"\nLooking up master (lkid %x)\n", |
| 97 | res->res_first_lkid); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 98 | else |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 99 | seq_printf(s, "\"\nInvalid master %d\n", res->res_nodeid); |
| 100 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 101 | goto out; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 102 | |
| 103 | /* Print the LVB: */ |
| 104 | if (res->res_lvbptr) { |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 105 | seq_puts(s, "LVB: "); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 106 | for (i = 0; i < lvblen; i++) { |
| 107 | if (i == lvblen / 2) |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 108 | seq_puts(s, "\n "); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 109 | seq_printf(s, "%02x ", |
| 110 | (unsigned char) res->res_lvbptr[i]); |
| 111 | } |
| 112 | if (rsb_flag(res, RSB_VALNOTVALID)) |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 113 | seq_puts(s, " (INVALID)"); |
Markus Elfring | 653996c | 2017-05-06 08:12:31 +0200 | [diff] [blame] | 114 | seq_putc(s, '\n'); |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 115 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 116 | goto out; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 117 | } |
| 118 | |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 119 | root_list = !list_empty(&res->res_root_list); |
| 120 | recover_list = !list_empty(&res->res_recover_list); |
| 121 | |
| 122 | if (root_list || recover_list) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 123 | seq_printf(s, "Recovery: root %d recover %d flags %lx count %d\n", |
| 124 | root_list, recover_list, |
| 125 | res->res_flags, res->res_recover_locks_count); |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 126 | } |
| 127 | |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 128 | /* Print the locks attached to this resource */ |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 129 | seq_puts(s, "Granted Queue\n"); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 130 | list_for_each_entry(lkb, &res->res_grantqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 131 | print_format1_lock(s, lkb, res); |
| 132 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 133 | goto out; |
| 134 | } |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 135 | |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 136 | seq_puts(s, "Conversion Queue\n"); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 137 | list_for_each_entry(lkb, &res->res_convertqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 138 | print_format1_lock(s, lkb, res); |
| 139 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 140 | goto out; |
| 141 | } |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 142 | |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 143 | seq_puts(s, "Waiting Queue\n"); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 144 | list_for_each_entry(lkb, &res->res_waitqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 145 | print_format1_lock(s, lkb, res); |
| 146 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 147 | goto out; |
| 148 | } |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 149 | |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 150 | if (list_empty(&res->res_lookup)) |
| 151 | goto out; |
| 152 | |
Fabian Frederick | c1d4518 | 2014-06-06 14:38:25 -0700 | [diff] [blame] | 153 | seq_puts(s, "Lookup Queue\n"); |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 154 | list_for_each_entry(lkb, &res->res_lookup, lkb_rsb_lookup) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 155 | seq_printf(s, "%08x %s", |
| 156 | lkb->lkb_id, print_lockmode(lkb->lkb_rqmode)); |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 157 | if (lkb->lkb_wait_type) |
| 158 | seq_printf(s, " wait_type: %d", lkb->lkb_wait_type); |
Markus Elfring | 653996c | 2017-05-06 08:12:31 +0200 | [diff] [blame] | 159 | seq_putc(s, '\n'); |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 160 | if (seq_has_overflowed(s)) |
| 161 | goto out; |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 162 | } |
| 163 | out: |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 164 | unlock_rsb(res); |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 165 | } |
| 166 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 167 | static void print_format2_lock(struct seq_file *s, struct dlm_lkb *lkb, |
| 168 | struct dlm_rsb *r) |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 169 | { |
David Teigland | eeda418 | 2008-12-09 14:12:21 -0600 | [diff] [blame] | 170 | u64 xid = 0; |
| 171 | u64 us; |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 172 | |
| 173 | if (lkb->lkb_flags & DLM_IFL_USER) { |
David Teigland | d292c0c | 2008-02-06 23:27:04 -0600 | [diff] [blame] | 174 | if (lkb->lkb_ua) |
| 175 | xid = lkb->lkb_ua->xid; |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 176 | } |
| 177 | |
David Teigland | eeda418 | 2008-12-09 14:12:21 -0600 | [diff] [blame] | 178 | /* microseconds since lkb was added to current queue */ |
| 179 | us = ktime_to_us(ktime_sub(ktime_get(), lkb->lkb_timestamp)); |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 180 | |
David Teigland | eeda418 | 2008-12-09 14:12:21 -0600 | [diff] [blame] | 181 | /* id nodeid remid pid xid exflags flags sts grmode rqmode time_us |
David Teigland | ac90a25 | 2007-07-06 09:47:08 -0500 | [diff] [blame] | 182 | r_nodeid r_len r_name */ |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 183 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 184 | seq_printf(s, "%x %d %x %u %llu %x %x %d %d %d %llu %u %d \"%s\"\n", |
| 185 | lkb->lkb_id, |
| 186 | lkb->lkb_nodeid, |
| 187 | lkb->lkb_remid, |
| 188 | lkb->lkb_ownpid, |
| 189 | (unsigned long long)xid, |
| 190 | lkb->lkb_exflags, |
| 191 | lkb->lkb_flags, |
| 192 | lkb->lkb_status, |
| 193 | lkb->lkb_grmode, |
| 194 | lkb->lkb_rqmode, |
| 195 | (unsigned long long)us, |
| 196 | r->res_nodeid, |
| 197 | r->res_length, |
| 198 | r->res_name); |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 199 | } |
| 200 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 201 | static void print_format2(struct dlm_rsb *r, struct seq_file *s) |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 202 | { |
| 203 | struct dlm_lkb *lkb; |
| 204 | |
| 205 | lock_rsb(r); |
| 206 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 207 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 208 | print_format2_lock(s, lkb, r); |
| 209 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 210 | goto out; |
| 211 | } |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 212 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 213 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 214 | print_format2_lock(s, lkb, r); |
| 215 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 216 | goto out; |
| 217 | } |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 218 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 219 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 220 | print_format2_lock(s, lkb, r); |
| 221 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 222 | goto out; |
| 223 | } |
| 224 | out: |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 225 | unlock_rsb(r); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 226 | } |
| 227 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 228 | static void print_format3_lock(struct seq_file *s, struct dlm_lkb *lkb, |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 229 | int rsb_lookup) |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 230 | { |
| 231 | u64 xid = 0; |
| 232 | |
| 233 | if (lkb->lkb_flags & DLM_IFL_USER) { |
| 234 | if (lkb->lkb_ua) |
| 235 | xid = lkb->lkb_ua->xid; |
| 236 | } |
| 237 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 238 | seq_printf(s, "lkb %x %d %x %u %llu %x %x %d %d %d %d %d %d %u %llu %llu\n", |
| 239 | lkb->lkb_id, |
| 240 | lkb->lkb_nodeid, |
| 241 | lkb->lkb_remid, |
| 242 | lkb->lkb_ownpid, |
| 243 | (unsigned long long)xid, |
| 244 | lkb->lkb_exflags, |
| 245 | lkb->lkb_flags, |
| 246 | lkb->lkb_status, |
| 247 | lkb->lkb_grmode, |
| 248 | lkb->lkb_rqmode, |
| 249 | lkb->lkb_last_bast.mode, |
| 250 | rsb_lookup, |
| 251 | lkb->lkb_wait_type, |
| 252 | lkb->lkb_lvbseq, |
| 253 | (unsigned long long)ktime_to_ns(lkb->lkb_timestamp), |
| 254 | (unsigned long long)ktime_to_ns(lkb->lkb_last_bast_time)); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 255 | } |
| 256 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 257 | static void print_format3(struct dlm_rsb *r, struct seq_file *s) |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 258 | { |
| 259 | struct dlm_lkb *lkb; |
| 260 | int i, lvblen = r->res_ls->ls_lvblen; |
| 261 | int print_name = 1; |
| 262 | |
| 263 | lock_rsb(r); |
| 264 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 265 | seq_printf(s, "rsb %p %d %x %lx %d %d %u %d ", |
| 266 | r, |
| 267 | r->res_nodeid, |
| 268 | r->res_first_lkid, |
| 269 | r->res_flags, |
| 270 | !list_empty(&r->res_root_list), |
| 271 | !list_empty(&r->res_recover_list), |
| 272 | r->res_recover_locks_count, |
| 273 | r->res_length); |
| 274 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 275 | goto out; |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 276 | |
| 277 | for (i = 0; i < r->res_length; i++) { |
| 278 | if (!isascii(r->res_name[i]) || !isprint(r->res_name[i])) |
| 279 | print_name = 0; |
| 280 | } |
| 281 | |
Joe Perches | f365ef9 | 2014-09-29 16:08:24 -0700 | [diff] [blame] | 282 | seq_puts(s, print_name ? "str " : "hex"); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 283 | |
| 284 | for (i = 0; i < r->res_length; i++) { |
| 285 | if (print_name) |
| 286 | seq_printf(s, "%c", r->res_name[i]); |
| 287 | else |
| 288 | seq_printf(s, " %02x", (unsigned char)r->res_name[i]); |
| 289 | } |
Markus Elfring | 653996c | 2017-05-06 08:12:31 +0200 | [diff] [blame] | 290 | seq_putc(s, '\n'); |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 291 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 292 | goto out; |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 293 | |
| 294 | if (!r->res_lvbptr) |
| 295 | goto do_locks; |
| 296 | |
| 297 | seq_printf(s, "lvb %u %d", r->res_lvbseq, lvblen); |
| 298 | |
| 299 | for (i = 0; i < lvblen; i++) |
| 300 | seq_printf(s, " %02x", (unsigned char)r->res_lvbptr[i]); |
Markus Elfring | 653996c | 2017-05-06 08:12:31 +0200 | [diff] [blame] | 301 | seq_putc(s, '\n'); |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 302 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 303 | goto out; |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 304 | |
| 305 | do_locks: |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 306 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 307 | print_format3_lock(s, lkb, 0); |
| 308 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 309 | goto out; |
| 310 | } |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 311 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 312 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 313 | print_format3_lock(s, lkb, 0); |
| 314 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 315 | goto out; |
| 316 | } |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 317 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 318 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 319 | print_format3_lock(s, lkb, 0); |
| 320 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 321 | goto out; |
| 322 | } |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 323 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 324 | list_for_each_entry(lkb, &r->res_lookup, lkb_rsb_lookup) { |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 325 | print_format3_lock(s, lkb, 1); |
| 326 | if (seq_has_overflowed(s)) |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 327 | goto out; |
| 328 | } |
| 329 | out: |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 330 | unlock_rsb(r); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 331 | } |
| 332 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 333 | static void print_format4(struct dlm_rsb *r, struct seq_file *s) |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 334 | { |
| 335 | int our_nodeid = dlm_our_nodeid(); |
| 336 | int print_name = 1; |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 337 | int i; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 338 | |
| 339 | lock_rsb(r); |
| 340 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 341 | seq_printf(s, "rsb %p %d %d %d %d %lu %lx %d ", |
| 342 | r, |
| 343 | r->res_nodeid, |
| 344 | r->res_master_nodeid, |
| 345 | r->res_dir_nodeid, |
| 346 | our_nodeid, |
| 347 | r->res_toss_time, |
| 348 | r->res_flags, |
| 349 | r->res_length); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 350 | |
| 351 | for (i = 0; i < r->res_length; i++) { |
| 352 | if (!isascii(r->res_name[i]) || !isprint(r->res_name[i])) |
| 353 | print_name = 0; |
| 354 | } |
| 355 | |
Joe Perches | f365ef9 | 2014-09-29 16:08:24 -0700 | [diff] [blame] | 356 | seq_puts(s, print_name ? "str " : "hex"); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 357 | |
| 358 | for (i = 0; i < r->res_length; i++) { |
| 359 | if (print_name) |
| 360 | seq_printf(s, "%c", r->res_name[i]); |
| 361 | else |
| 362 | seq_printf(s, " %02x", (unsigned char)r->res_name[i]); |
| 363 | } |
Markus Elfring | 653996c | 2017-05-06 08:12:31 +0200 | [diff] [blame] | 364 | seq_putc(s, '\n'); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 365 | unlock_rsb(r); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 366 | } |
| 367 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 368 | struct rsbtbl_iter { |
| 369 | struct dlm_rsb *rsb; |
| 370 | unsigned bucket; |
| 371 | int format; |
| 372 | int header; |
| 373 | }; |
| 374 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 375 | /* |
| 376 | * If the buffer is full, seq_printf can be called again, but it |
| 377 | * does nothing. So, the these printing routines periodically check |
| 378 | * seq_has_overflowed to avoid wasting too much time trying to print to |
| 379 | * a full buffer. |
| 380 | */ |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 381 | |
| 382 | static int table_seq_show(struct seq_file *seq, void *iter_ptr) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 383 | { |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 384 | struct rsbtbl_iter *ri = iter_ptr; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 385 | |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 386 | switch (ri->format) { |
| 387 | case 1: |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 388 | print_format1(ri->rsb, seq); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 389 | break; |
| 390 | case 2: |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 391 | if (ri->header) { |
Joe Perches | f365ef9 | 2014-09-29 16:08:24 -0700 | [diff] [blame] | 392 | seq_puts(seq, "id nodeid remid pid xid exflags flags sts grmode rqmode time_ms r_nodeid r_len r_name\n"); |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 393 | ri->header = 0; |
| 394 | } |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 395 | print_format2(ri->rsb, seq); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 396 | break; |
| 397 | case 3: |
| 398 | if (ri->header) { |
Joe Perches | f365ef9 | 2014-09-29 16:08:24 -0700 | [diff] [blame] | 399 | seq_puts(seq, "version rsb 1.1 lvb 1.1 lkb 1.1\n"); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 400 | ri->header = 0; |
| 401 | } |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 402 | print_format3(ri->rsb, seq); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 403 | break; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 404 | case 4: |
| 405 | if (ri->header) { |
Joe Perches | f365ef9 | 2014-09-29 16:08:24 -0700 | [diff] [blame] | 406 | seq_puts(seq, "version 4 rsb 2\n"); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 407 | ri->header = 0; |
| 408 | } |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 409 | print_format4(ri->rsb, seq); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 410 | break; |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 411 | } |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 412 | |
Joe Perches | d6d906b | 2014-09-29 16:08:23 -0700 | [diff] [blame] | 413 | return 0; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 414 | } |
| 415 | |
James Morris | 88e9d34 | 2009-09-22 16:43:43 -0700 | [diff] [blame] | 416 | static const struct seq_operations format1_seq_ops; |
| 417 | static const struct seq_operations format2_seq_ops; |
| 418 | static const struct seq_operations format3_seq_ops; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 419 | static const struct seq_operations format4_seq_ops; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 420 | |
| 421 | static void *table_seq_start(struct seq_file *seq, loff_t *pos) |
| 422 | { |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 423 | struct rb_root *tree; |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 424 | struct rb_node *node; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 425 | struct dlm_ls *ls = seq->private; |
| 426 | struct rsbtbl_iter *ri; |
| 427 | struct dlm_rsb *r; |
| 428 | loff_t n = *pos; |
| 429 | unsigned bucket, entry; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 430 | int toss = (seq->op == &format4_seq_ops); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 431 | |
| 432 | bucket = n >> 32; |
| 433 | entry = n & ((1LL << 32) - 1); |
| 434 | |
| 435 | if (bucket >= ls->ls_rsbtbl_size) |
| 436 | return NULL; |
| 437 | |
Markus Elfring | 2c257e9 | 2017-05-06 08:34:27 +0200 | [diff] [blame] | 438 | ri = kzalloc(sizeof(*ri), GFP_NOFS); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 439 | if (!ri) |
| 440 | return NULL; |
| 441 | if (n == 0) |
| 442 | ri->header = 1; |
| 443 | if (seq->op == &format1_seq_ops) |
| 444 | ri->format = 1; |
| 445 | if (seq->op == &format2_seq_ops) |
| 446 | ri->format = 2; |
| 447 | if (seq->op == &format3_seq_ops) |
| 448 | ri->format = 3; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 449 | if (seq->op == &format4_seq_ops) |
| 450 | ri->format = 4; |
| 451 | |
| 452 | tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 453 | |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 454 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 455 | if (!RB_EMPTY_ROOT(tree)) { |
| 456 | for (node = rb_first(tree); node; node = rb_next(node)) { |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 457 | r = rb_entry(node, struct dlm_rsb, res_hashnode); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 458 | if (!entry--) { |
| 459 | dlm_hold_rsb(r); |
| 460 | ri->rsb = r; |
| 461 | ri->bucket = bucket; |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 462 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 463 | return ri; |
| 464 | } |
| 465 | } |
| 466 | } |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 467 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 468 | |
| 469 | /* |
| 470 | * move to the first rsb in the next non-empty bucket |
| 471 | */ |
| 472 | |
| 473 | /* zero the entry */ |
| 474 | n &= ~((1LL << 32) - 1); |
| 475 | |
| 476 | while (1) { |
| 477 | bucket++; |
| 478 | n += 1LL << 32; |
| 479 | |
| 480 | if (bucket >= ls->ls_rsbtbl_size) { |
| 481 | kfree(ri); |
| 482 | return NULL; |
| 483 | } |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 484 | tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 485 | |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 486 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 487 | if (!RB_EMPTY_ROOT(tree)) { |
| 488 | node = rb_first(tree); |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 489 | r = rb_entry(node, struct dlm_rsb, res_hashnode); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 490 | dlm_hold_rsb(r); |
| 491 | ri->rsb = r; |
| 492 | ri->bucket = bucket; |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 493 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 494 | *pos = n; |
| 495 | return ri; |
| 496 | } |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 497 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 498 | } |
| 499 | } |
| 500 | |
| 501 | static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) |
| 502 | { |
| 503 | struct dlm_ls *ls = seq->private; |
| 504 | struct rsbtbl_iter *ri = iter_ptr; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 505 | struct rb_root *tree; |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 506 | struct rb_node *next; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 507 | struct dlm_rsb *r, *rp; |
| 508 | loff_t n = *pos; |
| 509 | unsigned bucket; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 510 | int toss = (seq->op == &format4_seq_ops); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 511 | |
| 512 | bucket = n >> 32; |
| 513 | |
| 514 | /* |
| 515 | * move to the next rsb in the same bucket |
| 516 | */ |
| 517 | |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 518 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 519 | rp = ri->rsb; |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 520 | next = rb_next(&rp->res_hashnode); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 521 | |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 522 | if (next) { |
| 523 | r = rb_entry(next, struct dlm_rsb, res_hashnode); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 524 | dlm_hold_rsb(r); |
| 525 | ri->rsb = r; |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 526 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 527 | dlm_put_rsb(rp); |
| 528 | ++*pos; |
| 529 | return ri; |
| 530 | } |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 531 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 532 | dlm_put_rsb(rp); |
| 533 | |
| 534 | /* |
| 535 | * move to the first rsb in the next non-empty bucket |
| 536 | */ |
| 537 | |
| 538 | /* zero the entry */ |
| 539 | n &= ~((1LL << 32) - 1); |
| 540 | |
| 541 | while (1) { |
| 542 | bucket++; |
| 543 | n += 1LL << 32; |
| 544 | |
| 545 | if (bucket >= ls->ls_rsbtbl_size) { |
| 546 | kfree(ri); |
Alexander Aring | 92c4895 | 2021-03-01 17:05:08 -0500 | [diff] [blame] | 547 | ++*pos; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 548 | return NULL; |
| 549 | } |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 550 | tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 551 | |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 552 | spin_lock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 553 | if (!RB_EMPTY_ROOT(tree)) { |
| 554 | next = rb_first(tree); |
Bob Peterson | 9beb3bf | 2011-10-26 15:24:55 -0500 | [diff] [blame] | 555 | r = rb_entry(next, struct dlm_rsb, res_hashnode); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 556 | dlm_hold_rsb(r); |
| 557 | ri->rsb = r; |
| 558 | ri->bucket = bucket; |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 559 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 560 | *pos = n; |
| 561 | return ri; |
| 562 | } |
David Teigland | c7be761 | 2009-01-07 16:50:41 -0600 | [diff] [blame] | 563 | spin_unlock(&ls->ls_rsbtbl[bucket].lock); |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 564 | } |
| 565 | } |
| 566 | |
| 567 | static void table_seq_stop(struct seq_file *seq, void *iter_ptr) |
| 568 | { |
| 569 | struct rsbtbl_iter *ri = iter_ptr; |
| 570 | |
| 571 | if (ri) { |
| 572 | dlm_put_rsb(ri->rsb); |
| 573 | kfree(ri); |
| 574 | } |
| 575 | } |
| 576 | |
James Morris | 88e9d34 | 2009-09-22 16:43:43 -0700 | [diff] [blame] | 577 | static const struct seq_operations format1_seq_ops = { |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 578 | .start = table_seq_start, |
| 579 | .next = table_seq_next, |
| 580 | .stop = table_seq_stop, |
| 581 | .show = table_seq_show, |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 582 | }; |
| 583 | |
James Morris | 88e9d34 | 2009-09-22 16:43:43 -0700 | [diff] [blame] | 584 | static const struct seq_operations format2_seq_ops = { |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 585 | .start = table_seq_start, |
| 586 | .next = table_seq_next, |
| 587 | .stop = table_seq_stop, |
| 588 | .show = table_seq_show, |
| 589 | }; |
| 590 | |
James Morris | 88e9d34 | 2009-09-22 16:43:43 -0700 | [diff] [blame] | 591 | static const struct seq_operations format3_seq_ops = { |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 592 | .start = table_seq_start, |
| 593 | .next = table_seq_next, |
| 594 | .stop = table_seq_stop, |
| 595 | .show = table_seq_show, |
| 596 | }; |
| 597 | |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 598 | static const struct seq_operations format4_seq_ops = { |
| 599 | .start = table_seq_start, |
| 600 | .next = table_seq_next, |
| 601 | .stop = table_seq_stop, |
| 602 | .show = table_seq_show, |
| 603 | }; |
| 604 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 605 | static const struct file_operations format1_fops; |
| 606 | static const struct file_operations format2_fops; |
| 607 | static const struct file_operations format3_fops; |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 608 | static const struct file_operations format4_fops; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 609 | |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 610 | static int table_open1(struct inode *inode, struct file *file) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 611 | { |
| 612 | struct seq_file *seq; |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 613 | int ret; |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 614 | |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 615 | ret = seq_open(file, &format1_seq_ops); |
| 616 | if (ret) |
| 617 | return ret; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 618 | |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 619 | seq = file->private_data; |
| 620 | seq->private = inode->i_private; /* the dlm_ls */ |
| 621 | return 0; |
| 622 | } |
| 623 | |
| 624 | static int table_open2(struct inode *inode, struct file *file) |
| 625 | { |
| 626 | struct seq_file *seq; |
| 627 | int ret; |
| 628 | |
| 629 | ret = seq_open(file, &format2_seq_ops); |
| 630 | if (ret) |
| 631 | return ret; |
| 632 | |
| 633 | seq = file->private_data; |
| 634 | seq->private = inode->i_private; /* the dlm_ls */ |
| 635 | return 0; |
| 636 | } |
| 637 | |
Alexander Aring | 5054e79 | 2021-11-02 15:17:22 -0400 | [diff] [blame] | 638 | static ssize_t table_write2(struct file *file, const char __user *user_buf, |
| 639 | size_t count, loff_t *ppos) |
| 640 | { |
| 641 | struct seq_file *seq = file->private_data; |
| 642 | int n, len, lkb_nodeid, lkb_status, error; |
Alexander Aring | 6a628fa | 2021-11-12 10:08:01 -0500 | [diff] [blame] | 643 | char name[DLM_RESNAME_MAXLEN + 1] = {}; |
Alexander Aring | 5054e79 | 2021-11-02 15:17:22 -0400 | [diff] [blame] | 644 | struct dlm_ls *ls = seq->private; |
| 645 | unsigned int lkb_flags; |
| 646 | char buf[256] = {}; |
| 647 | uint32_t lkb_id; |
| 648 | |
| 649 | if (copy_from_user(buf, user_buf, |
| 650 | min_t(size_t, sizeof(buf) - 1, count))) |
| 651 | return -EFAULT; |
| 652 | |
| 653 | n = sscanf(buf, "%x %" __stringify(DLM_RESNAME_MAXLEN) "s %x %d %d", |
| 654 | &lkb_id, name, &lkb_flags, &lkb_nodeid, &lkb_status); |
| 655 | if (n != 5) |
| 656 | return -EINVAL; |
| 657 | |
| 658 | len = strnlen(name, DLM_RESNAME_MAXLEN); |
| 659 | error = dlm_debug_add_lkb(ls, lkb_id, name, len, lkb_flags, |
| 660 | lkb_nodeid, lkb_status); |
| 661 | if (error) |
| 662 | return error; |
| 663 | |
| 664 | return count; |
| 665 | } |
| 666 | |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 667 | static int table_open3(struct inode *inode, struct file *file) |
| 668 | { |
| 669 | struct seq_file *seq; |
| 670 | int ret; |
| 671 | |
| 672 | ret = seq_open(file, &format3_seq_ops); |
| 673 | if (ret) |
| 674 | return ret; |
| 675 | |
| 676 | seq = file->private_data; |
| 677 | seq->private = inode->i_private; /* the dlm_ls */ |
| 678 | return 0; |
| 679 | } |
| 680 | |
| 681 | static int table_open4(struct inode *inode, struct file *file) |
| 682 | { |
| 683 | struct seq_file *seq; |
| 684 | int ret; |
| 685 | |
| 686 | ret = seq_open(file, &format4_seq_ops); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 687 | if (ret) |
| 688 | return ret; |
| 689 | |
| 690 | seq = file->private_data; |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 691 | seq->private = inode->i_private; /* the dlm_ls */ |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 692 | return 0; |
| 693 | } |
| 694 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 695 | static const struct file_operations format1_fops = { |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 696 | .owner = THIS_MODULE, |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 697 | .open = table_open1, |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 698 | .read = seq_read, |
| 699 | .llseek = seq_lseek, |
| 700 | .release = seq_release |
| 701 | }; |
| 702 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 703 | static const struct file_operations format2_fops = { |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 704 | .owner = THIS_MODULE, |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 705 | .open = table_open2, |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 706 | .read = seq_read, |
Alexander Aring | 5054e79 | 2021-11-02 15:17:22 -0400 | [diff] [blame] | 707 | .write = table_write2, |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 708 | .llseek = seq_lseek, |
| 709 | .release = seq_release |
| 710 | }; |
| 711 | |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 712 | static const struct file_operations format3_fops = { |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 713 | .owner = THIS_MODULE, |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 714 | .open = table_open3, |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 715 | .read = seq_read, |
| 716 | .llseek = seq_lseek, |
| 717 | .release = seq_release |
| 718 | }; |
| 719 | |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 720 | static const struct file_operations format4_fops = { |
| 721 | .owner = THIS_MODULE, |
Eric Ren | 079d37d | 2016-08-25 17:20:59 +0800 | [diff] [blame] | 722 | .open = table_open4, |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 723 | .read = seq_read, |
| 724 | .llseek = seq_lseek, |
| 725 | .release = seq_release |
| 726 | }; |
| 727 | |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 728 | /* |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 729 | * dump lkb's on the ls_waiters list |
| 730 | */ |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 731 | static ssize_t waiters_read(struct file *file, char __user *userbuf, |
| 732 | size_t count, loff_t *ppos) |
| 733 | { |
| 734 | struct dlm_ls *ls = file->private_data; |
| 735 | struct dlm_lkb *lkb; |
David Teigland | 0644244 | 2006-08-08 11:31:30 -0500 | [diff] [blame] | 736 | size_t len = DLM_DEBUG_BUF_LEN, pos = 0, ret, rv; |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 737 | |
| 738 | mutex_lock(&debug_buf_lock); |
| 739 | mutex_lock(&ls->ls_waiters_mutex); |
| 740 | memset(debug_buf, 0, sizeof(debug_buf)); |
| 741 | |
| 742 | list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) { |
David Teigland | 0644244 | 2006-08-08 11:31:30 -0500 | [diff] [blame] | 743 | ret = snprintf(debug_buf + pos, len - pos, "%x %d %d %s\n", |
| 744 | lkb->lkb_id, lkb->lkb_wait_type, |
| 745 | lkb->lkb_nodeid, lkb->lkb_resource->res_name); |
| 746 | if (ret >= len - pos) |
| 747 | break; |
| 748 | pos += ret; |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 749 | } |
| 750 | mutex_unlock(&ls->ls_waiters_mutex); |
| 751 | |
| 752 | rv = simple_read_from_buffer(userbuf, count, ppos, debug_buf, pos); |
| 753 | mutex_unlock(&debug_buf_lock); |
| 754 | return rv; |
| 755 | } |
| 756 | |
Alexander Aring | 63eab2b0 | 2021-11-02 15:17:23 -0400 | [diff] [blame] | 757 | static ssize_t waiters_write(struct file *file, const char __user *user_buf, |
| 758 | size_t count, loff_t *ppos) |
| 759 | { |
| 760 | struct dlm_ls *ls = file->private_data; |
| 761 | int mstype, to_nodeid; |
| 762 | char buf[128] = {}; |
| 763 | uint32_t lkb_id; |
| 764 | int n, error; |
| 765 | |
| 766 | if (copy_from_user(buf, user_buf, |
| 767 | min_t(size_t, sizeof(buf) - 1, count))) |
| 768 | return -EFAULT; |
| 769 | |
| 770 | n = sscanf(buf, "%x %d %d", &lkb_id, &mstype, &to_nodeid); |
| 771 | if (n != 3) |
| 772 | return -EINVAL; |
| 773 | |
| 774 | error = dlm_debug_add_lkb_to_waiters(ls, lkb_id, mstype, to_nodeid); |
| 775 | if (error) |
| 776 | return error; |
| 777 | |
| 778 | return count; |
| 779 | } |
| 780 | |
Arjan van de Ven | 00977a5 | 2007-02-12 00:55:34 -0800 | [diff] [blame] | 781 | static const struct file_operations waiters_fops = { |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 782 | .owner = THIS_MODULE, |
Stephen Boyd | 234e340 | 2012-04-05 14:25:11 -0700 | [diff] [blame] | 783 | .open = simple_open, |
Arnd Bergmann | 6038f37 | 2010-08-15 18:52:59 +0200 | [diff] [blame] | 784 | .read = waiters_read, |
Alexander Aring | 63eab2b0 | 2021-11-02 15:17:23 -0400 | [diff] [blame] | 785 | .write = waiters_write, |
Arnd Bergmann | 6038f37 | 2010-08-15 18:52:59 +0200 | [diff] [blame] | 786 | .llseek = default_llseek, |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 787 | }; |
| 788 | |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 789 | void dlm_delete_debug_file(struct dlm_ls *ls) |
| 790 | { |
Fabian Frederick | e0d9bf4 | 2014-08-08 14:23:37 -0700 | [diff] [blame] | 791 | debugfs_remove(ls->ls_debug_rsb_dentry); |
| 792 | debugfs_remove(ls->ls_debug_waiters_dentry); |
| 793 | debugfs_remove(ls->ls_debug_locks_dentry); |
| 794 | debugfs_remove(ls->ls_debug_all_dentry); |
| 795 | debugfs_remove(ls->ls_debug_toss_dentry); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 796 | } |
| 797 | |
Alexander Aring | 5b2f981 | 2021-05-21 15:08:47 -0400 | [diff] [blame] | 798 | static int dlm_state_show(struct seq_file *file, void *offset) |
| 799 | { |
| 800 | seq_printf(file, "%s\n", dlm_midcomms_state(file->private)); |
| 801 | return 0; |
| 802 | } |
| 803 | DEFINE_SHOW_ATTRIBUTE(dlm_state); |
| 804 | |
| 805 | static int dlm_flags_show(struct seq_file *file, void *offset) |
| 806 | { |
| 807 | seq_printf(file, "%lu\n", dlm_midcomms_flags(file->private)); |
| 808 | return 0; |
| 809 | } |
| 810 | DEFINE_SHOW_ATTRIBUTE(dlm_flags); |
| 811 | |
| 812 | static int dlm_send_queue_cnt_show(struct seq_file *file, void *offset) |
| 813 | { |
| 814 | seq_printf(file, "%d\n", dlm_midcomms_send_queue_cnt(file->private)); |
| 815 | return 0; |
| 816 | } |
| 817 | DEFINE_SHOW_ATTRIBUTE(dlm_send_queue_cnt); |
| 818 | |
| 819 | static int dlm_version_show(struct seq_file *file, void *offset) |
| 820 | { |
| 821 | seq_printf(file, "0x%08x\n", dlm_midcomms_version(file->private)); |
| 822 | return 0; |
| 823 | } |
| 824 | DEFINE_SHOW_ATTRIBUTE(dlm_version); |
| 825 | |
Alexander Aring | 9af5b8f | 2021-11-02 15:17:20 -0400 | [diff] [blame] | 826 | static ssize_t dlm_rawmsg_write(struct file *fp, const char __user *user_buf, |
| 827 | size_t count, loff_t *ppos) |
| 828 | { |
| 829 | void *buf; |
| 830 | int ret; |
| 831 | |
| 832 | if (count > PAGE_SIZE || count < sizeof(struct dlm_header)) |
| 833 | return -EINVAL; |
| 834 | |
| 835 | buf = kmalloc(PAGE_SIZE, GFP_NOFS); |
| 836 | if (!buf) |
| 837 | return -ENOMEM; |
| 838 | |
| 839 | if (copy_from_user(buf, user_buf, count)) { |
| 840 | ret = -EFAULT; |
| 841 | goto out; |
| 842 | } |
| 843 | |
| 844 | ret = dlm_midcomms_rawmsg_send(fp->private_data, buf, count); |
| 845 | if (ret) |
| 846 | goto out; |
| 847 | |
| 848 | kfree(buf); |
| 849 | return count; |
| 850 | |
| 851 | out: |
| 852 | kfree(buf); |
| 853 | return ret; |
| 854 | } |
| 855 | |
| 856 | static const struct file_operations dlm_rawmsg_fops = { |
| 857 | .open = simple_open, |
| 858 | .write = dlm_rawmsg_write, |
| 859 | .llseek = no_llseek, |
| 860 | }; |
| 861 | |
Alexander Aring | 5b2f981 | 2021-05-21 15:08:47 -0400 | [diff] [blame] | 862 | void *dlm_create_debug_comms_file(int nodeid, void *data) |
| 863 | { |
| 864 | struct dentry *d_node; |
| 865 | char name[256]; |
| 866 | |
| 867 | memset(name, 0, sizeof(name)); |
| 868 | snprintf(name, 256, "%d", nodeid); |
| 869 | |
| 870 | d_node = debugfs_create_dir(name, dlm_comms); |
| 871 | debugfs_create_file("state", 0444, d_node, data, &dlm_state_fops); |
| 872 | debugfs_create_file("flags", 0444, d_node, data, &dlm_flags_fops); |
| 873 | debugfs_create_file("send_queue_count", 0444, d_node, data, |
| 874 | &dlm_send_queue_cnt_fops); |
| 875 | debugfs_create_file("version", 0444, d_node, data, &dlm_version_fops); |
Alexander Aring | 9af5b8f | 2021-11-02 15:17:20 -0400 | [diff] [blame] | 876 | debugfs_create_file("rawmsg", 0200, d_node, data, &dlm_rawmsg_fops); |
Alexander Aring | 5b2f981 | 2021-05-21 15:08:47 -0400 | [diff] [blame] | 877 | |
| 878 | return d_node; |
| 879 | } |
| 880 | |
| 881 | void dlm_delete_debug_comms_file(void *ctx) |
| 882 | { |
| 883 | debugfs_remove(ctx); |
| 884 | } |
| 885 | |
Greg Kroah-Hartman | a48f972 | 2019-06-12 17:25:36 +0200 | [diff] [blame] | 886 | void dlm_create_debug_file(struct dlm_ls *ls) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 887 | { |
Markus Elfring | 41922ce | 2017-05-06 08:22:35 +0200 | [diff] [blame] | 888 | char name[DLM_LOCKSPACE_LEN + 8]; |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 889 | |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 890 | /* format 1 */ |
| 891 | |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 892 | ls->ls_debug_rsb_dentry = debugfs_create_file(ls->ls_name, |
| 893 | S_IFREG | S_IRUGO, |
| 894 | dlm_root, |
| 895 | ls, |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 896 | &format1_fops); |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 897 | |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 898 | /* format 2 */ |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 899 | |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 900 | memset(name, 0, sizeof(name)); |
Markus Elfring | 41922ce | 2017-05-06 08:22:35 +0200 | [diff] [blame] | 901 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_locks", ls->ls_name); |
David Teigland | 9dd592d | 2007-05-29 08:47:04 -0500 | [diff] [blame] | 902 | |
David Teigland | ac90a25 | 2007-07-06 09:47:08 -0500 | [diff] [blame] | 903 | ls->ls_debug_locks_dentry = debugfs_create_file(name, |
Alexander Aring | 5054e79 | 2021-11-02 15:17:22 -0400 | [diff] [blame] | 904 | 0644, |
David Teigland | ac90a25 | 2007-07-06 09:47:08 -0500 | [diff] [blame] | 905 | dlm_root, |
| 906 | ls, |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 907 | &format2_fops); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 908 | |
| 909 | /* format 3 */ |
| 910 | |
| 911 | memset(name, 0, sizeof(name)); |
Markus Elfring | 41922ce | 2017-05-06 08:22:35 +0200 | [diff] [blame] | 912 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_all", ls->ls_name); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 913 | |
| 914 | ls->ls_debug_all_dentry = debugfs_create_file(name, |
| 915 | S_IFREG | S_IRUGO, |
| 916 | dlm_root, |
| 917 | ls, |
David Teigland | 892c446 | 2009-01-07 16:48:52 -0600 | [diff] [blame] | 918 | &format3_fops); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 919 | |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 920 | /* format 4 */ |
| 921 | |
| 922 | memset(name, 0, sizeof(name)); |
Markus Elfring | 41922ce | 2017-05-06 08:22:35 +0200 | [diff] [blame] | 923 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_toss", ls->ls_name); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 924 | |
| 925 | ls->ls_debug_toss_dentry = debugfs_create_file(name, |
| 926 | S_IFREG | S_IRUGO, |
| 927 | dlm_root, |
| 928 | ls, |
| 929 | &format4_fops); |
David Teigland | c04fecb | 2012-05-10 10:18:07 -0500 | [diff] [blame] | 930 | |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 931 | memset(name, 0, sizeof(name)); |
Markus Elfring | 41922ce | 2017-05-06 08:22:35 +0200 | [diff] [blame] | 932 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 933 | |
| 934 | ls->ls_debug_waiters_dentry = debugfs_create_file(name, |
Alexander Aring | 63eab2b0 | 2021-11-02 15:17:23 -0400 | [diff] [blame] | 935 | 0644, |
David Teigland | d022509 | 2008-12-16 14:53:23 -0600 | [diff] [blame] | 936 | dlm_root, |
| 937 | ls, |
| 938 | &waiters_fops); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 939 | } |
| 940 | |
Greg Kroah-Hartman | a48f972 | 2019-06-12 17:25:36 +0200 | [diff] [blame] | 941 | void __init dlm_register_debugfs(void) |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 942 | { |
David Teigland | 5de6319 | 2006-07-25 13:44:31 -0500 | [diff] [blame] | 943 | mutex_init(&debug_buf_lock); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 944 | dlm_root = debugfs_create_dir("dlm", NULL); |
Alexander Aring | 5b2f981 | 2021-05-21 15:08:47 -0400 | [diff] [blame] | 945 | dlm_comms = debugfs_create_dir("comms", dlm_root); |
David Teigland | e7fd417 | 2006-01-18 09:30:29 +0000 | [diff] [blame] | 946 | } |
| 947 | |
| 948 | void dlm_unregister_debugfs(void) |
| 949 | { |
| 950 | debugfs_remove(dlm_root); |
| 951 | } |
| 952 | |