| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * fs/cifs_debug.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) International Business Machines Corp., 2000,2005 |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Modified by Steve French (sfrench@us.ibm.com) |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
|---|
| 16 | | - * the GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; if not, write to the Free Software |
|---|
| 20 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 21 | 8 | */ |
|---|
| 22 | 9 | #include <linux/fs.h> |
|---|
| 23 | 10 | #include <linux/string.h> |
|---|
| .. | .. |
|---|
| 30 | 17 | #include "cifsproto.h" |
|---|
| 31 | 18 | #include "cifs_debug.h" |
|---|
| 32 | 19 | #include "cifsfs.h" |
|---|
| 20 | +#ifdef CONFIG_CIFS_DFS_UPCALL |
|---|
| 21 | +#include "dfs_cache.h" |
|---|
| 22 | +#endif |
|---|
| 33 | 23 | #ifdef CONFIG_CIFS_SMB_DIRECT |
|---|
| 34 | 24 | #include "smbdirect.h" |
|---|
| 35 | 25 | #endif |
|---|
| .. | .. |
|---|
| 112 | 102 | seq_puts(m, " type: CDROM "); |
|---|
| 113 | 103 | else |
|---|
| 114 | 104 | seq_printf(m, " type: %d ", dev_type); |
|---|
| 115 | | - if (tcon->seal) |
|---|
| 105 | + |
|---|
| 106 | + seq_printf(m, "Serial Number: 0x%x", tcon->vol_serial_number); |
|---|
| 107 | + |
|---|
| 108 | + if ((tcon->seal) || |
|---|
| 109 | + (tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) || |
|---|
| 110 | + (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA)) |
|---|
| 116 | 111 | seq_printf(m, " Encrypted"); |
|---|
| 117 | 112 | if (tcon->nocase) |
|---|
| 118 | 113 | seq_printf(m, " nocase"); |
|---|
| .. | .. |
|---|
| 127 | 122 | } |
|---|
| 128 | 123 | |
|---|
| 129 | 124 | static void |
|---|
| 125 | +cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan) |
|---|
| 126 | +{ |
|---|
| 127 | + struct TCP_Server_Info *server = chan->server; |
|---|
| 128 | + |
|---|
| 129 | + seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x " |
|---|
| 130 | + "TCP status: %d Instance: %d Local Users To Server: %d " |
|---|
| 131 | + "SecMode: 0x%x Req On Wire: %d In Send: %d " |
|---|
| 132 | + "In MaxReq Wait: %d\n", |
|---|
| 133 | + i+1, |
|---|
| 134 | + server->credits, |
|---|
| 135 | + server->dialect, |
|---|
| 136 | + server->tcpStatus, |
|---|
| 137 | + server->reconnect_instance, |
|---|
| 138 | + server->srv_count, |
|---|
| 139 | + server->sec_mode, |
|---|
| 140 | + in_flight(server), |
|---|
| 141 | + atomic_read(&server->in_send), |
|---|
| 142 | + atomic_read(&server->num_waiters)); |
|---|
| 143 | +} |
|---|
| 144 | + |
|---|
| 145 | +static void |
|---|
| 130 | 146 | cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface) |
|---|
| 131 | 147 | { |
|---|
| 132 | 148 | struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr; |
|---|
| 133 | 149 | struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr; |
|---|
| 134 | 150 | |
|---|
| 135 | | - seq_printf(m, "\t\tSpeed: %zu bps\n", iface->speed); |
|---|
| 151 | + seq_printf(m, "\tSpeed: %zu bps\n", iface->speed); |
|---|
| 136 | 152 | seq_puts(m, "\t\tCapabilities: "); |
|---|
| 137 | 153 | if (iface->rdma_capable) |
|---|
| 138 | 154 | seq_puts(m, "rdma "); |
|---|
| .. | .. |
|---|
| 143 | 159 | seq_printf(m, "\t\tIPv4: %pI4\n", &ipv4->sin_addr); |
|---|
| 144 | 160 | else if (iface->sockaddr.ss_family == AF_INET6) |
|---|
| 145 | 161 | seq_printf(m, "\t\tIPv6: %pI6\n", &ipv6->sin6_addr); |
|---|
| 162 | +} |
|---|
| 163 | + |
|---|
| 164 | +static int cifs_debug_files_proc_show(struct seq_file *m, void *v) |
|---|
| 165 | +{ |
|---|
| 166 | + struct list_head *stmp, *tmp, *tmp1, *tmp2; |
|---|
| 167 | + struct TCP_Server_Info *server; |
|---|
| 168 | + struct cifs_ses *ses; |
|---|
| 169 | + struct cifs_tcon *tcon; |
|---|
| 170 | + struct cifsFileInfo *cfile; |
|---|
| 171 | + |
|---|
| 172 | + seq_puts(m, "# Version:1\n"); |
|---|
| 173 | + seq_puts(m, "# Format:\n"); |
|---|
| 174 | + seq_puts(m, "# <tree id> <persistent fid> <flags> <count> <pid> <uid>"); |
|---|
| 175 | +#ifdef CONFIG_CIFS_DEBUG2 |
|---|
| 176 | + seq_printf(m, " <filename> <mid>\n"); |
|---|
| 177 | +#else |
|---|
| 178 | + seq_printf(m, " <filename>\n"); |
|---|
| 179 | +#endif /* CIFS_DEBUG2 */ |
|---|
| 180 | + spin_lock(&cifs_tcp_ses_lock); |
|---|
| 181 | + list_for_each(stmp, &cifs_tcp_ses_list) { |
|---|
| 182 | + server = list_entry(stmp, struct TCP_Server_Info, |
|---|
| 183 | + tcp_ses_list); |
|---|
| 184 | + list_for_each(tmp, &server->smb_ses_list) { |
|---|
| 185 | + ses = list_entry(tmp, struct cifs_ses, smb_ses_list); |
|---|
| 186 | + list_for_each(tmp1, &ses->tcon_list) { |
|---|
| 187 | + tcon = list_entry(tmp1, struct cifs_tcon, tcon_list); |
|---|
| 188 | + spin_lock(&tcon->open_file_lock); |
|---|
| 189 | + list_for_each(tmp2, &tcon->openFileList) { |
|---|
| 190 | + cfile = list_entry(tmp2, struct cifsFileInfo, |
|---|
| 191 | + tlist); |
|---|
| 192 | + seq_printf(m, |
|---|
| 193 | + "0x%x 0x%llx 0x%x %d %d %d %s", |
|---|
| 194 | + tcon->tid, |
|---|
| 195 | + cfile->fid.persistent_fid, |
|---|
| 196 | + cfile->f_flags, |
|---|
| 197 | + cfile->count, |
|---|
| 198 | + cfile->pid, |
|---|
| 199 | + from_kuid(&init_user_ns, cfile->uid), |
|---|
| 200 | + cfile->dentry->d_name.name); |
|---|
| 201 | +#ifdef CONFIG_CIFS_DEBUG2 |
|---|
| 202 | + seq_printf(m, " 0x%llx\n", cfile->fid.mid); |
|---|
| 203 | +#else |
|---|
| 204 | + seq_printf(m, "\n"); |
|---|
| 205 | +#endif /* CIFS_DEBUG2 */ |
|---|
| 206 | + } |
|---|
| 207 | + spin_unlock(&tcon->open_file_lock); |
|---|
| 208 | + } |
|---|
| 209 | + } |
|---|
| 210 | + } |
|---|
| 211 | + spin_unlock(&cifs_tcp_ses_lock); |
|---|
| 212 | + seq_putc(m, '\n'); |
|---|
| 213 | + return 0; |
|---|
| 146 | 214 | } |
|---|
| 147 | 215 | |
|---|
| 148 | 216 | static int cifs_debug_data_proc_show(struct seq_file *m, void *v) |
|---|
| .. | .. |
|---|
| 193 | 261 | #ifdef CONFIG_CIFS_XATTR |
|---|
| 194 | 262 | seq_printf(m, ",XATTR"); |
|---|
| 195 | 263 | #endif |
|---|
| 196 | | -#ifdef CONFIG_CIFS_ACL |
|---|
| 197 | 264 | seq_printf(m, ",ACL"); |
|---|
| 198 | | -#endif |
|---|
| 199 | 265 | seq_putc(m, '\n'); |
|---|
| 266 | + seq_printf(m, "CIFSMaxBufSize: %d\n", CIFSMaxBufSize); |
|---|
| 200 | 267 | seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid); |
|---|
| 201 | 268 | seq_printf(m, "Servers:"); |
|---|
| 202 | 269 | |
|---|
| .. | .. |
|---|
| 256 | 323 | atomic_read(&server->smbd_conn->send_credits), |
|---|
| 257 | 324 | atomic_read(&server->smbd_conn->receive_credits), |
|---|
| 258 | 325 | server->smbd_conn->receive_credit_target); |
|---|
| 259 | | - seq_printf(m, "\nPending send_pending: %x send_payload_pending:" |
|---|
| 260 | | - " %x smbd_send_pending: %x smbd_recv_pending: %x", |
|---|
| 261 | | - atomic_read(&server->smbd_conn->send_pending), |
|---|
| 262 | | - atomic_read(&server->smbd_conn->send_payload_pending), |
|---|
| 263 | | - server->smbd_conn->smbd_send_pending, |
|---|
| 264 | | - server->smbd_conn->smbd_recv_pending); |
|---|
| 326 | + seq_printf(m, "\nPending send_pending: %x ", |
|---|
| 327 | + atomic_read(&server->smbd_conn->send_pending)); |
|---|
| 265 | 328 | seq_printf(m, "\nReceive buffers count_receive_queue: %x " |
|---|
| 266 | 329 | "count_empty_packet_queue: %x", |
|---|
| 267 | 330 | server->smbd_conn->count_receive_queue, |
|---|
| .. | .. |
|---|
| 278 | 341 | #endif |
|---|
| 279 | 342 | seq_printf(m, "\nNumber of credits: %d Dialect 0x%x", |
|---|
| 280 | 343 | server->credits, server->dialect); |
|---|
| 344 | + if (server->compress_algorithm == SMB3_COMPRESS_LZNT1) |
|---|
| 345 | + seq_printf(m, " COMPRESS_LZNT1"); |
|---|
| 346 | + else if (server->compress_algorithm == SMB3_COMPRESS_LZ77) |
|---|
| 347 | + seq_printf(m, " COMPRESS_LZ77"); |
|---|
| 348 | + else if (server->compress_algorithm == SMB3_COMPRESS_LZ77_HUFF) |
|---|
| 349 | + seq_printf(m, " COMPRESS_LZ77_HUFF"); |
|---|
| 281 | 350 | if (server->sign) |
|---|
| 282 | 351 | seq_printf(m, " signed"); |
|---|
| 283 | 352 | if (server->posix_ext_supported) |
|---|
| .. | .. |
|---|
| 290 | 359 | if ((ses->serverDomain == NULL) || |
|---|
| 291 | 360 | (ses->serverOS == NULL) || |
|---|
| 292 | 361 | (ses->serverNOS == NULL)) { |
|---|
| 293 | | - seq_printf(m, "\n%d) Name: %s Uses: %d Capability: 0x%x\tSession Status: %d\t", |
|---|
| 362 | + seq_printf(m, "\n%d) Name: %s Uses: %d Capability: 0x%x\tSession Status: %d ", |
|---|
| 294 | 363 | i, ses->serverName, ses->ses_count, |
|---|
| 295 | 364 | ses->capabilities, ses->status); |
|---|
| 296 | 365 | if (ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) |
|---|
| .. | .. |
|---|
| 301 | 370 | seq_printf(m, |
|---|
| 302 | 371 | "\n%d) Name: %s Domain: %s Uses: %d OS:" |
|---|
| 303 | 372 | " %s\n\tNOS: %s\tCapability: 0x%x\n\tSMB" |
|---|
| 304 | | - " session status: %d\t", |
|---|
| 373 | + " session status: %d ", |
|---|
| 305 | 374 | i, ses->serverName, ses->serverDomain, |
|---|
| 306 | 375 | ses->ses_count, ses->serverOS, ses->serverNOS, |
|---|
| 307 | 376 | ses->capabilities, ses->status); |
|---|
| 308 | 377 | } |
|---|
| 378 | + |
|---|
| 379 | + seq_printf(m,"Security type: %s\n", |
|---|
| 380 | + get_security_type_str(server->ops->select_sectype(server, ses->sectype))); |
|---|
| 381 | + |
|---|
| 309 | 382 | if (server->rdma) |
|---|
| 310 | 383 | seq_printf(m, "RDMA\n\t"); |
|---|
| 311 | | - seq_printf(m, "TCP status: %d\n\tLocal Users To " |
|---|
| 384 | + seq_printf(m, "TCP status: %d Instance: %d\n\tLocal Users To " |
|---|
| 312 | 385 | "Server: %d SecMode: 0x%x Req On Wire: %d", |
|---|
| 313 | | - server->tcpStatus, server->srv_count, |
|---|
| 386 | + server->tcpStatus, |
|---|
| 387 | + server->reconnect_instance, |
|---|
| 388 | + server->srv_count, |
|---|
| 314 | 389 | server->sec_mode, in_flight(server)); |
|---|
| 315 | 390 | |
|---|
| 316 | | -#ifdef CONFIG_CIFS_STATS2 |
|---|
| 317 | 391 | seq_printf(m, " In Send: %d In MaxReq Wait: %d", |
|---|
| 318 | 392 | atomic_read(&server->in_send), |
|---|
| 319 | 393 | atomic_read(&server->num_waiters)); |
|---|
| 320 | | -#endif |
|---|
| 321 | 394 | |
|---|
| 322 | | - seq_puts(m, "\n\tShares:"); |
|---|
| 395 | + /* dump session id helpful for use with network trace */ |
|---|
| 396 | + seq_printf(m, " SessionId: 0x%llx", ses->Suid); |
|---|
| 397 | + if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) |
|---|
| 398 | + seq_puts(m, " encrypted"); |
|---|
| 399 | + if (ses->sign) |
|---|
| 400 | + seq_puts(m, " signed"); |
|---|
| 401 | + |
|---|
| 402 | + seq_printf(m, "\n\tUser: %d Cred User: %d", |
|---|
| 403 | + from_kuid(&init_user_ns, ses->linux_uid), |
|---|
| 404 | + from_kuid(&init_user_ns, ses->cred_uid)); |
|---|
| 405 | + |
|---|
| 406 | + if (ses->chan_count > 1) { |
|---|
| 407 | + seq_printf(m, "\n\n\tExtra Channels: %zu\n", |
|---|
| 408 | + ses->chan_count-1); |
|---|
| 409 | + for (j = 1; j < ses->chan_count; j++) |
|---|
| 410 | + cifs_dump_channel(m, j, &ses->chans[j]); |
|---|
| 411 | + } |
|---|
| 412 | + |
|---|
| 413 | + seq_puts(m, "\n\n\tShares:"); |
|---|
| 323 | 414 | j = 0; |
|---|
| 324 | 415 | |
|---|
| 325 | 416 | seq_printf(m, "\n\t%d) IPC: ", j); |
|---|
| .. | .. |
|---|
| 357 | 448 | seq_printf(m, "\n\tServer interfaces: %zu\n", |
|---|
| 358 | 449 | ses->iface_count); |
|---|
| 359 | 450 | for (j = 0; j < ses->iface_count; j++) { |
|---|
| 360 | | - seq_printf(m, "\t%d)\n", j); |
|---|
| 361 | | - cifs_dump_iface(m, &ses->iface_list[j]); |
|---|
| 451 | + struct cifs_server_iface *iface; |
|---|
| 452 | + |
|---|
| 453 | + iface = &ses->iface_list[j]; |
|---|
| 454 | + seq_printf(m, "\t%d)", j); |
|---|
| 455 | + cifs_dump_iface(m, iface); |
|---|
| 456 | + if (is_ses_using_iface(ses, iface)) |
|---|
| 457 | + seq_puts(m, "\t\t[CONNECTED]\n"); |
|---|
| 362 | 458 | } |
|---|
| 363 | 459 | spin_unlock(&ses->iface_lock); |
|---|
| 364 | 460 | } |
|---|
| .. | .. |
|---|
| 399 | 495 | list_for_each(tmp1, &cifs_tcp_ses_list) { |
|---|
| 400 | 496 | server = list_entry(tmp1, struct TCP_Server_Info, |
|---|
| 401 | 497 | tcp_ses_list); |
|---|
| 498 | + server->max_in_flight = 0; |
|---|
| 402 | 499 | #ifdef CONFIG_CIFS_STATS2 |
|---|
| 403 | | - for (i = 0; i < NUMBER_OF_SMB2_COMMANDS; i++) |
|---|
| 500 | + for (i = 0; i < NUMBER_OF_SMB2_COMMANDS; i++) { |
|---|
| 501 | + atomic_set(&server->num_cmds[i], 0); |
|---|
| 404 | 502 | atomic_set(&server->smb2slowcmd[i], 0); |
|---|
| 503 | + server->time_per_cmd[i] = 0; |
|---|
| 504 | + server->slowest_cmd[i] = 0; |
|---|
| 505 | + server->fastest_cmd[0] = 0; |
|---|
| 506 | + } |
|---|
| 405 | 507 | #endif /* CONFIG_CIFS_STATS2 */ |
|---|
| 406 | 508 | list_for_each(tmp2, &server->smb_ses_list) { |
|---|
| 407 | 509 | ses = list_entry(tmp2, struct cifs_ses, |
|---|
| .. | .. |
|---|
| 468 | 570 | list_for_each(tmp1, &cifs_tcp_ses_list) { |
|---|
| 469 | 571 | server = list_entry(tmp1, struct TCP_Server_Info, |
|---|
| 470 | 572 | tcp_ses_list); |
|---|
| 573 | + seq_printf(m, "\nMax requests in flight: %d", server->max_in_flight); |
|---|
| 471 | 574 | #ifdef CONFIG_CIFS_STATS2 |
|---|
| 575 | + seq_puts(m, "\nTotal time spent processing by command. Time "); |
|---|
| 576 | + seq_printf(m, "units are jiffies (%d per second)\n", HZ); |
|---|
| 577 | + seq_puts(m, " SMB3 CMD\tNumber\tTotal Time\tFastest\tSlowest\n"); |
|---|
| 578 | + seq_puts(m, " --------\t------\t----------\t-------\t-------\n"); |
|---|
| 579 | + for (j = 0; j < NUMBER_OF_SMB2_COMMANDS; j++) |
|---|
| 580 | + seq_printf(m, " %d\t\t%d\t%llu\t\t%u\t%u\n", j, |
|---|
| 581 | + atomic_read(&server->num_cmds[j]), |
|---|
| 582 | + server->time_per_cmd[j], |
|---|
| 583 | + server->fastest_cmd[j], |
|---|
| 584 | + server->slowest_cmd[j]); |
|---|
| 472 | 585 | for (j = 0; j < NUMBER_OF_SMB2_COMMANDS; j++) |
|---|
| 473 | 586 | if (atomic_read(&server->smb2slowcmd[j])) |
|---|
| 474 | | - seq_printf(m, "%d slow responses from %s for command %d\n", |
|---|
| 587 | + seq_printf(m, " %d slow responses from %s for command %d\n", |
|---|
| 475 | 588 | atomic_read(&server->smb2slowcmd[j]), |
|---|
| 476 | 589 | server->hostname, j); |
|---|
| 477 | 590 | #endif /* STATS2 */ |
|---|
| .. | .. |
|---|
| 504 | 617 | return single_open(file, cifs_stats_proc_show, NULL); |
|---|
| 505 | 618 | } |
|---|
| 506 | 619 | |
|---|
| 507 | | -static const struct file_operations cifs_stats_proc_fops = { |
|---|
| 508 | | - .open = cifs_stats_proc_open, |
|---|
| 509 | | - .read = seq_read, |
|---|
| 510 | | - .llseek = seq_lseek, |
|---|
| 511 | | - .release = single_release, |
|---|
| 512 | | - .write = cifs_stats_proc_write, |
|---|
| 620 | +static const struct proc_ops cifs_stats_proc_ops = { |
|---|
| 621 | + .proc_open = cifs_stats_proc_open, |
|---|
| 622 | + .proc_read = seq_read, |
|---|
| 623 | + .proc_lseek = seq_lseek, |
|---|
| 624 | + .proc_release = single_release, |
|---|
| 625 | + .proc_write = cifs_stats_proc_write, |
|---|
| 513 | 626 | }; |
|---|
| 514 | 627 | |
|---|
| 515 | 628 | #ifdef CONFIG_CIFS_SMB_DIRECT |
|---|
| .. | .. |
|---|
| 533 | 646 | return single_open(file, name##_proc_show, NULL); \ |
|---|
| 534 | 647 | } \ |
|---|
| 535 | 648 | \ |
|---|
| 536 | | -static const struct file_operations cifs_##name##_proc_fops = { \ |
|---|
| 537 | | - .open = name##_open, \ |
|---|
| 538 | | - .read = seq_read, \ |
|---|
| 539 | | - .llseek = seq_lseek, \ |
|---|
| 540 | | - .release = single_release, \ |
|---|
| 541 | | - .write = name##_write, \ |
|---|
| 649 | +static const struct proc_ops cifs_##name##_proc_fops = { \ |
|---|
| 650 | + .proc_open = name##_open, \ |
|---|
| 651 | + .proc_read = seq_read, \ |
|---|
| 652 | + .proc_lseek = seq_lseek, \ |
|---|
| 653 | + .proc_release = single_release, \ |
|---|
| 654 | + .proc_write = name##_write, \ |
|---|
| 542 | 655 | } |
|---|
| 543 | 656 | |
|---|
| 544 | 657 | PROC_FILE_DEFINE(rdma_readwrite_threshold); |
|---|
| .. | .. |
|---|
| 552 | 665 | #endif |
|---|
| 553 | 666 | |
|---|
| 554 | 667 | static struct proc_dir_entry *proc_fs_cifs; |
|---|
| 555 | | -static const struct file_operations cifsFYI_proc_fops; |
|---|
| 556 | | -static const struct file_operations cifs_lookup_cache_proc_fops; |
|---|
| 557 | | -static const struct file_operations traceSMB_proc_fops; |
|---|
| 558 | | -static const struct file_operations cifs_security_flags_proc_fops; |
|---|
| 559 | | -static const struct file_operations cifs_linux_ext_proc_fops; |
|---|
| 668 | +static const struct proc_ops cifsFYI_proc_ops; |
|---|
| 669 | +static const struct proc_ops cifs_lookup_cache_proc_ops; |
|---|
| 670 | +static const struct proc_ops traceSMB_proc_ops; |
|---|
| 671 | +static const struct proc_ops cifs_security_flags_proc_ops; |
|---|
| 672 | +static const struct proc_ops cifs_linux_ext_proc_ops; |
|---|
| 560 | 673 | |
|---|
| 561 | 674 | void |
|---|
| 562 | 675 | cifs_proc_init(void) |
|---|
| .. | .. |
|---|
| 568 | 681 | proc_create_single("DebugData", 0, proc_fs_cifs, |
|---|
| 569 | 682 | cifs_debug_data_proc_show); |
|---|
| 570 | 683 | |
|---|
| 571 | | - proc_create("Stats", 0644, proc_fs_cifs, &cifs_stats_proc_fops); |
|---|
| 572 | | - proc_create("cifsFYI", 0644, proc_fs_cifs, &cifsFYI_proc_fops); |
|---|
| 573 | | - proc_create("traceSMB", 0644, proc_fs_cifs, &traceSMB_proc_fops); |
|---|
| 684 | + proc_create_single("open_files", 0400, proc_fs_cifs, |
|---|
| 685 | + cifs_debug_files_proc_show); |
|---|
| 686 | + |
|---|
| 687 | + proc_create("Stats", 0644, proc_fs_cifs, &cifs_stats_proc_ops); |
|---|
| 688 | + proc_create("cifsFYI", 0644, proc_fs_cifs, &cifsFYI_proc_ops); |
|---|
| 689 | + proc_create("traceSMB", 0644, proc_fs_cifs, &traceSMB_proc_ops); |
|---|
| 574 | 690 | proc_create("LinuxExtensionsEnabled", 0644, proc_fs_cifs, |
|---|
| 575 | | - &cifs_linux_ext_proc_fops); |
|---|
| 691 | + &cifs_linux_ext_proc_ops); |
|---|
| 576 | 692 | proc_create("SecurityFlags", 0644, proc_fs_cifs, |
|---|
| 577 | | - &cifs_security_flags_proc_fops); |
|---|
| 693 | + &cifs_security_flags_proc_ops); |
|---|
| 578 | 694 | proc_create("LookupCacheEnabled", 0644, proc_fs_cifs, |
|---|
| 579 | | - &cifs_lookup_cache_proc_fops); |
|---|
| 695 | + &cifs_lookup_cache_proc_ops); |
|---|
| 696 | + |
|---|
| 697 | +#ifdef CONFIG_CIFS_DFS_UPCALL |
|---|
| 698 | + proc_create("dfscache", 0644, proc_fs_cifs, &dfscache_proc_ops); |
|---|
| 699 | +#endif |
|---|
| 700 | + |
|---|
| 580 | 701 | #ifdef CONFIG_CIFS_SMB_DIRECT |
|---|
| 581 | 702 | proc_create("rdma_readwrite_threshold", 0644, proc_fs_cifs, |
|---|
| 582 | 703 | &cifs_rdma_readwrite_threshold_proc_fops); |
|---|
| .. | .. |
|---|
| 604 | 725 | return; |
|---|
| 605 | 726 | |
|---|
| 606 | 727 | remove_proc_entry("DebugData", proc_fs_cifs); |
|---|
| 728 | + remove_proc_entry("open_files", proc_fs_cifs); |
|---|
| 607 | 729 | remove_proc_entry("cifsFYI", proc_fs_cifs); |
|---|
| 608 | 730 | remove_proc_entry("traceSMB", proc_fs_cifs); |
|---|
| 609 | 731 | remove_proc_entry("Stats", proc_fs_cifs); |
|---|
| 610 | 732 | remove_proc_entry("SecurityFlags", proc_fs_cifs); |
|---|
| 611 | 733 | remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); |
|---|
| 612 | 734 | remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); |
|---|
| 735 | + |
|---|
| 736 | +#ifdef CONFIG_CIFS_DFS_UPCALL |
|---|
| 737 | + remove_proc_entry("dfscache", proc_fs_cifs); |
|---|
| 738 | +#endif |
|---|
| 613 | 739 | #ifdef CONFIG_CIFS_SMB_DIRECT |
|---|
| 614 | 740 | remove_proc_entry("rdma_readwrite_threshold", proc_fs_cifs); |
|---|
| 615 | 741 | remove_proc_entry("smbd_max_frmr_depth", proc_fs_cifs); |
|---|
| .. | .. |
|---|
| 654 | 780 | return count; |
|---|
| 655 | 781 | } |
|---|
| 656 | 782 | |
|---|
| 657 | | -static const struct file_operations cifsFYI_proc_fops = { |
|---|
| 658 | | - .open = cifsFYI_proc_open, |
|---|
| 659 | | - .read = seq_read, |
|---|
| 660 | | - .llseek = seq_lseek, |
|---|
| 661 | | - .release = single_release, |
|---|
| 662 | | - .write = cifsFYI_proc_write, |
|---|
| 783 | +static const struct proc_ops cifsFYI_proc_ops = { |
|---|
| 784 | + .proc_open = cifsFYI_proc_open, |
|---|
| 785 | + .proc_read = seq_read, |
|---|
| 786 | + .proc_lseek = seq_lseek, |
|---|
| 787 | + .proc_release = single_release, |
|---|
| 788 | + .proc_write = cifsFYI_proc_write, |
|---|
| 663 | 789 | }; |
|---|
| 664 | 790 | |
|---|
| 665 | 791 | static int cifs_linux_ext_proc_show(struct seq_file *m, void *v) |
|---|
| .. | .. |
|---|
| 685 | 811 | return count; |
|---|
| 686 | 812 | } |
|---|
| 687 | 813 | |
|---|
| 688 | | -static const struct file_operations cifs_linux_ext_proc_fops = { |
|---|
| 689 | | - .open = cifs_linux_ext_proc_open, |
|---|
| 690 | | - .read = seq_read, |
|---|
| 691 | | - .llseek = seq_lseek, |
|---|
| 692 | | - .release = single_release, |
|---|
| 693 | | - .write = cifs_linux_ext_proc_write, |
|---|
| 814 | +static const struct proc_ops cifs_linux_ext_proc_ops = { |
|---|
| 815 | + .proc_open = cifs_linux_ext_proc_open, |
|---|
| 816 | + .proc_read = seq_read, |
|---|
| 817 | + .proc_lseek = seq_lseek, |
|---|
| 818 | + .proc_release = single_release, |
|---|
| 819 | + .proc_write = cifs_linux_ext_proc_write, |
|---|
| 694 | 820 | }; |
|---|
| 695 | 821 | |
|---|
| 696 | 822 | static int cifs_lookup_cache_proc_show(struct seq_file *m, void *v) |
|---|
| .. | .. |
|---|
| 716 | 842 | return count; |
|---|
| 717 | 843 | } |
|---|
| 718 | 844 | |
|---|
| 719 | | -static const struct file_operations cifs_lookup_cache_proc_fops = { |
|---|
| 720 | | - .open = cifs_lookup_cache_proc_open, |
|---|
| 721 | | - .read = seq_read, |
|---|
| 722 | | - .llseek = seq_lseek, |
|---|
| 723 | | - .release = single_release, |
|---|
| 724 | | - .write = cifs_lookup_cache_proc_write, |
|---|
| 845 | +static const struct proc_ops cifs_lookup_cache_proc_ops = { |
|---|
| 846 | + .proc_open = cifs_lookup_cache_proc_open, |
|---|
| 847 | + .proc_read = seq_read, |
|---|
| 848 | + .proc_lseek = seq_lseek, |
|---|
| 849 | + .proc_release = single_release, |
|---|
| 850 | + .proc_write = cifs_lookup_cache_proc_write, |
|---|
| 725 | 851 | }; |
|---|
| 726 | 852 | |
|---|
| 727 | 853 | static int traceSMB_proc_show(struct seq_file *m, void *v) |
|---|
| .. | .. |
|---|
| 747 | 873 | return count; |
|---|
| 748 | 874 | } |
|---|
| 749 | 875 | |
|---|
| 750 | | -static const struct file_operations traceSMB_proc_fops = { |
|---|
| 751 | | - .open = traceSMB_proc_open, |
|---|
| 752 | | - .read = seq_read, |
|---|
| 753 | | - .llseek = seq_lseek, |
|---|
| 754 | | - .release = single_release, |
|---|
| 755 | | - .write = traceSMB_proc_write, |
|---|
| 876 | +static const struct proc_ops traceSMB_proc_ops = { |
|---|
| 877 | + .proc_open = traceSMB_proc_open, |
|---|
| 878 | + .proc_read = seq_read, |
|---|
| 879 | + .proc_lseek = seq_lseek, |
|---|
| 880 | + .proc_release = single_release, |
|---|
| 881 | + .proc_write = traceSMB_proc_write, |
|---|
| 756 | 882 | }; |
|---|
| 757 | 883 | |
|---|
| 758 | 884 | static int cifs_security_flags_proc_show(struct seq_file *m, void *v) |
|---|
| .. | .. |
|---|
| 858 | 984 | return count; |
|---|
| 859 | 985 | } |
|---|
| 860 | 986 | |
|---|
| 861 | | -static const struct file_operations cifs_security_flags_proc_fops = { |
|---|
| 862 | | - .open = cifs_security_flags_proc_open, |
|---|
| 863 | | - .read = seq_read, |
|---|
| 864 | | - .llseek = seq_lseek, |
|---|
| 865 | | - .release = single_release, |
|---|
| 866 | | - .write = cifs_security_flags_proc_write, |
|---|
| 987 | +static const struct proc_ops cifs_security_flags_proc_ops = { |
|---|
| 988 | + .proc_open = cifs_security_flags_proc_open, |
|---|
| 989 | + .proc_read = seq_read, |
|---|
| 990 | + .proc_lseek = seq_lseek, |
|---|
| 991 | + .proc_release = single_release, |
|---|
| 992 | + .proc_write = cifs_security_flags_proc_write, |
|---|
| 867 | 993 | }; |
|---|
| 868 | 994 | #else |
|---|
| 869 | 995 | inline void cifs_proc_init(void) |
|---|