diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:10:26 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 20:10:26 -0800 |
| commit | bb5b6e6c4dea4242f6ff75fa7adecea4f34935f1 (patch) | |
| tree | dbdda6fdd7f0bfadb4c10a997bfb15660f3223c0 /include | |
| parent | 0b9ded43ee424791d9283cee2a33dcb4a97da57d (diff) | |
v2.4.8.4 -> v2.4.9
- David Miller: sparc updates, FAT fs fixes, btaudio build fix
- David Gibson: Orinoco driver update
- Kevin Fleming: more disks the HPT controller doesn't like
- David Miller: "min()/max()" cleanups. Understands signs and sizes.
- Ben LaHaise: make vma merging more generous, help Mozilla /proc/<>/maps
- Jens Axboe: CD updates
- Trond Myklebust: save away NFS credentials in inode, so that mmap can
writeout.
- Mark Hemment: HIGHMEM ops cleanups
- Jes Sorensen: use "unsigned long" for flags in various drivers
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-sparc/hw_irq.h | 6 | ||||
| -rw-r--r-- | include/asm-sparc64/hw_irq.h | 6 | ||||
| -rw-r--r-- | include/asm-sparc64/keyboard.h | 7 | ||||
| -rw-r--r-- | include/asm-sparc64/mmu_context.h | 17 | ||||
| -rw-r--r-- | include/asm-sparc64/pbm.h | 5 | ||||
| -rw-r--r-- | include/asm-sparc64/pgtable.h | 24 | ||||
| -rw-r--r-- | include/linux/cyclomx.h | 7 | ||||
| -rw-r--r-- | include/linux/kernel.h | 5 | ||||
| -rw-r--r-- | include/linux/lvm.h | 7 | ||||
| -rw-r--r-- | include/linux/mtd/cfi.h | 4 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 6 | ||||
| -rw-r--r-- | include/linux/nfs_fs_i.h | 4 | ||||
| -rw-r--r-- | include/linux/sunrpc/auth.h | 19 | ||||
| -rw-r--r-- | include/linux/swap.h | 6 | ||||
| -rw-r--r-- | include/linux/wanpipe.h | 7 | ||||
| -rw-r--r-- | include/net/sock.h | 22 | ||||
| -rw-r--r-- | include/net/tcp.h | 34 |
17 files changed, 108 insertions, 78 deletions
diff --git a/include/asm-sparc/hw_irq.h b/include/asm-sparc/hw_irq.h new file mode 100644 index 000000000000..8d30a7694be2 --- /dev/null +++ b/include/asm-sparc/hw_irq.h @@ -0,0 +1,6 @@ +#ifndef __ASM_SPARC_HW_IRQ_H +#define __ASM_SPARC_HW_IRQ_H + +/* Dummy include. */ + +#endif diff --git a/include/asm-sparc64/hw_irq.h b/include/asm-sparc64/hw_irq.h new file mode 100644 index 000000000000..153cae2ddaee --- /dev/null +++ b/include/asm-sparc64/hw_irq.h @@ -0,0 +1,6 @@ +#ifndef __ASM_SPARC64_HW_IRQ_H +#define __ASM_SPARC64_HW_IRQ_H + +/* Dummy include. */ + +#endif diff --git a/include/asm-sparc64/keyboard.h b/include/asm-sparc64/keyboard.h index 15f24c33f5a4..1813bed622c6 100644 --- a/include/asm-sparc64/keyboard.h +++ b/include/asm-sparc64/keyboard.h @@ -1,4 +1,4 @@ -/* $Id: keyboard.h,v 1.3 1999/04/28 11:59:12 davem Exp $ +/* $Id: keyboard.h,v 1.4 2001/08/13 14:40:07 davem Exp $ * linux/include/asm-sparc64/keyboard.h * * Created Aug 29 1997 by Eddie C. Dost (ecd@skynet.be) @@ -13,6 +13,9 @@ #ifdef __KERNEL__ +#include <linux/kernel.h> +#include <linux/kd.h> + #define KEYBOARD_IRQ 1 #define DISABLE_KBD_DURING_INTERRUPTS 0 @@ -22,6 +25,7 @@ extern int pcikbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode); extern char pcikbd_unexpected_up(unsigned char keycode); extern void pcikbd_leds(unsigned char leds); +extern int pcikbd_rate(struct kbd_repeat *rep); extern void pcikbd_init_hw(void); extern unsigned char pcikbd_sysrq_xlate[128]; @@ -30,6 +34,7 @@ extern unsigned char pcikbd_sysrq_xlate[128]; #define kbd_translate pcikbd_translate #define kbd_unexpected_up pcikbd_unexpected_up #define kbd_leds pcikbd_leds +#define kbd_rate pcikbd_rate #define kbd_init_hw pcikbd_init_hw #define kbd_sysrq_xlate pcikbd_sysrq_xlate #define kbd_init pcikbd_init diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h index 76e23b44d07d..357d0e7ef763 100644 --- a/include/asm-sparc64/mmu_context.h +++ b/include/asm-sparc64/mmu_context.h @@ -1,4 +1,4 @@ -/* $Id: mmu_context.h,v 1.49 2001/08/09 21:10:20 davem Exp $ */ +/* $Id: mmu_context.h,v 1.50 2001/08/13 20:24:34 kanoj Exp $ */ #ifndef __SPARC64_MMU_CONTEXT_H #define __SPARC64_MMU_CONTEXT_H @@ -9,6 +9,7 @@ #include <linux/spinlock.h> #include <asm/system.h> #include <asm/spitfire.h> +#include <asm/page.h> static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) { @@ -18,7 +19,19 @@ extern spinlock_t ctx_alloc_lock; extern unsigned long tlb_context_cache; extern unsigned long mmu_context_bmap[]; -#define CTX_VERSION_SHIFT (PAGE_SHIFT - 3) +/* + * For the 8k pagesize kernel, use only 10 hw context bits to optimize some shifts in + * the fast tlbmiss handlers, instead of all 13 bits (specifically for vpte offset + * calculation). For other pagesizes, this optimization in the tlbhandlers can not be + * done; but still, all 13 bits can not be used because the tlb handlers use "andcc" + * instruction which sign extends 13 bit arguments. + */ +#if PAGE_SHIFT == 13 +#define CTX_VERSION_SHIFT 10 +#else +#define CTX_VERSION_SHIFT 12 +#endif + #define CTX_VERSION_MASK ((~0UL) << CTX_VERSION_SHIFT) #define CTX_FIRST_VERSION ((1UL << CTX_VERSION_SHIFT) + 1UL) #define CTX_VALID(__ctx) \ diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 7e4fb85ac9d9..af595343fefc 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -1,4 +1,4 @@ -/* $Id: pbm.h,v 1.26 2001/05/15 08:54:30 davem Exp $ +/* $Id: pbm.h,v 1.27 2001/08/12 13:18:23 davem Exp $ * pbm.h: UltraSparc PCI controller software state. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com) @@ -157,6 +157,9 @@ struct pci_pbm_info { /* IOMMU state, potentially shared by both PBM segments. */ struct pci_iommu *iommu; + /* PCI slot mapping. */ + unsigned int pci_first_slot; + /* Now things for the actual PCI bus probes. */ unsigned int pci_first_busno; unsigned int pci_last_busno; diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 614fec33f339..3b506d4146ad 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.140 2001/04/12 22:41:15 davem Exp $ +/* $Id: pgtable.h,v 1.141 2001/08/13 20:24:34 kanoj Exp $ * pgtable.h: SpitFire page table operations. * * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu) @@ -16,6 +16,7 @@ #include <asm/asi.h> #include <asm/mmu_context.h> #include <asm/system.h> +#include <asm/page.h> #ifndef __ASSEMBLY__ @@ -31,14 +32,26 @@ * XXX cheetah's full 64-bit virtual address space, ie. no more hole * XXX in the middle like on spitfire. -DaveM */ +/* + * Given a virtual address, the lowest PAGE_SHIFT bits determine offset + * into the page; the next higher PAGE_SHIFT-3 bits determine the pte# + * in the proper pagetable (the -3 is from the 8 byte ptes, and each page + * table is a single page long). The next higher PMD_BITS determine pmd# + * in the proper pmdtable (where we must have PMD_BITS <= (PAGE_SHIFT-2) + * since the pmd entries are 4 bytes, and each pmd page is a single page + * long). Finally, the higher few bits determine pgde#. + */ + +#define VA_BITS 44 /* PMD_SHIFT determines the size of the area a second-level page table can map */ #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) #define PMD_SIZE (1UL << PMD_SHIFT) #define PMD_MASK (~(PMD_SIZE-1)) +#define PMD_BITS 11 /* PGDIR_SHIFT determines what a third-level page table entry can map */ -#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + (PAGE_SHIFT-2)) +#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3) + PMD_BITS) #define PGDIR_SIZE (1UL << PGDIR_SHIFT) #define PGDIR_MASK (~(PGDIR_SIZE-1)) @@ -48,12 +61,12 @@ /* We the first one in this file, what we export to the kernel * is different so we can optimize correctly for 32-bit tasks. */ -#define REAL_PTRS_PER_PMD (1UL << (PAGE_SHIFT-2)) +#define REAL_PTRS_PER_PMD (1UL << PMD_BITS) #define PTRS_PER_PMD ((const int)((current->thread.flags & SPARC_FLAG_32BIT) ? \ - (REAL_PTRS_PER_PMD >> 2) : (REAL_PTRS_PER_PMD))) + (1UL << (32 - (PAGE_SHIFT-3) - PAGE_SHIFT)) : (REAL_PTRS_PER_PMD))) /* We cannot use the top 16G because VPTE table lives there. */ -#define PTRS_PER_PGD ((1UL << (PAGE_SHIFT-3))-1) +#define PTRS_PER_PGD ((1UL << (VA_BITS - PAGE_SHIFT - (PAGE_SHIFT-3) - PMD_BITS))-1) /* Kernel has a separate 44bit address space. */ #define USER_PTRS_PER_PGD ((const int)((current->thread.flags & SPARC_FLAG_32BIT) ? \ @@ -62,7 +75,6 @@ #define PTE_TABLE_SIZE 0x2000 /* 1024 entries 8 bytes each */ #define PMD_TABLE_SIZE 0x2000 /* 2048 entries 4 bytes each */ -#define PGD_TABLE_SIZE 0x1000 /* 1024 entries 4 bytes each */ /* NOTE: TLB miss handlers depend heavily upon where this is. */ #define VMALLOC_START 0x0000000140000000UL diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h index 555d38fbeed6..1d39011731b6 100644 --- a/include/linux/cyclomx.h +++ b/include/linux/cyclomx.h @@ -37,13 +37,6 @@ #include <linux/cycx_x25.h> #endif -#ifndef min -#define min(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef max -#define max(a,b) (((a)>(b))?(a):(b)) -#endif - #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) /* Adapter Data Space. diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 6f1882dbaeb5..bafb80e8cae2 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -112,6 +112,11 @@ static inline void console_verbose(void) ((unsigned char *)&addr)[1], \ ((unsigned char *)&addr)[0] +#define min(type,x,y) \ + ({ type __x = (x), __y = (y); __x < __y ? __x: __y; }) +#define max(type,x,y) \ + ({ type __x = (x), __y = (y); __x > __y ? __x: __y; }) + #endif /* __KERNEL__ */ #define SI_LOAD_SHIFT 16 diff --git a/include/linux/lvm.h b/include/linux/lvm.h index 6aa20e4ccf64..e4f6c1f44a3b 100644 --- a/include/linux/lvm.h +++ b/include/linux/lvm.h @@ -131,13 +131,6 @@ #define LVM_DIR_PREFIX "/dev/" -#ifndef min -#define min(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef max -#define max(a,b) (((a)>(b))?(a):(b)) -#endif - /* set the default structure version */ #if ( LVM_STRUCT_VERSION == 1) #define pv_t pv_v2_t diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index d32afe265335..3424ef2bc70e 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -365,10 +365,6 @@ static inline __u8 cfi_read_query(struct map_info *map, __u32 addr) } } -#ifndef min -#define min(x,y) ( (x)<(y)?(x):(y) ) -#endif - static inline void cfi_udelay(int us) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 0219a979a95f..64d9850695a9 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -63,6 +63,11 @@ */ #define NFS_SUPER_MAGIC 0x6969 +static inline struct nfs_inode_info *NFS_I(struct inode *inode) +{ + return &inode->u.nfs_i; +} + #define NFS_FH(inode) (&(inode)->u.nfs_i.fh) #define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server) #define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) @@ -74,7 +79,6 @@ #define NFS_READTIME(inode) ((inode)->u.nfs_i.read_cache_jiffies) #define NFS_CACHE_CTIME(inode) ((inode)->u.nfs_i.read_cache_ctime) #define NFS_CACHE_MTIME(inode) ((inode)->u.nfs_i.read_cache_mtime) -#define NFS_CACHE_ATIME(inode) ((inode)->u.nfs_i.read_cache_atime) #define NFS_CACHE_ISIZE(inode) ((inode)->u.nfs_i.read_cache_isize) #define NFS_NEXTSCAN(inode) ((inode)->u.nfs_i.nextscan) #define NFS_CACHEINV(inode) \ diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index f14f3d8d9c8e..2903f4c83b6c 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h @@ -45,7 +45,6 @@ struct nfs_inode_info { unsigned long read_cache_jiffies; __u64 read_cache_ctime; __u64 read_cache_mtime; - __u64 read_cache_atime; __u64 read_cache_isize; unsigned long attrtimeo; unsigned long attrtimeo_timestamp; @@ -73,6 +72,9 @@ struct nfs_inode_info { struct inode *hash_next, *hash_prev; unsigned long nextscan; + + /* Credentials for shared mmap */ + struct rpc_cred *mm_cred; }; /* diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index d66474b60c42..9ea631ace800 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -14,6 +14,8 @@ #include <linux/config.h> #include <linux/sunrpc/sched.h> +#include <asm/atomic.h> + /* size of the nodename buffer */ #define UNX_MAXNODENAME 32 @@ -22,8 +24,10 @@ */ struct rpc_cred { struct rpc_cred * cr_next; /* linked list */ + struct rpc_auth * cr_auth; + struct rpc_credops * cr_ops; unsigned long cr_expire; /* when to gc */ - unsigned short cr_count; /* ref count */ + atomic_t cr_count; /* ref count */ unsigned short cr_flags; /* various flags */ #ifdef RPC_DEBUG unsigned long cr_magic; /* 0x0f4aa4f0 */ @@ -71,6 +75,9 @@ struct rpc_authops { void (*destroy)(struct rpc_auth *); struct rpc_cred * (*crcreate)(int); +}; + +struct rpc_credops { void (*crdestroy)(struct rpc_cred *); int (*crmatch)(struct rpc_cred *, int); @@ -92,8 +99,7 @@ void rpcauth_destroy(struct rpc_auth *); struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); struct rpc_cred * rpcauth_bindcred(struct rpc_task *); void rpcauth_holdcred(struct rpc_task *); -void rpcauth_releasecred(struct rpc_auth *, - struct rpc_cred *); +void put_rpccred(struct rpc_cred *); void rpcauth_unbindcred(struct rpc_task *); int rpcauth_matchcred(struct rpc_auth *, struct rpc_cred *, int); @@ -107,5 +113,12 @@ void rpcauth_free_credcache(struct rpc_auth *); void rpcauth_insert_credcache(struct rpc_auth *, struct rpc_cred *); +static inline +struct rpc_cred * get_rpccred(struct rpc_cred *cred) +{ + atomic_inc(&cred->cr_count); + return cred; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_SUNRPC_AUTH_H */ diff --git a/include/linux/swap.h b/include/linux/swap.h index dd83dac6be0d..26619cf335af 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -256,9 +256,9 @@ extern spinlock_t pagemap_lru_lock; * 64 (1 << INACTIVE_SHIFT) seconds. */ #define INACTIVE_SHIFT 6 -#define inactive_min(a,b) ((a) < (b) ? (a) : (b)) -#define inactive_target inactive_min((memory_pressure >> INACTIVE_SHIFT), \ - (num_physpages / 4)) +#define inactive_target min(unsigned long, \ + (memory_pressure >> INACTIVE_SHIFT), \ + (num_physpages / 4)) /* * Ugly ugly ugly HACK to make sure the inactive lists diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h index b1954a442bce..061090a368f8 100644 --- a/include/linux/wanpipe.h +++ b/include/linux/wanpipe.h @@ -332,13 +332,6 @@ typedef struct { #include <linux/tty_flip.h> -#ifndef min -#define min(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef max -#define max(a,b) (((a)>(b))?(a):(b)) -#endif - #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0) #define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\ ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0) diff --git a/include/net/sock.h b/include/net/sock.h index bc2a1192e50b..403e842f6d78 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -803,26 +803,6 @@ do { spin_lock_bh(&((__sk)->lock.slock)); \ #define bh_lock_sock(__sk) spin_lock(&((__sk)->lock.slock)) #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->lock.slock)) -/* - * This might not be the most appropriate place for this two - * but since they are used by a lot of the net related code - * at least they get declared on a include that is common to all - */ - -static __inline__ int min(unsigned int a, unsigned int b) -{ - if (a > b) - a = b; - return a; -} - -static __inline__ int max(unsigned int a, unsigned int b) -{ - if (a < b) - a = b; - return a; -} - extern struct sock * sk_alloc(int family, int priority, int zero_it); extern void sk_free(struct sock *sk); @@ -1265,7 +1245,7 @@ static inline long sock_sndtimeo(struct sock *sk, int noblock) static inline int sock_rcvlowat(struct sock *sk, int waitall, int len) { - return (waitall ? len : min(sk->rcvlowat, len)) ? : 1; + return (waitall ? len : min(int, sk->rcvlowat, len)) ? : 1; } /* Alas, with timeout socket operations are not restartable. diff --git a/include/net/tcp.h b/include/net/tcp.h index e7f459819865..8edcd920facd 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -919,11 +919,14 @@ static __inline__ unsigned int tcp_current_mss(struct sock *sk) static inline void tcp_initialize_rcv_mss(struct sock *sk) { struct tcp_opt *tp = &sk->tp_pinfo.af_tcp; - int hint = min(tp->advmss, tp->mss_cache); + unsigned int hint = min(unsigned int, tp->advmss, tp->mss_cache); - hint = min(hint, tp->rcv_wnd/2); + hint = min(unsigned int, hint, tp->rcv_wnd/2); - tp->ack.rcv_mss = max(min(hint, TCP_MIN_RCVMSS), TCP_MIN_MSS); + tp->ack.rcv_mss = max(unsigned int, + min(unsigned int, + hint, TCP_MIN_RCVMSS), + TCP_MIN_MSS); } static __inline__ void __tcp_fast_path_on(struct tcp_opt *tp, u32 snd_wnd) @@ -1074,7 +1077,7 @@ static __inline__ int tcp_packets_in_flight(struct tcp_opt *tp) */ static inline __u32 tcp_recalc_ssthresh(struct tcp_opt *tp) { - return max(tp->snd_cwnd>>1, 2); + return max(u32, tp->snd_cwnd >> 1, 2); } /* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. @@ -1086,7 +1089,9 @@ static inline __u32 tcp_current_ssthresh(struct tcp_opt *tp) if ((1<<tp->ca_state)&(TCPF_CA_CWR|TCPF_CA_Recovery)) return tp->snd_ssthresh; else - return max(tp->snd_ssthresh, (tp->snd_cwnd>>1)+(tp->snd_cwnd>>2)); + return max(u32, tp->snd_ssthresh, + ((tp->snd_cwnd >> 1) + + (tp->snd_cwnd >> 2))); } static inline void tcp_sync_left_out(struct tcp_opt *tp) @@ -1121,7 +1126,8 @@ static inline void __tcp_enter_cwr(struct tcp_opt *tp) { tp->undo_marker = 0; tp->snd_ssthresh = tcp_recalc_ssthresh(tp); - tp->snd_cwnd = min(tp->snd_cwnd, tcp_packets_in_flight(tp)+1); + tp->snd_cwnd = min(u32, tp->snd_cwnd, + tcp_packets_in_flight(tp) + 1); tp->snd_cwnd_cnt = 0; tp->high_seq = tp->snd_nxt; tp->snd_cwnd_stamp = tcp_time_stamp; @@ -1486,12 +1492,12 @@ static inline void tcp_select_initial_window(int space, __u32 mss, { /* If no clamp set the clamp to the max possible scaled window */ if (*window_clamp == 0) - (*window_clamp) = (65535<<14); - space = min(*window_clamp,space); + (*window_clamp) = (65535 << 14); + space = min(u32, *window_clamp, space); /* Quantize space offering to a multiple of mss if possible. */ if (space > mss) - space = (space/mss)*mss; + space = (space / mss) * mss; /* NOTE: offering an initial window larger than 32767 * will break some buggy TCP stacks. We try to be nice. @@ -1499,7 +1505,7 @@ static inline void tcp_select_initial_window(int space, __u32 mss, * our initial window offering to 32k. There should also * be a sysctl option to stop being nice. */ - (*rcv_wnd) = min(space, MAX_TCP_WINDOW); + (*rcv_wnd) = min(int, space, MAX_TCP_WINDOW); (*rcv_wscale) = 0; if (wscale_ok) { /* See RFC1323 for an explanation of the limit to 14 */ @@ -1508,7 +1514,7 @@ static inline void tcp_select_initial_window(int space, __u32 mss, (*rcv_wscale)++; } if (*rcv_wscale && sysctl_tcp_app_win && space>=mss && - space - max((space>>sysctl_tcp_app_win), mss>>*rcv_wscale) < 65536/2) + space - max(unsigned int, (space>>sysctl_tcp_app_win), mss>>*rcv_wscale) < 65536/2) (*rcv_wscale)--; } @@ -1526,7 +1532,7 @@ static inline void tcp_select_initial_window(int space, __u32 mss, *rcv_wnd = init_cwnd*mss; } /* Set the clamp no higher than max representable value */ - (*window_clamp) = min(65535<<(*rcv_wscale),*window_clamp); + (*window_clamp) = min(u32, 65535 << (*rcv_wscale), *window_clamp); } static inline int tcp_win_from_space(int space) @@ -1692,8 +1698,8 @@ static inline void tcp_enter_memory_pressure(void) static inline void tcp_moderate_sndbuf(struct sock *sk) { if (!(sk->userlocks&SOCK_SNDBUF_LOCK)) { - sk->sndbuf = min(sk->sndbuf, sk->wmem_queued/2); - sk->sndbuf = max(sk->sndbuf, SOCK_MIN_SNDBUF); + sk->sndbuf = min(int, sk->sndbuf, sk->wmem_queued/2); + sk->sndbuf = max(int, sk->sndbuf, SOCK_MIN_SNDBUF); } } |
