| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: nfs_socket.c,v 1.170.2.3 2009/05/04 10:28:53 yamt Exp $ */ | | 1 | /* $NetBSD: nfs_socket.c,v 1.170.2.4 2009/05/04 10:48:39 yamt Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1989, 1991, 1993, 1995 | | 4 | * Copyright (c) 1989, 1991, 1993, 1995 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Rick Macklem at The University of Guelph. | | 8 | * Rick Macklem at The University of Guelph. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -29,27 +29,27 @@ | | | @@ -29,27 +29,27 @@ |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | * | | 33 | * |
34 | * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 | | 34 | * @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95 |
35 | */ | | 35 | */ |
36 | | | 36 | |
37 | /* | | 37 | /* |
38 | * Socket operations for use by nfs | | 38 | * Socket operations for use by nfs |
39 | */ | | 39 | */ |
40 | | | 40 | |
41 | #include <sys/cdefs.h> | | 41 | #include <sys/cdefs.h> |
42 | __KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.170.2.3 2009/05/04 10:28:53 yamt Exp $"); | | 42 | __KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.170.2.4 2009/05/04 10:48:39 yamt Exp $"); |
43 | | | 43 | |
44 | #ifdef _KERNEL_OPT | | 44 | #ifdef _KERNEL_OPT |
45 | #include "fs_nfs.h" | | 45 | #include "fs_nfs.h" |
46 | #include "opt_nfs.h" | | 46 | #include "opt_nfs.h" |
47 | #include "opt_mbuftrace.h" | | 47 | #include "opt_mbuftrace.h" |
48 | #endif | | 48 | #endif |
49 | | | 49 | |
50 | #include <sys/param.h> | | 50 | #include <sys/param.h> |
51 | #include <sys/systm.h> | | 51 | #include <sys/systm.h> |
52 | #include <sys/evcnt.h> | | 52 | #include <sys/evcnt.h> |
53 | #include <sys/callout.h> | | 53 | #include <sys/callout.h> |
54 | #include <sys/proc.h> | | 54 | #include <sys/proc.h> |
55 | #include <sys/mount.h> | | 55 | #include <sys/mount.h> |
| @@ -1768,29 +1768,28 @@ nfs_timer(void *arg) | | | @@ -1768,29 +1768,28 @@ nfs_timer(void *arg) |
1768 | printf("%s: rw_trylock failed\n", __func__); | | 1768 | printf("%s: rw_trylock failed\n", __func__); |
1769 | continue; | | 1769 | continue; |
1770 | } | | 1770 | } |
1771 | if ((so = nmp->nm_so) == NULL) { | | 1771 | if ((so = nmp->nm_so) == NULL) { |
1772 | rw_exit(&nmp->nm_solock); | | 1772 | rw_exit(&nmp->nm_solock); |
1773 | continue; | | 1773 | continue; |
1774 | } | | 1774 | } |
1775 | | | 1775 | |
1776 | /* | | 1776 | /* |
1777 | * If there is enough space and the window allows.. | | 1777 | * If there is enough space and the window allows.. |
1778 | * Resend it | | 1778 | * Resend it |
1779 | * Set r_rtt to -1 in case we fail to send it now. | | 1779 | * Set r_rtt to -1 in case we fail to send it now. |
1780 | */ | | 1780 | */ |
1781 | /* solock(so); XXX PR 40491 */ | | 1781 | solock(so); |
1782 | rep->r_rtt = -1; | | 1782 | rep->r_rtt = -1; |
1783 | /* XXX kernel_lock for sbspace? */ | | | |
1784 | if (sbspace(&so->so_snd) >= rep->r_mreq->m_pkthdr.len && | | 1783 | if (sbspace(&so->so_snd) >= rep->r_mreq->m_pkthdr.len && |
1785 | ((nmp->nm_flag & NFSMNT_DUMBTIMR) || | | 1784 | ((nmp->nm_flag & NFSMNT_DUMBTIMR) || |
1786 | (rep->r_rflags & RR_SENT) || | | 1785 | (rep->r_rflags & RR_SENT) || |
1787 | nmp->nm_sent < nmp->nm_cwnd) && | | 1786 | nmp->nm_sent < nmp->nm_cwnd) && |
1788 | (m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))) { | | 1787 | (m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))) { |
1789 | if (so->so_state & SS_ISCONNECTED) | | 1788 | if (so->so_state & SS_ISCONNECTED) |
1790 | error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, | | 1789 | error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, |
1791 | m, NULL, NULL, NULL); | | 1790 | m, NULL, NULL, NULL); |
1792 | else | | 1791 | else |
1793 | error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, | | 1792 | error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, |
1794 | m, nmp->nm_nam, NULL, NULL); | | 1793 | m, nmp->nm_nam, NULL, NULL); |
1795 | if (error) { | | 1794 | if (error) { |
1796 | if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) { | | 1795 | if (NFSIGNORE_SOERROR(nmp->nm_soflags, error)) { |