Deleted Added
full compact
nfs_commonkrpc.c (221973) nfs_commonkrpc.c (223280)
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

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 */
33
34#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

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/fs/nfs/nfs_commonkrpc.c 221973 2011-05-15 20:52:43Z rmacklem $");
35__FBSDID("$FreeBSD: head/sys/fs/nfs/nfs_commonkrpc.c 223280 2011-06-18 23:02:53Z rmacklem $");
36
37/*
38 * Socket operations for use by nfs
39 */
40
41#include "opt_inet6.h"
36
37/*
38 * Socket operations for use by nfs
39 */
40
41#include "opt_inet6.h"
42#include "opt_kdtrace.h"
42#include "opt_kgssapi.h"
43#include "opt_nfs.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>

--- 9 unchanged lines hidden (view full) ---

59#include <sys/vnode.h>
60
61#include <rpc/rpc.h>
62
63#include <kgssapi/krb5/kcrypto.h>
64
65#include <fs/nfs/nfsport.h>
66
43#include "opt_kgssapi.h"
44#include "opt_nfs.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>

--- 9 unchanged lines hidden (view full) ---

60#include <sys/vnode.h>
61
62#include <rpc/rpc.h>
63
64#include <kgssapi/krb5/kcrypto.h>
65
66#include <fs/nfs/nfsport.h>
67
68#ifdef KDTRACE_HOOKS
69#include <sys/dtrace_bsd.h>
70
71dtrace_nfsclient_nfs23_start_probe_func_t
72 dtrace_nfscl_nfs234_start_probe;
73
74dtrace_nfsclient_nfs23_done_probe_func_t
75 dtrace_nfscl_nfs234_done_probe;
76
77/*
78 * Registered probes by RPC type.
79 */
80uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1];
81uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1];
82
83uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1];
84uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1];
85
86uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1];
87uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1];
88#endif
89
67NFSSTATESPINLOCK;
68NFSREQSPINLOCK;
69extern struct nfsstats newnfsstats;
70extern struct nfsreqhead nfsd_reqq;
71extern int nfscl_ticks;
72extern void (*ncl_call_invalcaches)(struct vnode *);
73
74static int nfsrv_gsscallbackson = 0;

--- 488 unchanged lines hidden (view full) ---

563 /*
564 * Now only used for the R_DONTRECOVER case, but until that is
565 * supported within the krpc code, I need to keep a queue of
566 * outstanding RPCs for nfsv4 client requests.
567 */
568 if ((nd->nd_flag & ND_NFSV4) && procnum == NFSV4PROC_COMPOUND)
569 MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq),
570 M_NFSDREQ, M_WAITOK);
90NFSSTATESPINLOCK;
91NFSREQSPINLOCK;
92extern struct nfsstats newnfsstats;
93extern struct nfsreqhead nfsd_reqq;
94extern int nfscl_ticks;
95extern void (*ncl_call_invalcaches)(struct vnode *);
96
97static int nfsrv_gsscallbackson = 0;

--- 488 unchanged lines hidden (view full) ---

586 /*
587 * Now only used for the R_DONTRECOVER case, but until that is
588 * supported within the krpc code, I need to keep a queue of
589 * outstanding RPCs for nfsv4 client requests.
590 */
591 if ((nd->nd_flag & ND_NFSV4) && procnum == NFSV4PROC_COMPOUND)
592 MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq),
593 M_NFSDREQ, M_WAITOK);
594#ifdef KDTRACE_HOOKS
595 if (dtrace_nfscl_nfs234_start_probe != NULL) {
596 uint32_t probe_id;
597 int probe_procnum;
598
599 if (nd->nd_flag & ND_NFSV4) {
600 probe_id =
601 nfscl_nfs4_start_probes[nd->nd_procnum];
602 probe_procnum = nd->nd_procnum;
603 } else if (nd->nd_flag & ND_NFSV3) {
604 probe_id = nfscl_nfs3_start_probes[procnum];
605 probe_procnum = procnum;
606 } else {
607 probe_id =
608 nfscl_nfs2_start_probes[nd->nd_procnum];
609 probe_procnum = procnum;
610 }
611 if (probe_id != 0)
612 (dtrace_nfscl_nfs234_start_probe)
613 (probe_id, vp, nd->nd_mreq, cred,
614 probe_procnum);
615 }
616#endif
571 }
572 trycnt = 0;
573tryagain:
574 if (nmp == NULL) {
575 timo.tv_usec = 0;
576 if (clp == NULL)
577 timo.tv_sec = NFSV4_UPCALLTIMEO;
578 else

--- 178 unchanged lines hidden (view full) ---

757 */
758 if ((nd->nd_repstat == NFSERR_STALECLIENTID ||
759 nd->nd_repstat == NFSERR_STALESTATEID) &&
760 rep != NULL && (rep->r_flags & R_DONTRECOVER))
761 nd->nd_repstat = NFSERR_STALEDONTRECOVER;
762 }
763 }
764
617 }
618 trycnt = 0;
619tryagain:
620 if (nmp == NULL) {
621 timo.tv_usec = 0;
622 if (clp == NULL)
623 timo.tv_sec = NFSV4_UPCALLTIMEO;
624 else

--- 178 unchanged lines hidden (view full) ---

803 */
804 if ((nd->nd_repstat == NFSERR_STALECLIENTID ||
805 nd->nd_repstat == NFSERR_STALESTATEID) &&
806 rep != NULL && (rep->r_flags & R_DONTRECOVER))
807 nd->nd_repstat = NFSERR_STALEDONTRECOVER;
808 }
809 }
810
811#ifdef KDTRACE_HOOKS
812 if (nmp != NULL && dtrace_nfscl_nfs234_done_probe != NULL) {
813 uint32_t probe_id;
814 int probe_procnum;
815
816 if (nd->nd_flag & ND_NFSV4) {
817 probe_id = nfscl_nfs4_done_probes[nd->nd_procnum];
818 probe_procnum = nd->nd_procnum;
819 } else if (nd->nd_flag & ND_NFSV3) {
820 probe_id = nfscl_nfs3_done_probes[procnum];
821 probe_procnum = procnum;
822 } else {
823 probe_id = nfscl_nfs2_done_probes[nd->nd_procnum];
824 probe_procnum = procnum;
825 }
826 if (probe_id != 0)
827 (dtrace_nfscl_nfs234_done_probe)(probe_id, vp,
828 nd->nd_mreq, cred, probe_procnum, 0);
829 }
830#endif
831
765 m_freem(nd->nd_mreq);
766 AUTH_DESTROY(auth);
767 if (rep != NULL)
768 FREE((caddr_t)rep, M_NFSDREQ);
769 if (set_sigset)
770 newnfs_restore_sigmask(td, &oldset);
771 return (0);
772nfsmout:

--- 220 unchanged lines hidden ---
832 m_freem(nd->nd_mreq);
833 AUTH_DESTROY(auth);
834 if (rep != NULL)
835 FREE((caddr_t)rep, M_NFSDREQ);
836 if (set_sigset)
837 newnfs_restore_sigmask(td, &oldset);
838 return (0);
839nfsmout:

--- 220 unchanged lines hidden ---