From 58bf90a111c5d87da7ac932616385ed46432a3ae Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:11:11 -0500 Subject: [PATCH] Import 2.0.6 --- Makefile | 2 +- arch/alpha/lib/Makefile | 2 +- arch/alpha/lib/checksum.c | 22 --- arch/alpha/lib/csum_partial_copy.c | 292 +++++++++++++++++++++++++++++ drivers/pci/pci.c | 5 +- drivers/scsi/README.ncr53c8xx | 26 +-- drivers/scsi/ncr53c8xx.c | 6 +- drivers/scsi/qlogicfas.c | 6 +- drivers/scsi/qlogicfas.h | 6 +- drivers/sound/sb_common.c | 9 +- drivers/sound/soundcard.c | 7 +- fs/smbfs/proc.c | 2 +- include/linux/pci.h | 1 + mm/memory.c | 40 ++-- net/ipv4/ip_sockglue.c | 8 +- net/ipv4/tcp_output.c | 19 +- 16 files changed, 366 insertions(+), 87 deletions(-) create mode 100644 arch/alpha/lib/csum_partial_copy.c diff --git a/Makefile b/Makefile index b06d45e486f9..0893fa1b486f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 0 -SUBLEVEL = 5 +SUBLEVEL = 6 ARCH = i386 diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile index 1babf3f29172..38b549c63c93 100644 --- a/arch/alpha/lib/Makefile +++ b/arch/alpha/lib/Makefile @@ -3,7 +3,7 @@ # OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o memcpy.o io.o \ - checksum.o strlen.o + checksum.o csum_partial_copy.o strlen.o lib.a: $(OBJS) $(AR) rcs lib.a $(OBJS) diff --git a/arch/alpha/lib/checksum.c b/arch/alpha/lib/checksum.c index 7902cc4e562c..78667c7e3e1d 100644 --- a/arch/alpha/lib/checksum.c +++ b/arch/alpha/lib/checksum.c @@ -138,28 +138,6 @@ unsigned int csum_partial(unsigned char * buff, int len, unsigned int sum) return result; } -/* - * the same as csum_partial, but copies from src while it - * checksums - * - * here even more important to align src and dst on a 32-bit (or even - * better 64-bit) boundary - */ - -unsigned int csum_partial_copy(char *src, char *dst, int len, int sum) -{ - /* - * The whole idea is to do the copy and the checksum at - * the same time, but we do it the easy way now. - * - * At least csum on the source, not destination, for cache - * reasons.. - */ - sum = csum_partial(src, len, sum); - memcpy(dst, src, len); - return sum; -} - /* * this routine is used for miscellaneous IP-like checksums, mainly * in icmp.c diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c new file mode 100644 index 000000000000..3d036afbebc9 --- /dev/null +++ b/arch/alpha/lib/csum_partial_copy.c @@ -0,0 +1,292 @@ +/* + * csum_partial_copy - do IP checksumming and copy + * + * (C) Copyright 1996 Linus Torvalds + * + * Don't look at this too closely - you'll go mad. The things + * we do for performance.. + */ + +#define ldq_u(x,y) \ +__asm__("ldq_u %0,%1":"=r" (x):"m" (*(unsigned long *)(y))) + +#define stq_u(x,y) \ +__asm__("stq_u %1,%0":"=m" (*(unsigned long *)(y)):"r" (x)) + +#define extql(x,y,z) \ +__asm__ __volatile__("extql %1,%2,%0":"=r" (z):"r" (x),"r" (y)) + +#define extqh(x,y,z) \ +__asm__ __volatile__("extqh %1,%2,%0":"=r" (z):"r" (x),"r" (y)) + +#define mskql(x,y,z) \ +__asm__ __volatile__("mskql %1,%2,%0":"=r" (z):"r" (x),"r" (y)) + +#define mskqh(x,y,z) \ +__asm__ __volatile__("mskqh %1,%2,%0":"=r" (z):"r" (x),"r" (y)) + +#define insql(x,y,z) \ +__asm__ __volatile__("insql %1,%2,%0":"=r" (z):"r" (x),"r" (y)) + +#define insqh(x,y,z) \ +__asm__ __volatile__("insqh %1,%2,%0":"=r" (z):"r" (x),"r" (y)) + +/* + * Ok. This isn't fun, but this is the EASY case. + */ +static inline unsigned long csum_partial_copy_aligned( + unsigned long *src, unsigned long *dst, + long len, unsigned long checksum) +{ + unsigned long word, carry = 0; + + len -= 8; + word = *src; + while (len >= 0) { + checksum += carry; + src++; + checksum += word; + len -= 8; + carry = checksum < word; + *dst = word; + word = *src; + dst++; + } + len += 8; + checksum += carry; + if (len) { + unsigned long tmp = *dst; + mskql(word, len, word); + checksum += word; + mskqh(tmp, len, tmp); + carry = checksum < word; + *dst = word | tmp; + checksum += carry; + } + return checksum; +} + +/* + * This is even less fun, but this is still reasonably + * easy. + */ +static inline unsigned long csum_partial_copy_dest_aligned( + unsigned long *src, unsigned long *dst, + unsigned long soff, + long len, unsigned long checksum) +{ + unsigned long first, word, carry = 0; + + len -= 8; + first = src[0]; + while (len >= 0) { + unsigned long second; + + second = src[1]; + extql(first, soff, word); + len -= 8; + extqh(second, soff, first); + src++; + word |= first; + checksum += carry; + first = second; + checksum += word; + *dst = word; + carry = checksum < word; + dst++; + } + len += 8; + checksum += carry; + if (len) { + unsigned long tmp; + unsigned long second; + second = src[1]; + tmp = *dst; + extql(first, soff, word); + extqh(second, soff, first); + word |= first; + mskql(word, len, word); + checksum += word; + mskqh(tmp, len, tmp); + carry = checksum < word; + *dst = word | tmp; + checksum += carry; + } + return checksum; +} + +/* + * This is slightly less fun than the above.. + */ +static inline unsigned long csum_partial_copy_src_aligned( + unsigned long *src, unsigned long *dst, + unsigned long doff, + long len, unsigned long checksum) +{ + unsigned long word, carry = 0; + unsigned long partial_dest; + + partial_dest = *dst; + len -= 8; + mskql(partial_dest, doff, partial_dest); + word = *src; + while (len >= 0) { + unsigned long second_dest; + + len -= 8; + checksum += carry; + src++; + checksum += word; + insql(word, doff, second_dest); + *dst = partial_dest | second_dest; + insqh(word, doff, partial_dest); + carry = checksum < word; + word = *src; + dst++; + } + len += doff; + checksum += carry; + if (len >= 0) { + unsigned long second_dest; + + mskql(word, len-doff, word); + len -= 8; + src++; + checksum += word; + insql(word, doff, second_dest); + *dst = partial_dest | second_dest; + insqh(word, doff, partial_dest); + carry = checksum < word; + word = *src; + dst++; + checksum += carry; + } else if (len & 7) { + unsigned long second_dest; + second_dest = *dst; + mskql(word, len-doff, word); + checksum += word; + mskqh(second_dest, len, second_dest); + carry = checksum < word; + insql(word, doff, word); + *dst = partial_dest | word | second_dest; + checksum += carry; + } + return checksum; +} + +/* + * This is so totally un-fun that it's frightening. Don't + * look at this too closely, you'll go blind. + */ +static inline unsigned long csum_partial_copy_unaligned( + unsigned long * src, unsigned long * dst, + unsigned long soff, unsigned long doff, + long len, unsigned long checksum) +{ + unsigned long first, carry = 0; + unsigned long partial_dest; + + partial_dest = dst[0]; + len -= 8; + first = src[0]; + mskql(partial_dest, doff, partial_dest); + while (len >= 0) { + unsigned long second, word; + unsigned long second_dest; + + second = src[1]; + extql(first, soff, word); + len -= 8; + checksum += carry; + src++; + extqh(second, soff, first); + word |= first; + first = second; + checksum += word; + insql(word, doff, second_dest); + *dst = partial_dest | second_dest; + carry = checksum < word; + insqh(word, doff, partial_dest); + dst++; + } + len += doff; + checksum += carry; + if (len >= 0) { + unsigned long second, word; + unsigned long second_dest; + + second = src[1]; + extql(first, soff, word); + len -= 8; + src++; + extqh(second, soff, first); + word |= first; + first = second; + mskql(word, len-doff, word); + checksum += word; + insql(word, doff, second_dest); + *dst = partial_dest | second_dest; + carry = checksum < word; + insqh(word, doff, partial_dest); + dst++; + } else if (len & 7) { + unsigned long second, word; + unsigned long second_dest; + second = src[1]; + extql(first, soff, word); + extqh(second, soff, first); + word |= first; + second_dest = *dst; + mskql(word, len-doff, word); + checksum += word; + mskqh(second_dest, len, second_dest); + carry = checksum < word; + insql(word, doff, word); + *dst = partial_dest | word | second_dest; + checksum += carry; + } + return checksum; +} + +unsigned int csum_partial_copy(char *src, char *dst, int len, int sum) +{ + unsigned long checksum = (unsigned) sum; + unsigned long soff = 7 & (unsigned long) src; + unsigned long doff = 7 & (unsigned long) dst; + + src = (char *) (~7UL & (unsigned long) src); + dst = (char *) (~7UL & (unsigned long) dst); + if (len) { + if (!soff) { + if (!doff) + checksum = csum_partial_copy_aligned( + (unsigned long *) src, + (unsigned long *) dst, + len, checksum); + else + checksum = csum_partial_copy_src_aligned( + (unsigned long *) src, + (unsigned long *) dst, + doff, len, checksum); + } else { + if (!doff) + checksum = csum_partial_copy_dest_aligned( + (unsigned long *) src, + (unsigned long *) dst, + soff, len, checksum); + else + checksum = csum_partial_copy_unaligned( + (unsigned long *) src, + (unsigned long *) dst, + soff, doff, len, checksum); + } + /* 64 -> 33 bits */ + checksum = (checksum & 0xffffffff) + (checksum >> 32); + /* 33 -> < 32 bits */ + checksum = (checksum & 0xffff) + (checksum >> 16); + /* 32 -> 16 bits */ + checksum = (checksum & 0xffff) + (checksum >> 16); + checksum = (checksum & 0xffff) + (checksum >> 16); + } + return checksum; +} diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7bee9ac07b82..d1f2adb5ce33 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -226,9 +226,10 @@ struct pci_dev_info dev_info[] = { DEVICE( INTEL, INTEL_82437, "82437"), DEVICE( INTEL, INTEL_82371_0, "82371 Triton PIIX"), DEVICE( INTEL, INTEL_82371_1, "82371 Triton PIIX"), + DEVICE( INTEL, INTEL_82441, "82441FX Natoma"), DEVICE( INTEL, INTEL_82439, "82439HX Triton II"), - DEVICE( INTEL, INTEL_82371SB_0,"82371SB Triton II PIIX"), - DEVICE( INTEL, INTEL_82371SB_1,"82371SB Triton II PIIX"), + DEVICE( INTEL, INTEL_82371SB_0,"82371SB Natoma/Triton II PIIX"), + DEVICE( INTEL, INTEL_82371SB_1,"82371SB Natoma/Triton II PIIX"), DEVICE( INTEL, INTEL_P6, "Orion P6"), DEVICE( ADAPTEC, ADAPTEC_7850, "AIC-7850"), DEVICE( ADAPTEC, ADAPTEC_7855, "AIC-7855"), diff --git a/drivers/scsi/README.ncr53c8xx b/drivers/scsi/README.ncr53c8xx index 1dff910ed6eb..d695c27be046 100644 --- a/drivers/scsi/README.ncr53c8xx +++ b/drivers/scsi/README.ncr53c8xx @@ -43,10 +43,10 @@ The original driver has been written for 386bsd and FreeBSD by Wolfgang Stanglmeier Stefan Esser -You can find technical informations about the NCR 8xx family in the PCI-HOWTO +You can find technical information about the NCR 8xx family in the PCI-HOWTO written by Michael Will and in the SCSI-HOWTO written by Drew Eckhardt. -Informations about new chips is available at SYMBIOS web server: +Information about new chips is available at SYMBIOS web server: http://www.symbios.com This short documentation only describes the features of the NCR53C8XX driver, @@ -153,16 +153,16 @@ Generally, only 1 board is used on hardware configuration, and the device is: However, if the driver has been made as module, the number of the host is incremented each time the driver is loaded. -In order to display profiling informations, just enter: +In order to display profiling information, just enter: cat /proc/scsi/ncr53c8xx/0 and you will get something like the following text: ------------------------------------------------------- -General informations: +General information: Chip NCR53C810, device id 0x1, revision id 0x2 IO port address 0x6000, IRQ number 10 Using memory mapped IO at virtual address 0x282c000 -Profiling informations: +Profiling information: num_trans = 18014 num_kbytes = 671314 num_disc = 25763 @@ -175,8 +175,8 @@ Profiling informations: ms_post = 1320 ------------------------------------------------------- -General informations are easy to understand. The device id and the -revision id identify the scsi chip as follow: +General information is easy to understand. The device id and the +revision id identify the scsi chip as follows: Chip Device id Revision Id ---- --------- ----------- @@ -188,7 +188,7 @@ Chip Device id Revision Id 825A 0x3 >= 0x10 875 0xf -The profiling informations are updated upon completion of scsi commands. +The profiling information is updated upon completion of scsi commands. The data structure is allocated and zeroed when the host adapter is attached. So, if the driver is a module, the profile counters are cleared each time the driver is loaded. @@ -316,10 +316,10 @@ Available commands: result: print sense data on CHECK CONDITION status scatter: print infos about the scatter process scripts: print infos about the script binding process - tiny: print minimal debugging informations - timing: print timing informations of the ncr chip. - nego: print informations about scsi negotiations - phase: print informations on script interruptions + tiny: print minimal debugging information + timing: print timing information of the ncr chip. + nego: print information about scsi negotiations + phase: print information on script interruptions 8.6 Clear profile counters @@ -399,7 +399,7 @@ SCSI_NCR_DISABLE_PARITY_CHECK (default: not defined) If defined, scsi parity checking is disabled. SCSI_NCR_PROFILE (default: defined) - If defined, profile informations are gathered + If defined, profile information are gathered SCSI_NCR_MAX_SCATTER (default: 128) Scatter list size of the driver ccb. diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 02f6fecf65e9..db21582b837b 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -8086,7 +8086,7 @@ static int copy_info(struct info_str *info, char *fmt, ...) } /* -** Copy formatted profile informations into the input buffer. +** Copy formatted profile information into the input buffer. */ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) @@ -8098,7 +8098,7 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) info.offset = offset; info.pos = 0; - copy_info(&info, "General informations:\n"); + copy_info(&info, "General information:\n"); copy_info(&info, " Chip NCR53C%03d, ", np->chip); copy_info(&info, "device id 0x%x, ", np->device_id); copy_info(&info, "revision id 0x%x\n", np->revision_id); @@ -8113,7 +8113,7 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len) #endif #ifdef SCSI_NCR_PROFILE - copy_info(&info, "Profiling informations:\n"); + copy_info(&info, "Profiling information:\n"); copy_info(&info, " %-12s = %lu\n", "num_trans",np->profile.num_trans); copy_info(&info, " %-12s = %lu\n", "num_kbytes",np->profile.num_kbytes); copy_info(&info, " %-12s = %lu\n", "num_disc", np->profile.num_disc); diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c index 342d52a31563..a3784e9264c5 100644 --- a/drivers/scsi/qlogicfas.c +++ b/drivers/scsi/qlogicfas.c @@ -18,7 +18,7 @@ Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994 (you can reference it, but it is incomplete and inaccurate in places) - Version 0.44 5/7/96 - kernel 1.2.0+, pcmcia 2.5.4+ + Version 0.45 6/9/96 - kernel 1.2.0+ Functions as standalone, loadable, and PCMCIA driver, the latter from Dave Hind's PCMCIA package. @@ -612,7 +612,7 @@ host->proc_dir = &proc_scsi_qlogicfas; if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogicfas", NULL)) host->can_queue = 1; #endif - request_region( qbase , 0x10 ,"qlogic"); + request_region( qbase , 0x10 ,"qlogicfas"); hreg = scsi_register( host , 0 ); /* no host data */ hreg->io_port = qbase; hreg->n_io_port = 16; @@ -620,7 +620,7 @@ host->proc_dir = &proc_scsi_qlogicfas; if( qlirq != -1 ) hreg->irq = qlirq; - sprintf(qinfo, "Qlogicfas Driver version 0.44, chip %02X at %03X, IRQ %d, TPdma:%d", + sprintf(qinfo, "Qlogicfas Driver version 0.45, chip %02X at %03X, IRQ %d, TPdma:%d", qltyp, qbase, qlirq, QL_TURBO_PDMA ); host->name = qinfo; diff --git a/drivers/scsi/qlogicfas.h b/drivers/scsi/qlogicfas.h index 4e0457f9bff7..df2bb73ae309 100644 --- a/drivers/scsi/qlogicfas.h +++ b/drivers/scsi/qlogicfas.h @@ -19,13 +19,13 @@ int qlogicfas_biosparam(Disk *, kdev_t, int[]); NULL, \ NULL, \ NULL, \ - qlogicfas_detect, \ + qlogicfas_detect, \ NULL, \ qlogicfas_info, \ qlogicfas_command, \ qlogicfas_queuecommand, \ - qlogicfas_abort, \ - qlogicfas_reset, \ + qlogicfas_abort, \ + qlogicfas_reset, \ NULL, \ qlogicfas_biosparam, \ 0, \ diff --git a/drivers/sound/sb_common.c b/drivers/sound/sb_common.c index 307977b4d905..b83b0a7e1984 100644 --- a/drivers/sound/sb_common.c +++ b/drivers/sound/sb_common.c @@ -642,9 +642,12 @@ void sb_dsp_init (struct address_info *hw_config) { sb_devc *devc; - int n; char name[100]; +#ifndef NO_SB_IRQ_TEST + int n; +#endif + /* * Check if we had detected a SB device earlier */ @@ -701,12 +704,13 @@ sb_dsp_init (struct address_info *hw_config) } } +#ifndef NO_SB_IRQ_TEST for (n = 0; n < 3 && devc->irq_ok == 0; n++) if (sb_dsp_command (devc, 0xf2)) /* Cause interrupt immediately */ { int i; - for (i = 0; !devc->irq_ok && i < 10000000; i++); + for (i = 0; !devc->irq_ok && i < 10000; i++); } if (!devc->irq_ok) @@ -719,6 +723,7 @@ sb_dsp_init (struct address_info *hw_config) { DDB (printk ("IRQ test OK (IRQ%d)\n", devc->irq)); } +#endif request_region (hw_config->io_base, 16, "sound blaster"); diff --git a/drivers/sound/soundcard.c b/drivers/sound/soundcard.c index 29d862f05017..a9f61b6d0cd1 100644 --- a/drivers/sound/soundcard.c +++ b/drivers/sound/soundcard.c @@ -289,7 +289,7 @@ sound_mmap (inode_handle * inode, file_handle * file, vm_area_handle * vma) size, dmap->bytes_in_use); } - if (remap_page_range (vma_get_start (vma), dmap->raw_buf_phys, + if (remap_page_range (vma_get_start (vma), virt_to_phys(dmap->raw_buf), vma_get_end (vma) - vma_get_start (vma), vma_get_page_prot (vma))) return -EAGAIN; @@ -487,6 +487,10 @@ int snd_set_irq_handler (int interrupt_level, void (*iproc) (int, void *, struct pt_regs *), char *name, int *osp) { int retcode; + unsigned long flags; + + save_flags (flags); + cli (); retcode = request_irq (interrupt_level, iproc, 0 /* SA_INTERRUPT */ , name, NULL); if (retcode < 0) @@ -496,6 +500,7 @@ snd_set_irq_handler (int interrupt_level, void (*iproc) (int, void *, struct pt_ else irqs |= (1ul << interrupt_level); + restore_flags (flags); return retcode; } diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c index 197aa33de41a..2004ca86660e 100644 --- a/fs/smbfs/proc.c +++ b/fs/smbfs/proc.c @@ -1739,7 +1739,7 @@ smb_proc_reconnect(struct smb_server *server) DPRINTK("smb_proc_connect: Server wants %s protocol.\n", prots[i].name); - if (server->protocol > PROTOCOL_LANMAN1) { + if (server->protocol >= PROTOCOL_LANMAN1) { word passlen = strlen(server->m.password); word userlen = strlen(server->m.username); diff --git a/include/linux/pci.h b/include/linux/pci.h index 21464d1e321d..90bd32321348 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -547,6 +547,7 @@ #define PCI_DEVICE_ID_INTEL_82437 0x122d #define PCI_DEVICE_ID_INTEL_82371_0 0x122e #define PCI_DEVICE_ID_INTEL_82371_1 0x1230 +#define PCI_DEVICE_ID_INTEL_82441 0x1237 #define PCI_DEVICE_ID_INTEL_82439 0x1250 #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 #define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 diff --git a/mm/memory.c b/mm/memory.c index f4a58daa1b8a..de29d75866e1 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -298,10 +298,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, return error; } -static inline void forget_pte(pte_t page) +static inline void free_pte(pte_t page) { - if (pte_none(page)) - return; if (pte_present(page)) { unsigned long addr = pte_page(page); if (addr >= high_memory || PageReserved(mem_map+MAP_NR(addr))) @@ -315,10 +313,17 @@ static inline void forget_pte(pte_t page) swap_free(pte_val(page)); } +static inline void forget_pte(pte_t page) +{ + if (!pte_none(page)) { + printk("forget_pte: old mapping existed!\n"); + free_pte(page); + } +} + static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned long size) { pte_t * pte; - unsigned long end; if (pmd_none(*pmd)) return; @@ -329,16 +334,21 @@ static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned lo } pte = pte_offset(pmd, address); address &= ~PMD_MASK; - end = address + size; - if (end >= PMD_SIZE) - end = PMD_SIZE; - do { - pte_t page = *pte; - pte_clear(pte); - forget_pte(page); - address += PAGE_SIZE; + if (address + size > PMD_SIZE) + size = PMD_SIZE - address; + size >>= PAGE_SHIFT; + for (;;) { + pte_t page; + if (!size) + break; + page = *pte; pte++; - } while (address < end); + size--; + if (pte_none(page)) + continue; + pte_clear(pte-1); + free_pte(page); + } } static inline void zap_pmd_range(pgd_t * dir, unsigned long address, unsigned long size) @@ -934,7 +944,7 @@ void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma, force_sig(SIGBUS, current); flush_cache_page(vma, address); put_page(page_table, BAD_PAGE); - flush_tlb_page(vma, address); + /* no need to invalidate, wasn't present */ return; } /* @@ -955,7 +965,7 @@ void do_no_page(struct task_struct * tsk, struct vm_area_struct * vma, entry = pte_wrprotect(entry); flush_cache_page(vma, address); put_page(page_table, entry); - flush_tlb_page(vma, address); + /* no need to invalidate: a not-present page shouldn't be cached */ } /* diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 64884a9ee4fd..4b1c3b1e2f9b 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -295,8 +295,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt */ if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL) { - dev=rt->u.dst.dev; - atomic_dec(&rt->u.dst.use); + dev=rt->rt_dev; + atomic_dec(&rt->rt_use); ip_rt_put(rt); } } @@ -347,8 +347,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt { if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL) { - dev=rt->u.dst.dev; - atomic_dec(&rt->u.dst.use); + dev=rt->rt_dev; + atomic_dec(&rt->rt_use); ip_rt_put(rt); } } diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index d1be22f76518..826c12211cd7 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -878,24 +878,12 @@ void tcp_send_synack(struct sock * newsk, struct sock * sk, struct sk_buff * skb */ void tcp_send_delayed_ack(struct sock * sk, int max_timeout, unsigned long timeout) { - unsigned long now; - static int delack_guard=0; - - if(delack_guard) - return; - - delack_guard++; - /* Calculate new timeout */ - now = jiffies; if (timeout > max_timeout) timeout = max_timeout; - timeout += now; - if (sk->bytes_rcv >= sk->max_unacked) { - tcp_send_ack(sk); - delack_guard--; - return; - } + if (sk->bytes_rcv >= sk->max_unacked) + timeout = 0; + timeout += jiffies; /* Use new timeout only if there wasn't a older one earlier */ if (!del_timer(&sk->delack_timer) || timeout < sk->delack_timer.expires) @@ -903,7 +891,6 @@ void tcp_send_delayed_ack(struct sock * sk, int max_timeout, unsigned long timeo sk->ack_backlog++; add_timer(&sk->delack_timer); - delack_guard--; } -- 2.39.5