nfs_krpc.c (190220) | nfs_krpc.c (190293) |
---|---|
1/*- 2 * Copyright (c) 1989, 1991, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1991, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_krpc.c 190220 2009-03-21 21:49:07Z rwatson $"); | 36__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_krpc.c 190293 2009-03-22 22:07:52Z rwatson $"); |
37 38/* 39 * Socket operations for use by nfs 40 */ 41 42#include "opt_inet6.h" | 37 38/* 39 * Socket operations for use by nfs 40 */ 41 42#include "opt_inet6.h" |
43#include "opt_kdtrace.h" |
|
43#include "opt_kgssapi.h" 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/kernel.h> 48#include <sys/limits.h> 49#include <sys/lock.h> 50#include <sys/malloc.h> --- 17 unchanged lines hidden (view full) --- 68#include <nfsclient/nfsm_subs.h> 69#include <nfsclient/nfsmount.h> 70#include <nfsclient/nfsnode.h> 71 72#include <nfs4client/nfs4.h> 73 74#ifndef NFS_LEGACYRPC 75 | 44#include "opt_kgssapi.h" 45 46#include <sys/param.h> 47#include <sys/systm.h> 48#include <sys/kernel.h> 49#include <sys/limits.h> 50#include <sys/lock.h> 51#include <sys/malloc.h> --- 17 unchanged lines hidden (view full) --- 69#include <nfsclient/nfsm_subs.h> 70#include <nfsclient/nfsmount.h> 71#include <nfsclient/nfsnode.h> 72 73#include <nfs4client/nfs4.h> 74 75#ifndef NFS_LEGACYRPC 76 |
77#ifdef KDTRACE_HOOKS 78#include <sys/dtrace_bsd.h> 79 80dtrace_nfsclient_nfs23_start_probe_func_t 81 dtrace_nfsclient_nfs23_start_probe; 82 83dtrace_nfsclient_nfs23_done_probe_func_t 84 dtrace_nfsclient_nfs23_done_probe; 85 86/* 87 * Registered probes by RPC type. 88 */ 89uint32_t nfsclient_nfs2_start_probes[NFS_NPROCS]; 90uint32_t nfsclient_nfs2_done_probes[NFS_NPROCS]; 91 92uint32_t nfsclient_nfs3_start_probes[NFS_NPROCS]; 93uint32_t nfsclient_nfs3_done_probes[NFS_NPROCS]; 94#endif 95 |
|
76static int nfs_realign_test; 77static int nfs_realign_count; 78static int nfs_bufpackets = 4; 79static int nfs_reconnects; 80static int nfs3_jukebox_delay = 10; 81static int nfs_skip_wcc_data_onerr = 1; 82static int fake_wchan; 83 --- 379 unchanged lines hidden (view full) --- 463 */ 464 timer = nfs_rto_timer(procnum); 465 if (timer != NFS_DEFAULT_TIMER) { 466 ext.rc_timers = &nmp->nm_timers[timer - 1]; 467 } else { 468 ext.rc_timers = NULL; 469 } 470 | 96static int nfs_realign_test; 97static int nfs_realign_count; 98static int nfs_bufpackets = 4; 99static int nfs_reconnects; 100static int nfs3_jukebox_delay = 10; 101static int nfs_skip_wcc_data_onerr = 1; 102static int fake_wchan; 103 --- 379 unchanged lines hidden (view full) --- 483 */ 484 timer = nfs_rto_timer(procnum); 485 if (timer != NFS_DEFAULT_TIMER) { 486 ext.rc_timers = &nmp->nm_timers[timer - 1]; 487 } else { 488 ext.rc_timers = NULL; 489 } 490 |
491#ifdef KDTRACE_HOOKS 492 if (dtrace_nfsclient_nfs23_start_probe != NULL) { 493 uint32_t probe_id; 494 int probe_procnum; 495 496 if (nmp->nm_flag & NFSMNT_NFSV3) { 497 probe_id = nfsclient_nfs3_start_probes[procnum]; 498 probe_procnum = procnum; 499 } else { 500 probe_id = nfsclient_nfs2_start_probes[procnum]; 501 probe_procnum = (nmp->nm_flag & NFSMNT_NFSV3) ? 502 procnum : nfsv2_procid[procnum]; 503 } 504 if (probe_id != 0) 505 (dtrace_nfsclient_nfs23_start_probe)(probe_id, vp, 506 mreq, cred, probe_procnum); 507 } 508#endif 509 |
|
471 nfsstats.rpcrequests++; 472tryagain: 473 timo.tv_sec = nmp->nm_timeo / NFS_HZ; 474 timo.tv_usec = (nmp->nm_timeo * 1000000) / NFS_HZ; 475 mrep = NULL; 476 stat = CLNT_CALL_MBUF(nmp->nm_client, &ext, 477 (nmp->nm_flag & NFSMNT_NFSV3) ? procnum : nfsv2_procid[procnum], 478 mreq, &mrep, timo); --- 51 unchanged lines hidden (view full) --- 530 *mdp = md; 531 *dposp = dpos; 532 error |= NFSERR_RETERR; 533 } else 534 m_freem(mrep); 535 goto nfsmout; 536 } 537 | 510 nfsstats.rpcrequests++; 511tryagain: 512 timo.tv_sec = nmp->nm_timeo / NFS_HZ; 513 timo.tv_usec = (nmp->nm_timeo * 1000000) / NFS_HZ; 514 mrep = NULL; 515 stat = CLNT_CALL_MBUF(nmp->nm_client, &ext, 516 (nmp->nm_flag & NFSMNT_NFSV3) ? procnum : nfsv2_procid[procnum], 517 mreq, &mrep, timo); --- 51 unchanged lines hidden (view full) --- 569 *mdp = md; 570 *dposp = dpos; 571 error |= NFSERR_RETERR; 572 } else 573 m_freem(mrep); 574 goto nfsmout; 575 } 576 |
577#ifdef KDTRACE_HOOKS 578 if (dtrace_nfsclient_nfs23_done_probe != NULL) { 579 uint32_t probe_id; 580 int probe_procnum; 581 582 if (nmp->nm_flag & NFSMNT_NFSV3) { 583 probe_id = nfsclient_nfs3_done_probes[procnum]; 584 probe_procnum = procnum; 585 } else { 586 probe_id = nfsclient_nfs2_done_probes[procnum]; 587 probe_procnum = (nmp->nm_flag & NFSMNT_NFSV3) ? 588 procnum : nfsv2_procid[procnum]; 589 } 590 if (probe_id != 0) 591 (dtrace_nfsclient_nfs23_done_probe)(probe_id, vp, 592 mreq, cred, probe_procnum, 0); 593 } 594#endif |
|
538 m_freem(mreq); 539 *mrp = mrep; 540 *mdp = md; 541 *dposp = dpos; 542 AUTH_DESTROY(auth); 543 return (0); 544 545nfsmout: | 595 m_freem(mreq); 596 *mrp = mrep; 597 *mdp = md; 598 *dposp = dpos; 599 AUTH_DESTROY(auth); 600 return (0); 601 602nfsmout: |
603#ifdef KDTRACE_HOOKS 604 if (dtrace_nfsclient_nfs23_done_probe != NULL) { 605 uint32_t probe_id; 606 int probe_procnum; 607 608 if (nmp->nm_flag & NFSMNT_NFSV3) { 609 probe_id = nfsclient_nfs3_done_probes[procnum]; 610 probe_procnum = procnum; 611 } else { 612 probe_id = nfsclient_nfs2_done_probes[procnum]; 613 probe_procnum = (nmp->nm_flag & NFSMNT_NFSV3) ? 614 procnum : nfsv2_procid[procnum]; 615 } 616 if (probe_id != 0) 617 (dtrace_nfsclient_nfs23_done_probe)(probe_id, vp, 618 mreq, cred, probe_procnum, error); 619 } 620#endif |
|
546 m_freem(mreq); 547 if (auth) 548 AUTH_DESTROY(auth); 549 return (error); 550} 551 552/* 553 * Mark all of an nfs mount's outstanding requests with R_SOFTTERM and --- 211 unchanged lines hidden --- | 621 m_freem(mreq); 622 if (auth) 623 AUTH_DESTROY(auth); 624 return (error); 625} 626 627/* 628 * Mark all of an nfs mount's outstanding requests with R_SOFTTERM and --- 211 unchanged lines hidden --- |