Date: Mon, 20 Jun 2011 00:53:58 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 195000 for review Message-ID: <201106200053.p5K0rw6D052925@skunkworks.freebsd.org>
index | next in thread | raw e-mail
http://p4web.freebsd.org/@@195000?ac=10 Change 195000 by jhb@jhb_jhbbsd on 2011/06/20 00:53:15 IFC @194999 Affected files ... .. //depot/projects/pci/sys/amd64/ia32/ia32_sigtramp.S#3 integrate .. //depot/projects/pci/sys/boot/common/load_elf_obj.c#3 integrate .. //depot/projects/pci/sys/boot/i386/libi386/biosacpi.c#2 integrate .. //depot/projects/pci/sys/cam/ata/ata_da.c#4 integrate .. //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h#2 integrate .. //depot/projects/pci/sys/conf/files.powerpc#4 integrate .. //depot/projects/pci/sys/dev/acpica/acpi.c#6 integrate .. //depot/projects/pci/sys/dev/acpica/acpi_pci.c#4 integrate .. //depot/projects/pci/sys/dev/pccbb/pccbb.c#2 integrate .. //depot/projects/pci/sys/dev/usb/net/if_udav.c#3 integrate .. //depot/projects/pci/sys/dev/usb/usbdevs#4 integrate .. //depot/projects/pci/sys/fs/nfs/nfs_commonkrpc.c#4 integrate .. //depot/projects/pci/sys/fs/nfs/nfsport.h#3 integrate .. //depot/projects/pci/sys/fs/nfs/nfsproto.h#3 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clbio.c#4 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clkdtrace.c#1 branch .. //depot/projects/pci/sys/fs/nfsclient/nfs_clkrpc.c#3 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clnode.c#3 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clport.c#5 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clsubs.c#4 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_clvnops.c#4 integrate .. //depot/projects/pci/sys/fs/nfsclient/nfs_kdtrace.h#1 branch .. //depot/projects/pci/sys/fs/nfsserver/nfs_nfsdcache.c#2 integrate .. //depot/projects/pci/sys/fs/nfsserver/nfs_nfsdkrpc.c#3 integrate .. //depot/projects/pci/sys/kern/sys_process.c#3 integrate .. //depot/projects/pci/sys/kgssapi/gss_impl.c#2 integrate .. //depot/projects/pci/sys/modules/Makefile#5 integrate .. //depot/projects/pci/sys/modules/dtrace/Makefile#3 integrate .. //depot/projects/pci/sys/modules/dtrace/dtnfscl/Makefile#1 branch .. //depot/projects/pci/sys/modules/dtrace/dtraceall/dtraceall.c#3 integrate .. //depot/projects/pci/sys/modules/kgssapi_krb5/Makefile#2 integrate .. //depot/projects/pci/sys/net/if_gre.c#2 integrate .. //depot/projects/pci/sys/net/if_gre.h#2 integrate .. //depot/projects/pci/sys/netinet/if_ether.c#3 integrate .. //depot/projects/pci/sys/nfsclient/nfs_krpc.c#3 integrate .. //depot/projects/pci/sys/nfsserver/nfs_srvkrpc.c#2 integrate .. //depot/projects/pci/sys/powerpc/ps3/ohci_ps3.c#1 branch .. //depot/projects/pci/sys/powerpc/ps3/ps3bus.c#3 integrate .. //depot/projects/pci/sys/powerpc/ps3/ps3bus.h#2 integrate .. //depot/projects/pci/sys/powerpc/ps3/ps3disk.c#1 branch .. //depot/projects/pci/sys/rpc/rpc_generic.c#2 integrate .. //depot/projects/pci/sys/rpc/rpcsec_gss.h#2 integrate .. //depot/projects/pci/sys/sparc64/sparc64/intr_machdep.c#3 integrate .. //depot/projects/pci/sys/sys/diskpc98.h#2 integrate .. //depot/projects/pci/sys/sys/dtrace_bsd.h#3 integrate .. //depot/projects/pci/sys/sys/param.h#5 integrate .. //depot/projects/pci/sys/ufs/ffs/ffs_snapshot.c#3 integrate .. //depot/projects/pci/sys/vm/vm_fault.c#3 integrate .. //depot/projects/pci/sys/vm/vm_page.c#4 integrate .. //depot/projects/pci/sys/vm/vm_page.h#4 integrate .. //depot/projects/pci/sys/x86/x86/tsc.c#6 integrate Differences ... ==== //depot/projects/pci/sys/amd64/ia32/ia32_sigtramp.S#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/ia32/ia32_sigtramp.S,v 1.6 2011/04/01 11:16:29 kib Exp $ + * $FreeBSD: src/sys/amd64/ia32/ia32_sigtramp.S,v 1.7 2011/06/18 12:13:28 kib Exp $ */ #include "opt_compat.h" @@ -79,8 +79,20 @@ jmp 1b +/* + * The lcall $7,$0 emulator cannot use the call gate that does an + * inter-privilege transition. The reason is that the call gate + * does not disable interrupts, and, before the swapgs is + * executed, we would have a window where the ring 0 code is + * executed with the wrong gsbase. + * + * Instead, reflect the lcall $7,$0 back to ring 3 trampoline + * which sets up the frame for int $0x80. + */ ALIGN_TEXT lcall_tramp: + cmpl $SYS_vfork,%eax + je 2f pushl %ebp movl %esp,%ebp pushl 0x24(%ebp) /* arg 6 */ @@ -91,8 +103,19 @@ pushl 0x10(%ebp) /* arg 1 */ pushl 0xc(%ebp) /* gap */ int $0x80 - leave + leavel +1: lretl +2: + /* + * vfork handling is special and relies on the libc stub saving + * the return ip in %ecx. If vfork failed, then there is no + * child which can corrupt the frame created by call gate. + */ + int $0x80 + jb 1b + addl $8,%esp + jmpl *%ecx #endif ALIGN_TEXT ==== //depot/projects/pci/sys/boot/common/load_elf_obj.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.4 2011/04/03 22:31:51 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.5 2011/06/19 13:35:41 kan Exp $"); #include <sys/param.h> #include <sys/exec.h> @@ -196,7 +196,7 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) { Elf_Ehdr *hdr; - Elf_Shdr *shdr; + Elf_Shdr *shdr, *cshdr, *lshdr; vm_offset_t firstaddr, lastaddr; int i, nsym, res, ret, shdrbytes, symstrindex; @@ -294,12 +294,35 @@ /* Clear the whole area, including bss regions. */ kern_bzero(firstaddr, lastaddr - firstaddr); - /* Now read it all in. */ - for (i = 0; i < hdr->e_shnum; i++) { - if (shdr[i].sh_addr == 0 || shdr[i].sh_type == SHT_NOBITS) - continue; - if (kern_pread(ef->fd, (vm_offset_t)shdr[i].sh_addr, - shdr[i].sh_size, (off_t)shdr[i].sh_offset) != 0) { + /* Figure section with the lowest file offset we haven't loaded yet. */ + for (cshdr = NULL; /* none */; /* none */) + { + /* + * Find next section to load. The complexity of this loop is + * O(n^2), but with the number of sections being typically + * small, we do not care. + */ + lshdr = cshdr; + + for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_addr == 0 || + shdr[i].sh_type == SHT_NOBITS) + continue; + /* Skip sections that were loaded already. */ + if (lshdr != NULL && + lshdr->sh_offset >= shdr[i].sh_offset) + continue; + /* Find section with smallest offset. */ + if (cshdr == lshdr || + cshdr->sh_offset > shdr[i].sh_offset) + cshdr = &shdr[i]; + } + + if (cshdr == lshdr) + break; + + if (kern_pread(ef->fd, (vm_offset_t)cshdr->sh_addr, + cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) { printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_obj_loadimage: read failed\n"); goto out; ==== //depot/projects/pci/sys/boot/i386/libi386/biosacpi.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosacpi.c,v 1.15 2010/11/08 21:50:45 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosacpi.c,v 1.16 2011/06/18 13:56:33 benl Exp $"); #include <stand.h> #include <machine/stdarg.h> @@ -61,7 +61,7 @@ return; /* export values from the RSDP */ - sprintf(buf, "%p", VTOP(rsdp)); + sprintf(buf, "%u", VTOP(rsdp)); setenv("hint.acpi.0.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) ==== //depot/projects/pci/sys/cam/ata/ata_da.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/ata/ata_da.c,v 1.34 2011/06/14 17:10:32 gibbs Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/ata/ata_da.c,v 1.35 2011/06/18 22:26:58 kib Exp $"); #include "opt_ada.h" #include "opt_ata.h" @@ -818,7 +818,7 @@ int ret = -1; struct cam_periph *periph; - if (bp->bio_disk == NULL || bp->bio_disk->d_drv1) + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) return ENXIO; periph = (struct cam_periph *)bp->bio_disk->d_drv1; if (periph->path == NULL) ==== //depot/projects/pci/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h#2 (text+ko) ==== @@ -65,7 +65,7 @@ * filling in ctf_sect_t structures and passing them to ctf_bufopen(): */ typedef struct ctf_sect { - char *cts_name; /* section name (if any) */ + const char *cts_name; /* section name (if any) */ ulong_t cts_type; /* section type (ELF SHT_... value) */ ulong_t cts_flags; /* section flags (ELF SHF_... value) */ #if defined(sun) ==== //depot/projects/pci/sys/conf/files.powerpc#4 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.powerpc,v 1.130 2011/06/04 15:17:35 andreast Exp $ +# $FreeBSD: src/sys/conf/files.powerpc,v 1.132 2011/06/20 00:46:07 nwhitehorn Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -203,11 +203,13 @@ powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci +powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 powerpc/ps3/ps3ata.c optional ps3 ps3ata powerpc/ps3/ps3bus.c optional ps3 +powerpc/ps3/ps3disk.c optional ps3 powerpc/ps3/ps3pic.c optional ps3 powerpc/ps3/ps3_syscons.c optional ps3 sc powerpc/ps3/ps3-hvcall.S optional ps3 sc ==== //depot/projects/pci/sys/dev/acpica/acpi.c#6 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.302 2011/06/10 12:30:16 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.303 2011/06/17 21:19:01 jhb Exp $"); #include "opt_acpi.h" #include <sys/param.h> ==== //depot/projects/pci/sys/dev/acpica/acpi_pci.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.38 2011/01/18 14:58:44 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci.c,v 1.39 2011/06/17 21:19:01 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> ==== //depot/projects/pci/sys/dev/pccbb/pccbb.c#2 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.184 2011/01/12 19:53:56 mdf Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pccbb/pccbb.c,v 1.186 2011/06/18 03:16:51 imp Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -800,24 +800,36 @@ * We have a shortish timeout of 500ms here. Some bridges do * not generate a POWER_CYCLE event for 16-bit cards. In * those cases, we have to cope the best we can, and having - * only a short delay is better than the alternatives. + * only a short delay is better than the alternatives. Others + * raise the power cycle a smidge before it is really ready. + * We deal with those below. */ sane = 10; while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) && cnt == sc->powerintr && sane-- > 0) msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20); mtx_unlock(&sc->mtx); + + /* + * Relax for 100ms. Some bridges appear to assert this signal + * right away, but before the card has stabilized. Other + * cards need need more time to cope up reliabily. + * Experiments with troublesome setups show this to be a + * "cheap" way to enhance reliabilty. We need not do this for + * "off" since we don't touch the card after we turn it off. + */ + pause("cbbPwr", min(hz / 10, 1)); + /* * The TOPIC95B requires a little bit extra time to get its * act together, so delay for an additional 100ms. Also as * documented below, it doesn't seem to set the POWER_CYCLE * bit, so don't whine if it never came on. */ - if (sc->chipset == CB_TOPIC95) { + if (sc->chipset == CB_TOPIC95) pause("cbb95B", hz / 10); - } else if (sane <= 0) { + else if (sane <= 0) device_printf(sc->dev, "power timeout, doom?\n"); - } } /* ==== //depot/projects/pci/sys/dev/usb/net/if_udav.c#3 (text+ko) ==== @@ -1,6 +1,6 @@ /* $NetBSD: if_udav.c,v 1.2 2003/09/04 15:17:38 tsutsui Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ -/* $FreeBSD: src/sys/dev/usb/net/if_udav.c,v 1.17 2011/05/03 19:51:29 marius Exp $ */ +/* $FreeBSD: src/sys/dev/usb/net/if_udav.c,v 1.18 2011/06/19 08:34:10 hselasky Exp $ */ /*- * Copyright (c) 2003 * Shingo WATANABE <nabe@nabechan.org>. All rights reserved. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/usb/net/if_udav.c,v 1.17 2011/05/03 19:51:29 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/net/if_udav.c,v 1.18 2011/06/19 08:34:10 hselasky Exp $"); #include <sys/stdint.h> #include <sys/stddef.h> @@ -210,6 +210,7 @@ {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, }; static void ==== //depot/projects/pci/sys/dev/usb/usbdevs#4 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.511 2011/06/01 17:58:27 hselasky Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.512 2011/06/19 08:34:10 hselasky Exp $ /* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */ /*- @@ -2014,6 +2014,7 @@ /* Kontron AG products */ product KONTRON DM9601 0x8101 USB Ethernet +product KONTRON JP1082 0x9700 USB Ethernet /* Konica Corp. Products */ product KONICA CAMERA 0x0720 Digital Color Camera ==== //depot/projects/pci/sys/fs/nfs/nfs_commonkrpc.c#4 (text+ko) ==== @@ -32,13 +32,14 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfs/nfs_commonkrpc.c,v 1.11 2011/05/15 20:52:43 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfs/nfs_commonkrpc.c,v 1.13 2011/06/19 22:08:55 rmacklem Exp $"); /* * Socket operations for use by nfs */ #include "opt_inet6.h" +#include "opt_kdtrace.h" #include "opt_kgssapi.h" #include "opt_nfs.h" @@ -64,6 +65,28 @@ #include <fs/nfs/nfsport.h> +#ifdef KDTRACE_HOOKS +#include <sys/dtrace_bsd.h> + +dtrace_nfsclient_nfs23_start_probe_func_t + dtrace_nfscl_nfs234_start_probe; + +dtrace_nfsclient_nfs23_done_probe_func_t + dtrace_nfscl_nfs234_done_probe; + +/* + * Registered probes by RPC type. + */ +uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1]; +uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1]; + +uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1]; +uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1]; + +uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1]; +uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1]; +#endif + NFSSTATESPINLOCK; NFSREQSPINLOCK; extern struct nfsstats newnfsstats; @@ -300,9 +323,7 @@ client = nrp->nr_client; nrp->nr_client = NULL; mtx_unlock(&nrp->nr_mtx); -#ifdef KGSSAPI - rpc_gss_secpurge(client); -#endif + rpc_gss_secpurge_call(client); CLNT_CLOSE(client); CLNT_RELEASE(client); } else { @@ -314,21 +335,18 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal, char *srv_principal, gss_OID mech_oid, struct ucred *cred) { -#ifdef KGSSAPI rpc_gss_service_t svc; AUTH *auth; #ifdef notyet rpc_gss_options_req_t req_options; #endif -#endif switch (secflavour) { -#ifdef KGSSAPI case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: if (!mech_oid) { - if (!rpc_gss_mech_to_oid("kerberosv5", &mech_oid)) + if (!rpc_gss_mech_to_oid_call("kerberosv5", &mech_oid)) return (NULL); } if (secflavour == RPCSEC_GSS_KRB5) @@ -344,7 +362,7 @@ req_options.input_channel_bindings = NULL; req_options.enc_type = nfs_keytab_enctype; - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, clnt_principal, srv_principal, mech_oid, svc, &req_options); #else @@ -354,7 +372,7 @@ * principals. As such, that case cannot yet be handled. */ if (clnt_principal == NULL) - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, srv_principal, mech_oid, svc); else auth = NULL; @@ -362,7 +380,6 @@ if (auth != NULL) return (auth); /* fallthrough */ -#endif /* KGSSAPI */ case AUTH_SYS: default: return (authunix_create(cred)); @@ -568,6 +585,29 @@ if ((nd->nd_flag & ND_NFSV4) && procnum == NFSV4PROC_COMPOUND) MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq), M_NFSDREQ, M_WAITOK); +#ifdef KDTRACE_HOOKS + if (dtrace_nfscl_nfs234_start_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nd->nd_flag & ND_NFSV4) { + probe_id = + nfscl_nfs4_start_probes[nd->nd_procnum]; + probe_procnum = nd->nd_procnum; + } else if (nd->nd_flag & ND_NFSV3) { + probe_id = nfscl_nfs3_start_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = + nfscl_nfs2_start_probes[nd->nd_procnum]; + probe_procnum = procnum; + } + if (probe_id != 0) + (dtrace_nfscl_nfs234_start_probe) + (probe_id, vp, nd->nd_mreq, cred, + probe_procnum); + } +#endif } trycnt = 0; tryagain: @@ -762,6 +802,27 @@ } } +#ifdef KDTRACE_HOOKS + if (nmp != NULL && dtrace_nfscl_nfs234_done_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nd->nd_flag & ND_NFSV4) { + probe_id = nfscl_nfs4_done_probes[nd->nd_procnum]; + probe_procnum = nd->nd_procnum; + } else if (nd->nd_flag & ND_NFSV3) { + probe_id = nfscl_nfs3_done_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = nfscl_nfs2_done_probes[nd->nd_procnum]; + probe_procnum = procnum; + } + if (probe_id != 0) + (dtrace_nfscl_nfs234_done_probe)(probe_id, vp, + nd->nd_mreq, cred, probe_procnum, 0); + } +#endif + m_freem(nd->nd_mreq); AUTH_DESTROY(auth); if (rep != NULL) ==== //depot/projects/pci/sys/fs/nfs/nfsport.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/nfs/nfsport.h,v 1.23 2011/04/25 13:09:32 rmacklem Exp $ + * $FreeBSD: src/sys/fs/nfs/nfsport.h,v 1.24 2011/06/18 23:02:53 rmacklem Exp $ */ #ifndef _NFS_NFSPORT_H_ @@ -267,6 +267,7 @@ * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is * one greater than the last number. */ +#ifndef NFS_V3NPROCS #define NFS_V3NPROCS 22 #define NFSPROC_LOOKUPP 22 @@ -293,6 +294,7 @@ * Must be defined as one higher than the last Proc# above. */ #define NFSV4_NPROCS 41 +#endif /* NFS_V3NPROCS */ /* * Stats structure @@ -358,7 +360,9 @@ /* * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code. */ +#ifndef NFS_NPROCS #define NFS_NPROCS NFSV4_NPROCS +#endif #include <fs/nfs/nfskpiport.h> #include <fs/nfs/nfsdport.h> ==== //depot/projects/pci/sys/fs/nfs/nfsproto.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/fs/nfs/nfsproto.h,v 1.3 2011/05/04 22:02:33 rmacklem Exp $ + * $FreeBSD: src/sys/fs/nfs/nfsproto.h,v 1.4 2011/06/18 23:02:53 rmacklem Exp $ */ #ifndef _NFS_NFSPROTO_H_ @@ -226,6 +226,48 @@ #define NFSPROC_COMMIT 21 /* + * The lower numbers -> 21 are used by NFSv2 and v3. These define higher + * numbers used by NFSv4. + * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is + * one greater than the last number. + */ +#ifndef NFS_V3NPROCS +#define NFS_V3NPROCS 22 + +#define NFSPROC_LOOKUPP 22 +#define NFSPROC_SETCLIENTID 23 +#define NFSPROC_SETCLIENTIDCFRM 24 +#define NFSPROC_LOCK 25 +#define NFSPROC_LOCKU 26 +#define NFSPROC_OPEN 27 +#define NFSPROC_CLOSE 28 +#define NFSPROC_OPENCONFIRM 29 +#define NFSPROC_LOCKT 30 +#define NFSPROC_OPENDOWNGRADE 31 +#define NFSPROC_RENEW 32 +#define NFSPROC_PUTROOTFH 33 +#define NFSPROC_RELEASELCKOWN 34 +#define NFSPROC_DELEGRETURN 35 +#define NFSPROC_RETDELEGREMOVE 36 +#define NFSPROC_RETDELEGRENAME1 37 +#define NFSPROC_RETDELEGRENAME2 38 +#define NFSPROC_GETACL 39 +#define NFSPROC_SETACL 40 + +/* + * Must be defined as one higher than the last Proc# above. + */ +#define NFSV4_NPROCS 41 +#endif /* NFS_V3NPROCS */ + +/* + * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code. + */ +#ifndef NFS_NPROCS +#define NFS_NPROCS NFSV4_NPROCS +#endif + +/* * NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure * or Operation#. Since the NFS V4 Op #s go higher, use NFSV4OP_NOPS, which * is one greater than the highest Op#. ==== //depot/projects/pci/sys/fs/nfsclient/nfs_clbio.c#4 (text+ko) ==== @@ -33,7 +33,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clbio.c,v 1.23 2011/06/01 21:00:28 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clbio.c,v 1.24 2011/06/18 23:02:53 rmacklem Exp $"); + +#include "opt_kdtrace.h" #include <sys/param.h> #include <sys/systm.h> @@ -55,6 +57,7 @@ #include <fs/nfsclient/nfsmount.h> #include <fs/nfsclient/nfs.h> #include <fs/nfsclient/nfsnode.h> +#include <fs/nfsclient/nfs_kdtrace.h> extern int newnfs_directio_allow_mmap; extern struct nfsstats newnfsstats; @@ -399,6 +402,7 @@ goto out; } np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; @@ -915,6 +919,7 @@ #endif flush_and_restart: np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); @@ -928,6 +933,7 @@ */ if (ioflag & IO_APPEND) { np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); @@ -1748,6 +1754,7 @@ mtx_lock(&np->n_mtx); np->n_flag |= NWRITEERR; np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); mtx_unlock(&np->n_mtx); } bp->b_dirtyoff = bp->b_dirtyend = 0; ==== //depot/projects/pci/sys/fs/nfsclient/nfs_clkrpc.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clkrpc.c,v 1.5 2011/05/15 20:52:43 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clkrpc.c,v 1.6 2011/06/19 22:08:55 rmacklem Exp $"); #include "opt_inet6.h" #include "opt_kgssapi.h" @@ -215,12 +215,9 @@ int nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args) { -#ifdef KGSSAPI char principal[128]; int error; -#endif -#ifdef KGSSAPI if (args != NULL) { error = copyinstr(args->principal, principal, sizeof(principal), NULL); @@ -229,7 +226,6 @@ } else { principal[0] = '\0'; } -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -244,20 +240,16 @@ NFSD_UNLOCK(); -#ifdef KGSSAPI if (principal[0] != '\0') - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif nfscbd_pool->sp_minthreads = 4; nfscbd_pool->sp_maxthreads = 4; svc_run(nfscbd_pool); -#ifdef KGSSAPI - rpc_gss_clear_svc_name(NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif + rpc_gss_clear_svc_name_call(NFS_CALLBCKPROG, NFSV4_CBVERS); NFSD_LOCK(); nfs_numnfscbd--; ==== //depot/projects/pci/sys/fs/nfsclient/nfs_clnode.c#3 (text+ko) ==== @@ -33,7 +33,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clnode.c,v 1.13 2011/04/16 23:20:21 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clnode.c,v 1.14 2011/06/18 23:02:53 rmacklem Exp $"); + +#include "opt_kdtrace.h" #include <sys/param.h> #include <sys/systm.h> @@ -53,6 +55,7 @@ #include <fs/nfsclient/nfsnode.h> #include <fs/nfsclient/nfsmount.h> #include <fs/nfsclient/nfs.h> +#include <fs/nfsclient/nfs_kdtrace.h> #include <nfs/nfs_lock.h> @@ -300,7 +303,9 @@ mtx_lock(&np->n_mtx); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; + KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); mtx_unlock(&np->n_mtx); } ==== //depot/projects/pci/sys/fs/nfsclient/nfs_clport.c#5 (text+ko) ==== @@ -32,7 +32,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clport.c,v 1.24 2011/06/05 20:22:56 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clport.c,v 1.25 2011/06/18 23:02:53 rmacklem Exp $"); + +#include "opt_kdtrace.h" /* * generally, I don't like #includes inside .h files, but it seems to @@ -43,6 +45,26 @@ #include <netinet/if_ether.h> #include <net/if_types.h> +#include <fs/nfsclient/nfs_kdtrace.h> + +#ifdef KDTRACE_HOOKS +dtrace_nfsclient_attrcache_flush_probe_func_t + dtrace_nfscl_attrcache_flush_done_probe; +uint32_t nfscl_attrcache_flush_done_id; + +dtrace_nfsclient_attrcache_get_hit_probe_func_t + dtrace_nfscl_attrcache_get_hit_probe; +uint32_t nfscl_attrcache_get_hit_id; + +dtrace_nfsclient_attrcache_get_miss_probe_func_t + dtrace_nfscl_attrcache_get_miss_probe; +uint32_t nfscl_attrcache_get_miss_id; + +dtrace_nfsclient_attrcache_load_probe_func_t + dtrace_nfscl_attrcache_load_done_probe; +uint32_t nfscl_attrcache_load_done_id; +#endif /* !KDTRACE_HOOKS */ + extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern struct vop_vector newnfs_vnodeops; extern struct vop_vector newnfs_fifoops; @@ -407,6 +429,7 @@ */ vap->va_size = np->n_size; np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); } else if (np->n_flag & NMODIFIED) { /* * We've modified the file: Use the larger @@ -439,9 +462,11 @@ * We detect this by for the mtime moving back. We invalidate the * attrcache when this happens. */ - if (timespeccmp(&mtime_save, &vap->va_mtime, >)) + if (timespeccmp(&mtime_save, &vap->va_mtime, >)) { /* Size changed or mtime went backwards */ np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + } if (vaper != NULL) { NFSBCOPY((caddr_t)vap, (caddr_t)vaper, sizeof(*vap)); if (np->n_flag & NCHG) { @@ -451,6 +476,10 @@ vaper->va_mtime = np->n_mtim; } } +#ifdef KDTRACE_HOOKS + if (np->n_attrstamp != 0) + KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0); +#endif NFSUNLOCKNODE(np); return (0); } ==== //depot/projects/pci/sys/fs/nfsclient/nfs_clsubs.c#4 (text+ko) ==== @@ -33,7 +33,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clsubs.c,v 1.13 2011/05/15 20:52:43 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clsubs.c,v 1.14 2011/06/18 23:02:53 rmacklem Exp $"); + +#include "opt_kdtrace.h" /* * These functions support the macros and help fiddle mbuf chains for @@ -68,6 +70,7 @@ #include <fs/nfsclient/nfsnode.h> #include <fs/nfsclient/nfsmount.h> #include <fs/nfsclient/nfs.h> +#include <fs/nfsclient/nfs_kdtrace.h> #include <netinet/in.h> @@ -238,6 +241,7 @@ #ifdef NFS_ACDEBUG mtx_unlock(&Giant); /* ncl_printf() */ #endif + KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); return( ENOENT); } newnfsstats.attrcache_hits++; @@ -267,6 +271,7 @@ #ifdef NFS_ACDEBUG mtx_unlock(&Giant); /* ncl_printf() */ #endif + KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap); return (0); } ==== //depot/projects/pci/sys/fs/nfsclient/nfs_clvnops.c#4 (text+ko) ==== @@ -33,12 +33,13 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clvnops.c,v 1.44 2011/06/05 20:22:56 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsclient/nfs_clvnops.c,v 1.45 2011/06/18 23:02:53 rmacklem Exp $"); /* * vnode op calls for Sun NFS version 2, 3 and 4 */ +#include "opt_kdtrace.h" #include "opt_inet.h" #include <sys/param.h> @@ -70,6 +71,7 @@ #include <fs/nfsclient/nfsnode.h> #include <fs/nfsclient/nfsmount.h> #include <fs/nfsclient/nfs.h> +#include <fs/nfsclient/nfs_kdtrace.h> #include <net/if.h> #include <netinet/in.h> @@ -77,6 +79,24 @@ #include <nfs/nfs_lock.h> +#ifdef KDTRACE_HOOKS +#include <sys/dtrace_bsd.h> + +dtrace_nfsclient_accesscache_flush_probe_func_t + dtrace_nfscl_accesscache_flush_done_probe; +uint32_t nfscl_accesscache_flush_done_id; + +dtrace_nfsclient_accesscache_get_probe_func_t + dtrace_nfscl_accesscache_get_hit_probe, + dtrace_nfscl_accesscache_get_miss_probe; +uint32_t nfscl_accesscache_get_hit_id; +uint32_t nfscl_accesscache_get_miss_id; + +dtrace_nfsclient_accesscache_load_probe_func_t + dtrace_nfscl_accesscache_load_done_probe; +uint32_t nfscl_accesscache_load_done_id; +#endif /* !KDTRACE_HOOKS */ + /* Defs */ #define TRUE 1 #define FALSE 0 @@ -298,9 +318,15 @@ mtx_unlock(&np->n_mtx); if (retmode != NULL) *retmode = rmode; + KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0); } else if (NFS_ISV4(vp)) { error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); } +#ifdef KDTRACE_HOOKS + if (error != 0) + KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, 0, + error); +#endif return (error); } @@ -397,6 +423,14 @@ } } mtx_unlock(&np->n_mtx); +#ifdef KDTRACE_HOOKS + if (gotahit != 0) + KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, + ap->a_cred->cr_uid, mode); + else + KDTRACE_NFS_ACCESSCACHE_GET_MISS(vp, + ap->a_cred->cr_uid, mode); +#endif if (gotahit == 0) { /* * Either a no, or a don't know. Go to the wire. @@ -507,6 +541,7 @@ } mtx_lock(&np->n_mtx); np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); if (vp->v_type == VDIR) np->n_direofoffset = 0; mtx_unlock(&np->n_mtx); @@ -692,8 +727,10 @@ * is the cause of some caching/coherency issue that might * crop up.) */ - if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0) + if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0) { np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + } if (np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; error = np->n_error; @@ -949,6 +986,7 @@ np->n_accesscache[i].stamp = 0; >>> TRUNCATED FOR MAIL (1000 lines) <<<help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106200053.p5K0rw6D052925>
