rpms/kernel/devel kernel-2.6.spec, 1.1724, 1.1725 linux-2.6-tux.patch, 1.6, 1.7
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Nov 30 07:41:55 UTC 2005
Author: davej
Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv25899
Modified Files:
kernel-2.6.spec linux-2.6-tux.patch
Log Message:
Tux works again.
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1724
retrieving revision 1.1725
diff -u -r1.1724 -r1.1725
--- kernel-2.6.spec 30 Nov 2005 06:04:59 -0000 1.1724
+++ kernel-2.6.spec 30 Nov 2005 07:41:51 -0000 1.1725
@@ -665,7 +665,7 @@
%patch905 -p1
# Tux
-#%patch910 -p1
+%patch910 -p1
#
# Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems
@@ -1311,6 +1311,7 @@
%changelog
* Wed Nov 30 2005 Dave Jones <davej at redhat.com>
- Revert a broken NFS change from upstream. (#174010)
+- Re-add a rediffed Tux http accelerator.
* Tue Nov 29 2005 David Woodhouse <dwmw2 at redhat.com>
- Fix EHCI panic on initialisation
linux-2.6-tux.patch:
arch/alpha/kernel/systbls.S | 8
arch/i386/kernel/syscall_table.S | 10
arch/ia64/kernel/entry.S | 8
arch/ia64/kernel/ia64_ksyms.c | 5
arch/x86_64/ia32/ia32entry.S | 10
fs/dcache.c | 36
fs/exec.c | 2
fs/fcntl.c | 4
fs/namei.c | 18
fs/namespace.c | 2
fs/open.c | 4
fs/pipe.c | 2
fs/read_write.c | 2
include/asm-alpha/fcntl.h | 1
include/asm-generic/fcntl.h | 4
include/asm-i386/unistd.h | 5
include/asm-ia64/unistd.h | 2
include/asm-sparc/fcntl.h | 1
include/asm-sparc64/fcntl.h | 1
include/asm-x86_64/unistd.h | 10
include/linux/buffer_head.h | 1
include/linux/dcache.h | 8
include/linux/errno.h | 3
include/linux/file.h | 2
include/linux/fs.h | 7
include/linux/kmod.h | 2
include/linux/namei.h | 2
include/linux/net.h | 1
include/linux/sched.h | 5
include/linux/skbuff.h | 2
include/linux/socket.h | 5
include/linux/sysctl.h | 50
include/net/sock.h | 8
include/net/tcp.h | 3
include/net/tux.h | 804 ++++++++++++++
include/net/tux_u.h | 163 ++
kernel/exit.c | 7
kernel/fork.c | 1
kernel/kmod.c | 28
kernel/signal.c | 1
mm/filemap.c | 19
mm/truncate.c | 2
net/Kconfig | 1
net/Makefile | 1
net/core/sock.c | 5
net/ipv4/tcp.c | 3
net/ipv4/tcp_input.c | 1
net/ipv4/tcp_output.c | 1
net/socket.c | 197 ++-
net/tux/Kconfig | 25
net/tux/Makefile | 12
net/tux/abuf.c | 190 +++
net/tux/accept.c | 863 +++++++++++++++
net/tux/cachemiss.c | 265 ++++
net/tux/cgi.c | 171 +++
net/tux/directory.c | 302 +++++
net/tux/extcgi.c | 329 +++++
net/tux/gzip.c | 40
net/tux/input.c | 641 +++++++++++
net/tux/logger.c | 837 ++++++++++++++
net/tux/main.c | 1417 +++++++++++++++++++++++++
net/tux/mod.c | 262 ++++
net/tux/output.c | 352 ++++++
net/tux/parser.h | 102 +
net/tux/postpone.c | 77 +
net/tux/proc.c | 1149 ++++++++++++++++++++
net/tux/proto_ftp.c | 1555 +++++++++++++++++++++++++++
net/tux/proto_http.c | 2197 +++++++++++++++++++++++++++++++++++++++
net/tux/redirect.c | 172 +++
net/tux/times.c | 392 ++++++
net/tux/times.h | 26
net/tux/userspace.c | 27
72 files changed, 12773 insertions(+), 98 deletions(-)
Index: linux-2.6-tux.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-tux.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- linux-2.6-tux.patch 2 Sep 2005 19:28:04 -0000 1.6
+++ linux-2.6-tux.patch 30 Nov 2005 07:41:51 -0000 1.7
@@ -1,8 +1,7 @@
arch/alpha/kernel/systbls.S | 8
arch/i386/kernel/syscall_table.S | 10
arch/ia64/kernel/entry.S | 8
- arch/ia64/kernel/ia64_ksyms.c | 3
- arch/ppc64/kernel/misc.S | 20
+ arch/ia64/kernel/ia64_ksyms.c | 5
arch/x86_64/ia32/ia32entry.S | 10
fs/dcache.c | 36
fs/exec.c | 2
@@ -13,16 +12,11 @@
fs/pipe.c | 2
fs/read_write.c | 2
include/asm-alpha/fcntl.h | 1
- include/asm-i386/fcntl.h | 1
+ include/asm-generic/fcntl.h | 4
include/asm-i386/unistd.h | 5
- include/asm-ia64/fcntl.h | 1
include/asm-ia64/unistd.h | 2
- include/asm-ppc/fcntl.h | 1
- include/asm-ppc64/fcntl.h | 1
- include/asm-s390/fcntl.h | 1
include/asm-sparc/fcntl.h | 1
include/asm-sparc64/fcntl.h | 1
- include/asm-x86_64/fcntl.h | 1
include/asm-x86_64/unistd.h | 10
include/linux/buffer_head.h | 1
include/linux/dcache.h | 8
@@ -36,48 +30,47 @@
include/linux/skbuff.h | 2
include/linux/socket.h | 5
include/linux/sysctl.h | 50
- include/net/sock.h | 6
- include/net/tcp.h | 8
- include/net/tux.h | 802 ++++++++++++++
+ include/net/sock.h | 8
+ include/net/tcp.h | 3
+ include/net/tux.h | 804 ++++++++++++++
include/net/tux_u.h | 163 ++
- kernel/exit.c | 10
+ kernel/exit.c | 7
kernel/fork.c | 1
- kernel/kmod.c | 30
+ kernel/kmod.c | 28
kernel/signal.c | 1
mm/filemap.c | 19
mm/truncate.c | 2
- net/Kconfig | 2
+ net/Kconfig | 1
net/Makefile | 1
+ net/core/sock.c | 5
net/ipv4/tcp.c | 3
net/ipv4/tcp_input.c | 1
- net/ipv4/tcp_ipv4.c | 5
- net/ipv4/tcp_minisocks.c | 3
- net/ipv4/tcp_output.c | 5
- net/socket.c | 137 +-
+ net/ipv4/tcp_output.c | 1
+ net/socket.c | 197 ++-
net/tux/Kconfig | 25
net/tux/Makefile | 12
net/tux/abuf.c | 190 +++
- net/tux/accept.c | 859 +++++++++++++++
+ net/tux/accept.c | 863 +++++++++++++++
net/tux/cachemiss.c | 265 ++++
- net/tux/cgi.c | 160 ++
+ net/tux/cgi.c | 171 +++
net/tux/directory.c | 302 +++++
net/tux/extcgi.c | 329 +++++
net/tux/gzip.c | 40
- net/tux/input.c | 640 +++++++++++
- net/tux/logger.c | 836 ++++++++++++++
- net/tux/main.c | 1413 +++++++++++++++++++++++++
+ net/tux/input.c | 641 +++++++++++
+ net/tux/logger.c | 837 ++++++++++++++
+ net/tux/main.c | 1417 +++++++++++++++++++++++++
net/tux/mod.c | 262 ++++
net/tux/output.c | 352 ++++++
net/tux/parser.h | 102 +
net/tux/postpone.c | 77 +
net/tux/proc.c | 1149 ++++++++++++++++++++
- net/tux/proto_ftp.c | 1549 +++++++++++++++++++++++++++
+ net/tux/proto_ftp.c | 1555 +++++++++++++++++++++++++++
net/tux/proto_http.c | 2197 +++++++++++++++++++++++++++++++++++++++
- net/tux/redirect.c | 167 ++
+ net/tux/redirect.c | 172 +++
net/tux/times.c | 392 ++++++
net/tux/times.h | 26
net/tux/userspace.c | 27
- 79 files changed, 12739 insertions(+), 74 deletions(-)
+ 72 files changed, 12773 insertions(+), 98 deletions(-)
Index: linux/arch/alpha/kernel/systbls.S
===================================================================
@@ -124,7 +117,7 @@
===================================================================
--- linux.orig/arch/ia64/kernel/entry.S
+++ linux/arch/ia64/kernel/entry.S
-@@ -1423,7 +1423,15 @@ sys_call_table:
+@@ -1440,7 +1440,15 @@ sys_call_table:
data8 sys_syslog
data8 sys_setitimer
data8 sys_getitimer
@@ -142,8 +135,8 @@
data8 sys_vhangup
Index: linux/arch/ia64/kernel/ia64_ksyms.c
===================================================================
---- linux-2.6.12/arch/ia64/kernel/ia64_ksyms.c~ 2005-07-12 17:30:24.000000000 -0400
-+++ linux-2.6.12/arch/ia64/kernel/ia64_ksyms.c 2005-07-12 17:30:45.000000000 -0400
+--- linux.orig/arch/ia64/kernel/ia64_ksyms.c
++++ linux/arch/ia64/kernel/ia64_ksyms.c
@@ -58,6 +58,11 @@ EXPORT_SYMBOL(__strlen_user);
EXPORT_SYMBOL(__strncpy_from_user);
EXPORT_SYMBOL(__strnlen_user);
@@ -156,49 +149,11 @@
/* from arch/ia64/lib */
extern void __divsi3(void);
extern void __udivsi3(void);
-Index: linux/arch/ppc64/kernel/misc.S
-===================================================================
---- linux.orig/arch/ppc64/kernel/misc.S
-+++ linux/arch/ppc64/kernel/misc.S
-@@ -1079,7 +1079,15 @@ _GLOBAL(sys_call_table32)
- .llong .compat_sys_sched_setaffinity
- .llong .compat_sys_sched_getaffinity
- .llong .sys_ni_syscall
-- .llong .sys_ni_syscall /* 225 - reserved for tux */
-+#ifdef CONFIG_TUX
-+ .llong .__sys_tux
-+#else
-+# ifdef CONFIG_TUX_MODULE
-+ .llong .sys_tux
-+# else
-+ .llong .sys_ni_syscall
-+# endif
-+#endif
- .llong .sys32_sendfile64
- .llong .compat_sys_io_setup
- .llong .sys_io_destroy
-@@ -1355,7 +1363,15 @@ _GLOBAL(sys_call_table)
- .llong .sys_sched_setaffinity
- .llong .sys_sched_getaffinity
- .llong .sys_ni_syscall
-- .llong .sys_ni_syscall /* 225 - reserved for tux */
-+#ifdef CONFIG_TUX
-+ .llong .__sys_tux
-+#else
-+# ifdef CONFIG_TUX_MODULE
-+ .llong .sys_tux
-+# else
-+ .llong .sys_ni_syscall
-+# endif
-+#endif
- .llong .sys_ni_syscall /* 32bit only sendfile64 */
- .llong .sys_io_setup
- .llong .sys_io_destroy
Index: linux/arch/x86_64/ia32/ia32entry.S
===================================================================
--- linux.orig/arch/x86_64/ia32/ia32entry.S
+++ linux/arch/x86_64/ia32/ia32entry.S
-@@ -528,7 +528,15 @@ ia32_sys_call_table:
+@@ -571,7 +571,15 @@ ia32_sys_call_table:
.quad sys_madvise
.quad compat_sys_getdents64 /* 220 getdents64 */
.quad compat_sys_fcntl64
@@ -219,7 +174,7 @@
===================================================================
--- linux.orig/fs/dcache.c
+++ linux/fs/dcache.c
-@@ -85,6 +85,10 @@ static void d_free(struct dentry *dentry
+@@ -86,6 +86,10 @@ static void d_free(struct dentry *dentry
{
if (dentry->d_op && dentry->d_op->d_release)
dentry->d_op->d_release(dentry);
@@ -230,7 +185,7 @@
call_rcu(&dentry->d_rcu, d_callback);
}
-@@ -747,6 +751,7 @@ struct dentry *d_alloc(struct dentry * p
+@@ -742,6 +746,7 @@ struct dentry *d_alloc(struct dentry * p
dentry->d_sb = NULL;
dentry->d_op = NULL;
dentry->d_fsdata = NULL;
@@ -238,7 +193,7 @@
dentry->d_mounted = 0;
dentry->d_cookie = NULL;
INIT_HLIST_NODE(&dentry->d_hash);
-@@ -1312,6 +1317,16 @@ already_unhashed:
+@@ -1310,6 +1315,16 @@ already_unhashed:
/* Unhash the target: dput() will then get rid of it */
__d_drop(target);
@@ -255,7 +210,7 @@
list_del(&dentry->d_child);
list_del(&target->d_child);
-@@ -1355,7 +1370,7 @@ already_unhashed:
+@@ -1353,7 +1368,7 @@ already_unhashed:
*
* "buflen" should be positive. Caller holds the dcache_lock.
*/
@@ -264,7 +219,7 @@
struct dentry *root, struct vfsmount *rootmnt,
char *buffer, int buflen)
{
-@@ -1423,6 +1438,8 @@ Elong:
+@@ -1421,6 +1436,8 @@ Elong:
return ERR_PTR(-ENAMETOOLONG);
}
@@ -273,7 +228,7 @@
/* write full pathname into buffer and return start of pathname */
char * d_path(struct dentry *dentry, struct vfsmount *vfsmnt,
char *buf, int buflen)
-@@ -1665,6 +1682,23 @@ static void __init dcache_init_early(voi
+@@ -1663,6 +1680,23 @@ static void __init dcache_init_early(voi
INIT_HLIST_HEAD(&dentry_hashtable[loop]);
}
@@ -301,7 +256,7 @@
===================================================================
--- linux.orig/fs/exec.c
+++ linux/fs/exec.c
-@@ -1444,6 +1444,8 @@ int do_coredump(long signr, int exit_cod
+@@ -1450,6 +1450,8 @@ int do_coredump(long signr, int exit_cod
binfmt = current->binfmt;
if (!binfmt || !binfmt->core_dump)
goto fail;
@@ -314,7 +269,7 @@
===================================================================
--- linux.orig/fs/fcntl.c
+++ linux/fs/fcntl.c
-@@ -98,7 +98,7 @@ out:
+@@ -111,7 +111,7 @@ out:
return error;
}
@@ -322,8 +277,8 @@
+int dupfd(struct file *file, unsigned int start)
{
struct files_struct * files = current->files;
- int fd;
-@@ -118,6 +118,8 @@ static int dupfd(struct file *file, unsi
+ struct fdtable *fdt;
+@@ -134,6 +134,8 @@ static int dupfd(struct file *file, unsi
return fd;
}
@@ -336,7 +291,7 @@
===================================================================
--- linux.orig/fs/namei.c
+++ linux/fs/namei.c
-@@ -670,7 +670,7 @@ static inline void follow_dotdot(struct
+@@ -732,7 +732,7 @@ static inline void follow_dotdot(struct
* It _is_ time-critical.
*/
static int do_lookup(struct nameidata *nd, struct qstr *name,
@@ -345,7 +300,7 @@
{
struct vfsmount *mnt = nd->mnt;
struct dentry *dentry = __d_lookup(nd->dentry, name);
-@@ -686,12 +686,16 @@ done:
+@@ -748,12 +748,16 @@ done:
return 0;
need_lookup:
@@ -362,7 +317,7 @@
if (dentry->d_op->d_revalidate(dentry, nd))
goto done;
if (d_invalidate(dentry))
-@@ -715,9 +719,11 @@ static fastcall int __link_path_walk(con
+@@ -777,9 +781,11 @@ static fastcall int __link_path_walk(con
{
struct path next;
struct inode *inode;
@@ -376,16 +331,16 @@
while (*name=='/')
name++;
if (!*name)
-@@ -787,7 +793,7 @@ static fastcall int __link_path_walk(con
+@@ -848,7 +854,7 @@ static fastcall int __link_path_walk(con
+ break;
}
- nd->flags |= LOOKUP_CONTINUE;
/* This does the actual lookups.. */
- err = do_lookup(nd, &this, &next);
+ err = do_lookup(nd, &this, &next, atomic);
if (err)
break;
-@@ -846,7 +852,7 @@ last_component:
+@@ -902,7 +908,7 @@ last_component:
if (err < 0)
break;
}
@@ -394,7 +349,7 @@
if (err)
break;
inode = next.dentry->d_inode;
-@@ -1246,6 +1252,8 @@ static inline int lookup_flags(unsigned
+@@ -1354,6 +1360,8 @@ static inline int lookup_flags(unsigned
if (f & O_DIRECTORY)
retval |= LOOKUP_DIRECTORY;
@@ -407,7 +362,7 @@
===================================================================
--- linux.orig/fs/namespace.c
+++ linux/fs/namespace.c
-@@ -1208,6 +1208,8 @@ void set_fs_root(struct fs_struct *fs, s
+@@ -1465,6 +1465,8 @@ void set_fs_root(struct fs_struct *fs, s
}
}
@@ -420,7 +375,7 @@
===================================================================
--- linux.orig/fs/open.c
+++ linux/fs/open.c
-@@ -537,6 +537,8 @@ out:
+@@ -542,6 +542,8 @@ out:
return error;
}
@@ -429,7 +384,7 @@
asmlinkage long sys_fchdir(unsigned int fd)
{
struct file *file;
-@@ -593,6 +595,8 @@ out:
+@@ -598,6 +600,8 @@ out:
return error;
}
@@ -442,7 +397,7 @@
===================================================================
--- linux.orig/fs/pipe.c
+++ linux/fs/pipe.c
-@@ -793,6 +793,8 @@ no_files:
+@@ -798,6 +798,8 @@ no_files:
return error;
}
@@ -468,7 +423,7 @@
===================================================================
--- linux.orig/include/asm-alpha/fcntl.h
+++ linux/include/asm-alpha/fcntl.h
-@@ -20,6 +20,7 @@
+@@ -14,6 +14,7 @@
#define O_DIRECTORY 0100000 /* must be a directory */
#define O_NOFOLLOW 0200000 /* don't follow links */
#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */
@@ -476,31 +431,34 @@
#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
#define O_NOATIME 04000000
-Index: linux/include/asm-i386/fcntl.h
+Index: linux/include/asm-generic/fcntl.h
===================================================================
---- linux.orig/include/asm-i386/fcntl.h
-+++ linux/include/asm-i386/fcntl.h
-@@ -21,6 +21,7 @@
- #define O_DIRECTORY 0200000 /* must be a directory */
- #define O_NOFOLLOW 0400000 /* don't follow links */
+--- linux.orig/include/asm-generic/fcntl.h
++++ linux/include/asm-generic/fcntl.h
+@@ -49,6 +49,10 @@
+ #ifndef O_NOATIME
#define O_NOATIME 01000000
-+#define O_ATOMICLOOKUP 02000000 /* do atomic file lookup */
-
- #define F_DUPFD 0 /* dup */
- #define F_GETFD 1 /* get close_on_exec */
+ #endif
++#ifndef O_ATOMICLOOKUP
++#define O_ATOMICLOOKUP 02000000 /* do atomic file lookup */
++#endif
++
+ #ifndef O_NDELAY
+ #define O_NDELAY O_NONBLOCK
+ #endif
Index: linux/include/asm-i386/unistd.h
===================================================================
--- linux.orig/include/asm-i386/unistd.h
+++ linux/include/asm-i386/unistd.h
-@@ -299,6 +299,7 @@
+@@ -302,6 +302,7 @@
- #define NR_syscalls 291
+ #define NR_syscalls 294
+#ifndef __KERNEL_SYSCALLS_NO_ERRNO__
/*
* user-visible error numbers are in the range -1 - -128: see
* <asm-i386/errno.h>
-@@ -312,6 +313,10 @@ do { \
+@@ -315,6 +316,10 @@ do { \
return (type) (res); \
} while (0)
@@ -511,18 +469,6 @@
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \
type name(void) \
-Index: linux/include/asm-ia64/fcntl.h
-===================================================================
---- linux.orig/include/asm-ia64/fcntl.h
-+++ linux/include/asm-ia64/fcntl.h
-@@ -29,6 +29,7 @@
- #define O_DIRECTORY 0200000 /* must be a directory */
- #define O_NOFOLLOW 0400000 /* don't follow links */
- #define O_NOATIME 01000000
-+#define O_ATOMICLOOKUP 02000000 /* do atomic file lookup */
-
- #define F_DUPFD 0 /* dup */
- #define F_GETFD 1 /* get close_on_exec */
Index: linux/include/asm-ia64/unistd.h
===================================================================
--- linux.orig/include/asm-ia64/unistd.h
@@ -536,49 +482,13 @@
/* 1121 was __NR_old_lstat */
/* 1122 was __NR_old_fstat */
#define __NR_vhangup 1123
-Index: linux/include/asm-ppc/fcntl.h
-===================================================================
---- linux.orig/include/asm-ppc/fcntl.h
-+++ linux/include/asm-ppc/fcntl.h
-@@ -21,6 +21,7 @@
- #define O_LARGEFILE 0200000
- #define O_DIRECT 0400000 /* direct disk access hint */
- #define O_NOATIME 01000000
-+#define O_ATOMICLOOKUP 01000000 /* tux hack */
-
- #define F_DUPFD 0 /* dup */
- #define F_GETFD 1 /* get close_on_exec */
-Index: linux/include/asm-ppc64/fcntl.h
-===================================================================
---- linux.orig/include/asm-ppc64/fcntl.h
-+++ linux/include/asm-ppc64/fcntl.h
-@@ -28,6 +28,7 @@
- #define O_LARGEFILE 0200000
- #define O_DIRECT 0400000 /* direct disk access hint */
- #define O_NOATIME 01000000
-+#define O_ATOMICLOOKUP 02000000 /* do atomic file lookup */
-
- #define F_DUPFD 0 /* dup */
- #define F_GETFD 1 /* get close_on_exec */
-Index: linux/include/asm-s390/fcntl.h
-===================================================================
---- linux.orig/include/asm-s390/fcntl.h
-+++ linux/include/asm-s390/fcntl.h
-@@ -28,6 +28,7 @@
- #define O_DIRECTORY 0200000 /* must be a directory */
- #define O_NOFOLLOW 0400000 /* don't follow links */
- #define O_NOATIME 01000000
-+#define O_ATOMICLOOKUP 02000000 /* do atomic file lookup (tux) */
-
- #define F_DUPFD 0 /* dup */
- #define F_GETFD 1 /* get close_on_exec */
Index: linux/include/asm-sparc/fcntl.h
===================================================================
--- linux.orig/include/asm-sparc/fcntl.h
+++ linux/include/asm-sparc/fcntl.h
-@@ -20,6 +20,7 @@
- #define O_DIRECTORY 0x10000 /* must be a directory */
- #define O_NOFOLLOW 0x20000 /* don't follow links */
+@@ -14,6 +14,7 @@
+ #define O_NDELAY (0x0004 | O_NONBLOCK)
+ #define O_NOCTTY 0x8000 /* not fcntl */
#define O_LARGEFILE 0x40000
+#define O_ATOMICLOOKUP 0x80000 /* do atomic file lookup */
#define O_DIRECT 0x100000 /* direct disk access hint */
@@ -588,26 +498,14 @@
===================================================================
--- linux.orig/include/asm-sparc64/fcntl.h
+++ linux/include/asm-sparc64/fcntl.h
-@@ -20,6 +20,7 @@
- #define O_DIRECTORY 0x10000 /* must be a directory */
- #define O_NOFOLLOW 0x20000 /* don't follow links */
+@@ -14,6 +14,7 @@
+ #define O_NONBLOCK 0x4000
+ #define O_NOCTTY 0x8000 /* not fcntl */
#define O_LARGEFILE 0x40000
+#define O_ATOMICLOOKUP 0x80000 /* do atomic file lookup */
#define O_DIRECT 0x100000 /* direct disk access hint */
#define O_NOATIME 0x200000
-Index: linux/include/asm-x86_64/fcntl.h
-===================================================================
---- linux.orig/include/asm-x86_64/fcntl.h
-+++ linux/include/asm-x86_64/fcntl.h
-@@ -21,6 +21,7 @@
- #define O_DIRECTORY 0200000 /* must be a directory */
- #define O_NOFOLLOW 0400000 /* don't follow links */
- #define O_NOATIME 01000000
-+#define O_ATOMICLOOKUP 02000000 /* TUX */
-
- #define F_DUPFD 0 /* dup */
- #define F_GETFD 1 /* get close_on_exec */
Index: linux/include/asm-x86_64/unistd.h
===================================================================
--- linux.orig/include/asm-x86_64/unistd.h
@@ -633,7 +531,7 @@
===================================================================
--- linux.orig/include/linux/buffer_head.h
+++ linux/include/linux/buffer_head.h
-@@ -196,6 +196,7 @@ int cont_prepare_write(struct page*, uns
+@@ -200,6 +200,7 @@ int cont_prepare_write(struct page*, uns
int generic_cont_expand(struct inode *inode, loff_t size) ;
int block_commit_write(struct page *page, unsigned from, unsigned to);
int block_sync_page(struct page *);
@@ -645,14 +543,14 @@
===================================================================
--- linux.orig/include/linux/dcache.h
+++ linux/include/linux/dcache.h
-@@ -101,6 +101,7 @@ struct dentry {
+@@ -102,6 +102,7 @@ struct dentry {
struct dentry_operations *d_op;
struct super_block *d_sb; /* The root of the dentry tree */
void *d_fsdata; /* fs-specific data */
+ void * d_extra_attributes; /* TUX-specific data */
struct rcu_head d_rcu;
struct dcookie_struct *d_cookie; /* cookie, if any */
- struct hlist_node d_hash; /* lookup hash list */
+ int d_mounted;
@@ -211,6 +212,7 @@ extern void shrink_dcache_sb(struct supe
extern void shrink_dcache_parent(struct dentry *);
extern void shrink_dcache_anon(struct hlist_head *);
@@ -693,7 +591,7 @@
===================================================================
--- linux.orig/include/linux/file.h
+++ linux/include/linux/file.h
-@@ -81,4 +81,6 @@ struct task_struct;
+@@ -95,4 +95,6 @@ struct task_struct;
struct files_struct *get_files_struct(struct task_struct *);
void FASTCALL(put_files_struct(struct files_struct *fs));
@@ -704,7 +602,7 @@
===================================================================
--- linux.orig/include/linux/fs.h
+++ linux/include/linux/fs.h
-@@ -1503,7 +1503,7 @@ ssize_t generic_file_write_nolock(struct
+@@ -1537,7 +1537,7 @@ ssize_t generic_file_write_nolock(struct
extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
extern void do_generic_mapping_read(struct address_space *mapping,
struct file_ra_state *, struct file *,
@@ -712,8 +610,8 @@
+ loff_t *, read_descriptor_t *, read_actor_t, int);
extern void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
- extern ssize_t generic_file_direct_IO(int rw, struct kiocb *iocb,
-@@ -1537,14 +1537,15 @@ static inline int xip_truncate_page(stru
+ extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
+@@ -1569,14 +1569,15 @@ static inline int xip_truncate_page(stru
static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
read_descriptor_t * desc,
@@ -747,7 +645,7 @@
===================================================================
--- linux.orig/include/linux/namei.h
+++ linux/include/linux/namei.h
-@@ -47,6 +47,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
+@@ -48,6 +48,8 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
#define LOOKUP_PARENT 16
#define LOOKUP_NOALT 32
#define LOOKUP_REVAL 64
@@ -760,7 +658,7 @@
===================================================================
--- linux.orig/include/linux/net.h
+++ linux/include/linux/net.h
-@@ -181,6 +181,7 @@ extern int sock_create_kern(int fam
+@@ -183,6 +183,7 @@ extern int sock_create_kern(int fam
struct socket **res);
extern int sock_create_lite(int family, int type, int proto,
struct socket **res);
@@ -772,7 +670,7 @@
===================================================================
--- linux.orig/include/linux/sched.h
+++ linux/include/linux/sched.h
-@@ -716,6 +716,11 @@ struct task_struct {
+@@ -807,6 +807,11 @@ struct task_struct {
int (*notifier)(void *priv);
void *notifier_data;
sigset_t *notifier_mask;
@@ -788,9 +686,9 @@
===================================================================
--- linux.orig/include/linux/skbuff.h
+++ linux/include/linux/skbuff.h
-@@ -1223,6 +1223,8 @@ static inline void *skb_header_pointer(c
- extern void skb_init(void);
- extern void skb_add_mtu(int mtu);
+@@ -1327,6 +1327,8 @@ static inline unsigned int skb_checksum_
+ __skb_checksum_complete(skb);
+ }
+struct tux_req_struct;
+
@@ -801,7 +699,7 @@
===================================================================
--- linux.orig/include/linux/socket.h
+++ linux/include/linux/socket.h
-@@ -290,6 +290,11 @@ extern int move_addr_to_user(void *kaddr
+@@ -299,6 +299,11 @@ extern int move_addr_to_user(void *kaddr
extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr);
extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
@@ -817,15 +715,15 @@
===================================================================
--- linux.orig/include/linux/sysctl.h
+++ linux/include/linux/sysctl.h
-@@ -194,6 +194,7 @@ enum
- NET_DECNET=15,
- NET_ECONET=16,
- NET_SCTP=17,
-+ NET_TUX=18,
+@@ -205,6 +205,7 @@ enum
+ NET_SCTP=17,
+ NET_LLC=18,
+ NET_NETFILTER=19,
++ NET_TUX=20,
};
/* /proc/sys/kernel/random */
-@@ -652,6 +653,55 @@ enum {
+@@ -725,6 +726,55 @@ enum {
NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
};
@@ -894,7 +792,7 @@
#ifdef SOCK_DEBUGGING
#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
printk(KERN_DEBUG msg); } while (0)
-@@ -158,7 +158,7 @@ struct sock_common {
+@@ -161,7 +161,7 @@ struct sock_common {
* @sk_timer: sock cleanup timer
* @sk_stamp: time stamp of last packet received
* @sk_socket: Identd and reporting IO signals
@@ -903,15 +801,15 @@
* @sk_sndmsg_page: cached page for sendmsg
* @sk_sndmsg_off: cached offset for sendmsg
* @sk_send_head: front of stuff to transmit
-@@ -168,6 +168,7 @@ struct sock_common {
+@@ -171,6 +171,7 @@ struct sock_common {
* @sk_data_ready: callback to indicate there is data to be processed
* @sk_write_space: callback to indicate there is bf sending space available
* @sk_error_report: callback to indicate errors (e.g. %MSG_ERRQUEUE)
-+ * @sk_create_child - callback to get new socket events
++ * @sk_create_child - callback to get new socket events
* @sk_backlog_rcv: callback to process the backlog
* @sk_destruct: called at sock freeing time, i.e. when all refcnt == 0
*/
-@@ -247,6 +248,7 @@ struct sock {
+@@ -250,6 +251,7 @@ struct sock {
void (*sk_error_report)(struct sock *sk);
int (*sk_backlog_rcv)(struct sock *sk,
struct sk_buff *skb);
@@ -919,11 +817,20 @@
void (*sk_destruct)(struct sock *sk);
};
+@@ -742,7 +744,7 @@ extern struct sock *sk_alloc(int family
+ gfp_t priority,
+ struct proto *prot, int zero_it);
+ extern void sk_free(struct sock *sk);
+-extern struct sock *sk_clone(const struct sock *sk,
++extern struct sock *sk_clone(struct sock *sk,
+ const gfp_t priority);
+
+ extern struct sk_buff *sock_wmalloc(struct sock *sk,
Index: linux/include/net/tcp.h
===================================================================
--- linux.orig/include/net/tcp.h
+++ linux/include/net/tcp.h
-@@ -680,6 +680,8 @@ extern void tcp_shutdown (struct sock
+@@ -310,6 +310,8 @@ extern void tcp_shutdown (struct sock
extern int tcp_v4_rcv(struct sk_buff *skb);
@@ -931,21 +838,20 @@
+
extern int tcp_v4_remember_stamp(struct sock *sk);
- extern int tcp_v4_tw_remember_stamp(struct tcp_tw_bucket *tw);
-@@ -858,6 +860,7 @@ extern int tcp_send_synack(struct sock
- extern void tcp_push_one(struct sock *, unsigned mss_now);
+ extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
+@@ -467,6 +469,7 @@ extern int tcp_send_synack(struct sock
+ extern void tcp_push_one(struct sock *, unsigned int mss_now);
extern void tcp_send_ack(struct sock *sk);
extern void tcp_send_delayed_ack(struct sock *sk);
+extern void cleanup_rbuf(struct sock *sk, int copied);
- /* tcp_timer.c */
- extern void tcp_init_xmit_timers(struct sock *);
-
+ /* tcp_input.c */
+ extern void tcp_cwnd_application_limited(struct sock *sk);
Index: linux/include/net/tux.h
===================================================================
--- /dev/null
+++ linux/include/net/tux.h
-@@ -0,0 +1,802 @@
+@@ -0,0 +1,804 @@
+#ifndef _NET_TUX_H
+#define _NET_TUX_H
+
@@ -1009,8 +915,7 @@
+extern int tux_TDprintk;
+extern int tux_Dprintk;
+
-+#define TUX_DEBUG CONFIG_TUX_DEBUG
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+# define TUX_BUG() BUG()
+
+# define TUX_DPRINTK 1
@@ -1331,7 +1236,7 @@
+ /* the file being sent */
+
+ unsigned int bytes_sent;
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ unsigned int bytes_expected;
+#endif
+ unsigned long first_timestamp;
@@ -1370,7 +1275,7 @@
+ void (*ftp_real_create_child)(struct sock *sk, struct sock *newsk);
+ void (*ftp_real_destruct)(struct sock *sk);
+
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ unsigned long accept_timestamp;
+ unsigned long parse_timestamp;
+ unsigned long output_timestamp;
@@ -1449,7 +1354,7 @@
+ MIME_TYPE_MODULE,
+} special_mimetypes_t;
+
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+#if 0
+extern inline void url_hist_hit (int size)
+{
@@ -1747,6 +1652,9 @@
+
+#define tux_close(fd) sys_close(fd)
+
++extern int init_tux_request_slabs(void);
++extern void free_tux_request_slabs(void);
++
+#endif
Index: linux/include/net/tux_u.h
===================================================================
@@ -1920,9 +1828,9 @@
===================================================================
--- linux.orig/kernel/exit.c
+++ linux/kernel/exit.c
-@@ -832,6 +832,13 @@ fastcall NORET_TYPE void do_exit(long co
- if (group_dead) {
+@@ -845,6 +845,13 @@ fastcall NORET_TYPE void do_exit(long co
del_timer_sync(&tsk->signal->real_timer);
+ exit_itimers(tsk->signal);
acct_process(code);
+ if (current->tux_info) {
+#ifdef CONFIG_TUX_DEBUG
@@ -1938,7 +1846,7 @@
===================================================================
--- linux.orig/kernel/fork.c
+++ linux/kernel/fork.c
-@@ -875,6 +875,7 @@ static task_t *copy_process(unsigned lon
+@@ -896,6 +896,7 @@ static task_t *copy_process(unsigned lon
p = dup_task_struct(current);
if (!p)
goto fork_out;
@@ -1950,28 +1858,24 @@
===================================================================
--- linux.orig/kernel/kmod.c
+++ linux/kernel/kmod.c
-@@ -128,17 +128,17 @@ struct subprocess_info {
+@@ -128,14 +128,14 @@ struct subprocess_info {
/*
* This is the task which runs the usermode application
*/
-static int ____call_usermodehelper(void *data)
-+int __exec_usermodehelper(char *path, char **argv, char **envp,
-+ struct key *ring)
++int
++__exec_usermodehelper(char *path, char **argv, char **envp, struct key *ring)
{
- struct subprocess_info *sub_info = data;
- struct key *old_session;
+ struct key *new_session, *old_session;
int retval;
/* Unblock all signals and set the session keyring. */
-- key_get(sub_info->ring);
-+ key_get(ring);
+- new_session = key_get(sub_info->ring);
++ new_session = key_get(ring);
flush_signals(current);
spin_lock_irq(¤t->sighand->siglock);
-- old_session = __install_session_keyring(current, sub_info->ring);
-+ old_session = __install_session_keyring(current, ring);
- flush_signal_handlers(current, 1);
- sigemptyset(¤t->blocked);
- recalc_sigpending();
+ old_session = __install_session_keyring(current, new_session);
@@ -146,12 +146,28 @@ static int ____call_usermodehelper(void
key_put(old_session);
@@ -2008,7 +1912,7 @@
===================================================================
--- linux.orig/kernel/signal.c
+++ linux/kernel/signal.c
-@@ -441,6 +441,7 @@ flush_signal_handlers(struct task_struct
+@@ -430,6 +430,7 @@ flush_signal_handlers(struct task_struct
}
}
@@ -2020,7 +1924,7 @@
===================================================================
--- linux.orig/mm/filemap.c
+++ linux/mm/filemap.c
-@@ -715,7 +715,8 @@ void do_generic_mapping_read(struct addr
+@@ -718,7 +718,8 @@ void do_generic_mapping_read(struct addr
struct file *filp,
loff_t *ppos,
read_descriptor_t *desc,
@@ -2030,7 +1934,7 @@
{
struct inode *inode = mapping->host;
unsigned long index;
-@@ -765,11 +766,21 @@ void do_generic_mapping_read(struct addr
+@@ -768,11 +769,21 @@ void do_generic_mapping_read(struct addr
find_page:
page = find_get_page(mapping, index);
if (unlikely(page == NULL)) {
@@ -2053,16 +1957,16 @@
page_ok:
/* If users can be writing to this page using arbitrary
-@@ -1025,7 +1036,7 @@ __generic_file_aio_read(struct kiocb *io
+@@ -1028,7 +1039,7 @@ __generic_file_aio_read(struct kiocb *io
if (desc.count == 0)
continue;
desc.error = 0;
- do_generic_file_read(filp,ppos,&desc,file_read_actor);
+ do_generic_file_read(filp,ppos,&desc,file_read_actor,0);
retval += desc.written;
- if (!retval) {
- retval = desc.error;
-@@ -1099,7 +1110,7 @@ ssize_t generic_file_sendfile(struct fil
+ if (desc.error) {
+ retval = retval ?: desc.error;
+@@ -1102,7 +1113,7 @@ ssize_t generic_file_sendfile(struct fil
desc.arg.data = target;
desc.error = 0;
@@ -2075,7 +1979,7 @@
===================================================================
--- linux.orig/mm/truncate.c
+++ linux/mm/truncate.c
-@@ -233,6 +233,8 @@ unlock:
+@@ -224,6 +224,8 @@ unlock:
return ret;
}
@@ -2086,10 +1990,9 @@
return invalidate_mapping_pages(mapping, 0, ~0UL);
Index: linux/net/Kconfig
===================================================================
---- linux-2.6.12/net/Kconfig~ 2005-07-13 02:03:04.000000000 -0400
-+++ linux-2.6.12/net/Kconfig 2005-07-13 02:03:10.000000000 -0400
-@@ -216,6 +216,7 @@ source "net/ax25/Kconfig"
- source "net/ax25/Kconfig"
+--- linux.orig/net/Kconfig
++++ linux/net/Kconfig
+@@ -215,6 +215,7 @@ source "net/ax25/Kconfig"
source "net/irda/Kconfig"
source "net/bluetooth/Kconfig"
source "net/ieee80211/Kconfig"
@@ -2101,7 +2004,7 @@
===================================================================
--- linux.orig/net/Makefile
+++ linux/net/Makefile
-@@ -21,6 +21,7 @@ obj-$(CONFIG_UNIX) += unix/
+@@ -22,6 +22,7 @@ obj-$(CONFIG_UNIX) += unix/
ifneq ($(CONFIG_IPV6),)
obj-y += ipv6/
endif
@@ -2109,11 +2012,34 @@
obj-$(CONFIG_PACKET) += packet/
obj-$(CONFIG_NET_KEY) += key/
obj-$(CONFIG_NET_SCHED) += sched/
+Index: linux/net/core/sock.c
+===================================================================
+--- linux.orig/net/core/sock.c
++++ linux/net/core/sock.c
+@@ -704,7 +704,7 @@ void sk_free(struct sock *sk)
+ module_put(owner);
+ }
+
+-struct sock *sk_clone(const struct sock *sk, const gfp_t priority)
++struct sock *sk_clone(struct sock *sk, const gfp_t priority)
+ {
+ struct sock *newsk = sk_alloc(sk->sk_family, priority, sk->sk_prot, 0);
+
+@@ -741,6 +741,9 @@ struct sock *sk_clone(const struct sock
+ if (filter != NULL)
+ sk_filter_charge(newsk, filter);
+
++ if (sk->sk_create_child)
++ sk->sk_create_child(sk, newsk);
++
+ if (unlikely(xfrm_sk_clone_policy(newsk))) {
+ /* It is still raw copy of parent, so invalidate
+ * destructor and make plain sk_free() */
Index: linux/net/ipv4/tcp.c
===================================================================
--- linux.orig/net/ipv4/tcp.c
+++ linux/net/ipv4/tcp.c
-@@ -1042,7 +1042,7 @@ static int tcp_recv_urg(struct sock *sk,
+@@ -936,7 +936,7 @@ static int tcp_recv_urg(struct sock *sk,
* calculation of whether or not we must ACK for the sake of
* a window update.
*/
@@ -2122,7 +2048,7 @@
{
struct tcp_sock *tp = tcp_sk(sk);
int time_to_ack = 0;
-@@ -2141,3 +2141,4 @@ EXPORT_SYMBOL(tcp_sendpage);
+@@ -2144,3 +2144,4 @@ EXPORT_SYMBOL(tcp_sendpage);
EXPORT_SYMBOL(tcp_setsockopt);
EXPORT_SYMBOL(tcp_shutdown);
EXPORT_SYMBOL(tcp_statistics);
@@ -2131,81 +2057,26 @@
===================================================================
--- linux.orig/net/ipv4/tcp_input.c
+++ linux/net/ipv4/tcp_input.c
-@@ -3308,6 +3308,7 @@ void tcp_cwnd_application_limited(struct
- tp->snd_cwnd_stamp = tcp_time_stamp;
+@@ -3433,6 +3433,7 @@ static int tcp_prune_queue(struct sock *
+ return -1;
}
+EXPORT_SYMBOL_GPL(tcp_cwnd_application_limited);
- /* When incoming ACK allowed to free some skb from write_queue,
- * we remember this event in flag SOCK_QUEUE_SHRUNK and wake up socket
-Index: linux/net/ipv4/tcp_ipv4.c
-===================================================================
---- linux.orig/net/ipv4/tcp_ipv4.c
-+++ linux/net/ipv4/tcp_ipv4.c
-@@ -451,8 +451,7 @@ static struct sock *__tcp_v4_lookup_list
- }
-
- /* Optimize the common listener case. */
--static inline struct sock *tcp_v4_lookup_listener(u32 daddr,
-- unsigned short hnum, int dif)
-+struct sock *tcp_v4_lookup_listener(u32 daddr, unsigned short hnum, int dif)
- {
- struct sock *sk = NULL;
- struct hlist_head *head;
-@@ -477,6 +476,8 @@ sherry_cache:
- return sk;
- }
-
-+EXPORT_SYMBOL_GPL(tcp_v4_lookup_listener);
-+
- /* Sockets in TCP_CLOSE state are _always_ taken out of the hash, so
- * we need not check it for TCP lookups anymore, thanks Alexey. -DaveM
- *
-Index: linux/net/ipv4/tcp_minisocks.c
-===================================================================
---- linux.orig/net/ipv4/tcp_minisocks.c
-+++ linux/net/ipv4/tcp_minisocks.c
-@@ -730,6 +730,9 @@ struct sock *tcp_create_openreq_child(st
- if ((filter = newsk->sk_filter) != NULL)
- sk_filter_charge(newsk, filter);
-
-+ if (sk->sk_create_child)
-+ sk->sk_create_child(sk, newsk);
-+
- if (unlikely(xfrm_sk_clone_policy(newsk))) {
- /* It is still raw copy of parent, so invalidate
- * destructor and make plain sk_free() */
+ /* RFC2861, slow part. Adjust cwnd, after it was not full during one rto.
+ * As additional protections, we do not touch cwnd in retransmission phases,
Index: linux/net/ipv4/tcp_output.c
===================================================================
--- linux.orig/net/ipv4/tcp_output.c
+++ linux/net/ipv4/tcp_output.c
-@@ -455,6 +455,8 @@ void tcp_set_skb_tso_segs(struct sock *s
+@@ -1069,6 +1069,7 @@ void __tcp_push_pending_frames(struct so
+ tcp_check_probe_timer(sk, tp);
}
}
++EXPORT_SYMBOL_GPL(__tcp_push_pending_frames);
-+EXPORT_SYMBOL_GPL(tcp_set_skb_tso_segs);
-+
- /* Function to create two new TCP segments. Shrinks the given segment
- * to the specified size and appends a new segment with the rest of the
- * packet to the list. This won't be called frequently, I hope.
-@@ -721,6 +723,7 @@ unsigned int tcp_current_mss(struct sock
- (tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK));
- return mss_now;
- }
-+EXPORT_SYMBOL_GPL(tcp_current_mss);
-
- /* This routine writes packets to the network. It advances the
- * send_head. This happens as incoming acks open up the remote
-@@ -782,6 +785,8 @@ int tcp_write_xmit(struct sock *sk, int
- return 0;
- }
-
-+EXPORT_SYMBOL_GPL(tcp_write_xmit);
-+
- /* This function returns the amount that we can raise the
- * usable window based on the following constraints
- *
+ /* Send _single_ skb sitting at the send head. This function requires
+ * true push pending frames to setup probe timer etc.
Index: linux/net/socket.c
===================================================================
--- linux.orig/net/socket.c
@@ -2217,8 +2088,8 @@
+#include <net/tux.h>
#include <linux/wanrouter.h>
#include <linux/if_bridge.h>
- #include <linux/init.h>
-@@ -121,7 +122,7 @@ static ssize_t sock_sendpage(struct file
+ #include <linux/if_frad.h>
+@@ -123,7 +124,7 @@ static ssize_t sock_sendpage(struct file
* in the operation structures but are done directly via the socketcall() multiplexor.
*/
@@ -2227,34 +2098,94 @@
.owner = THIS_MODULE,
.llseek = no_llseek,
.aio_read = sock_aio_read,
-@@ -363,51 +364,62 @@ static struct dentry_operations sockfs_d
- * but we take care of internal coherence yet.
- */
+@@ -348,72 +349,6 @@ static struct dentry_operations sockfs_d
+ .d_delete = sockfs_delete_dentry,
+ };
+-/*
+- * Obtains the first available file descriptor and sets it up for use.
+- *
+- * This function creates file structure and maps it to fd space
+- * of current process. On success it returns file descriptor
+- * and file struct implicitly stored in sock->file.
+- * Note that another thread may close file descriptor before we return
+- * from this function. We use the fact that now we do not refer
+- * to socket after mapping. If one day we will need it, this
+- * function will increment ref. count on file by 1.
+- *
+- * In any case returned fd MAY BE not valid!
+- * This race condition is unavoidable
+- * with shared fd spaces, we cannot solve it inside kernel,
+- * but we take care of internal coherence yet.
+- */
+-
-int sock_map_fd(struct socket *sock)
-+struct file * sock_map_file(struct socket *sock)
- {
+-{
- int fd;
-+ struct file *file;
- struct qstr this;
- char name[32];
-
+- struct qstr this;
+- char name[32];
+-
- /*
- * Find a file descriptor suitable for return to the user.
- */
-+ file = get_empty_filp();
-
+-
- fd = get_unused_fd();
- if (fd >= 0) {
- struct file *file = get_empty_filp();
-+ if (!file)
-+ return ERR_PTR(-ENFILE);
-
+-
- if (!file) {
- put_unused_fd(fd);
- fd = -ENFILE;
- goto out;
- }
+-
+- this.len = sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino);
+- this.name = name;
+- this.hash = SOCK_INODE(sock)->i_ino;
+-
+- file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this);
+- if (!file->f_dentry) {
+- put_filp(file);
+- put_unused_fd(fd);
+- fd = -ENOMEM;
+- goto out;
+- }
+- file->f_dentry->d_op = &sockfs_dentry_operations;
+- d_add(file->f_dentry, SOCK_INODE(sock));
+- file->f_vfsmnt = mntget(sock_mnt);
+- file->f_mapping = file->f_dentry->d_inode->i_mapping;
+-
+- sock->file = file;
+- file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops;
+- file->f_mode = FMODE_READ | FMODE_WRITE;
+- file->f_flags = O_RDWR;
+- file->f_pos = 0;
+- file->private_data = sock;
+- fd_install(fd, file);
+- }
+-
+-out:
+- return fd;
+-}
+-
+ /**
+ * sockfd_lookup - Go from a file number to its socket slot
+ * @fd: file handle
+@@ -457,6 +392,83 @@ struct socket *sockfd_lookup(int fd, int
+ return sock;
+ }
+
++struct file * sock_map_file(struct socket *sock)
++{
++ struct file *file;
++ struct qstr this;
++ char name[32];
++
++ file = get_empty_filp();
++
++ if (!file)
++ return ERR_PTR(-ENFILE);
++
+ this.len = sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino);
+ this.name = name;
+ this.hash = SOCK_INODE(sock)->i_ino;
@@ -2267,7 +2198,7 @@
+ file->f_dentry->d_op = &sockfs_dentry_operations;
+ d_add(file->f_dentry, SOCK_INODE(sock));
+ file->f_vfsmnt = mntget(sock_mnt);
-+file->f_mapping = file->f_dentry->d_inode->i_mapping;
++ file->f_mapping = file->f_dentry->d_inode->i_mapping;
+
+ if (sock->file)
+ BUG();
@@ -2276,31 +2207,28 @@
+ file->f_mode = FMODE_READ | FMODE_WRITE;
+ file->f_flags = O_RDWR;
+ file->f_pos = 0;
-
-- this.len = sprintf(name, "[%lu]", SOCK_INODE(sock)->i_ino);
-- this.name = name;
-- this.hash = SOCK_INODE(sock)->i_ino;
--
-- file->f_dentry = d_alloc(sock_mnt->mnt_sb->s_root, &this);
-- if (!file->f_dentry) {
-- put_filp(file);
-- put_unused_fd(fd);
-- fd = -ENOMEM;
-- goto out;
-- }
-- file->f_dentry->d_op = &sockfs_dentry_operations;
-- d_add(file->f_dentry, SOCK_INODE(sock));
-- file->f_vfsmnt = mntget(sock_mnt);
-- file->f_mapping = file->f_dentry->d_inode->i_mapping;
++ file->private_data = sock;
++
+ return file;
+}
-
-- sock->file = file;
-- file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops;
-- file->f_mode = FMODE_READ | FMODE_WRITE;
-- file->f_flags = O_RDWR;
-- file->f_pos = 0;
-- fd_install(fd, file);
++
++/*
++ * Obtains the first available file descriptor and sets it up for use.
++ *
++ * This function creates file structure and maps it to fd space
++ * of current process. On success it returns file descriptor
++ * and file struct implicitly stored in sock->file.
++ * Note that another thread may close file descriptor before we return
++ * from this function. We use the fact that now we do not refer
++ * to socket after mapping. If one day we will need it, this
++ * function will increment ref. count on file by 1.
++ *
++ * In any case returned fd MAY BE not valid!
++ * This race condition is unavoidable
++ * with shared fd spaces, we cannot solve it inside kernel,
++ * but we take care of internal coherence yet.
++ */
++
+int sock_map_fd(struct socket *sock)
+{
+ int fd;
@@ -2318,15 +2246,16 @@
+ if (IS_ERR(file)) {
+ put_unused_fd(fd);
+ return PTR_ERR(file);
- }
--
--out:
++ }
+ fd_install(fd, file);
+
- return fd;
- }
-
-@@ -459,7 +471,7 @@ struct socket *sockfd_lookup(int fd, int
++ return fd;
++}
++
+ /**
+ * sock_alloc - allocate a socket
+ *
+@@ -465,7 +477,7 @@ struct socket *sockfd_lookup(int fd, int
* NULL is returned.
*/
@@ -2335,7 +2264,7 @@
{
struct inode * inode;
struct socket * sock;
-@@ -479,6 +491,8 @@ static struct socket *sock_alloc(void)
+@@ -485,6 +497,8 @@ static struct socket *sock_alloc(void)
return sock;
}
@@ -2344,7 +2273,7 @@
/*
* In theory you can't get an open on this inode, but /proc provides
* a back door. Remember to keep it shut otherwise you'll let the
-@@ -1035,6 +1049,8 @@ static int sock_fasync(int fd, struct fi
+@@ -1041,6 +1055,8 @@ static int sock_fasync(int fd, struct fi
}
out:
@@ -2353,7 +2282,7 @@
release_sock(sock->sk);
return 0;
}
-@@ -2057,6 +2073,51 @@ void __init sock_init(void)
+@@ -2067,6 +2083,51 @@ void __init sock_init(void)
#endif
}
@@ -2651,7 +2580,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/accept.c
-@@ -0,0 +1,859 @@
+@@ -0,0 +1,863 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -2692,6 +2621,7 @@
+ struct socket *sock = NULL;
+ struct sock *sk;
+ struct tcp_sock *tp;
++ struct inet_connection_sock *icsk;
+ int err;
+ u16 port = listen->port;
+ u32 addr = listen->ip;
@@ -2712,6 +2642,7 @@
+ sin.sin_port = htons(port);
+
+ sk = sock->sk;
++ icsk = inet_csk(sk);
+ sk->sk_reuse = 1;
+ sock_set_flag(sk, SOCK_URGINLINE);
+
@@ -2724,15 +2655,15 @@
+
+ tp = tcp_sk(sk);
+ Dprintk("listen sk accept_queue: %d.\n",
-+ !reqsk_queue_empty(&tp1->accept_queue));
-+ tp->ack.pingpong = tux_ack_pingpong;
++ !reqsk_queue_empty(&icsk->icsk_accept_queue));
++ icsk->icsk_ack.pingpong = tux_ack_pingpong;
+
+ sock_reset_flag(sk, SOCK_LINGER);
+ sk->sk_lingertime = 0;
+ tp->linger2 = tux_keepalive_timeout * HZ;
+
+ if (proto->defer_accept && !tux_keepalive_timeout && tux_defer_accept)
-+ tp->defer_accept = 1;
++ icsk->icsk_accept_queue.rskq_defer_accept = 1;
+
+ /* Now, start listening on the socket */
+
@@ -2880,7 +2811,7 @@
+
+void del_output_timer (tux_req_t *req)
+{
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ if (!spin_is_locked(&req->ti->work_lock))
+ TUX_BUG();
+#endif
@@ -2929,7 +2860,7 @@
+
+void __del_keepalive_timer (tux_req_t *req)
+{
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ if (!spin_is_locked(&req->ti->work_lock))
+ TUX_BUG();
+#endif
@@ -2946,7 +2877,7 @@
+{
+ tux_req_t *req = (tux_req_t *)data;
+
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ Dprintk("req %p timed out after %d sec!\n", req, tux_keepalive_timeout);
+ if (tux_Dprintk)
+ print_req(req);
@@ -2963,7 +2894,7 @@
+
+ if (!tux_keepalive_timeout)
+ TUX_BUG();
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ if (!spin_is_locked(&req->ti->work_lock))
+ TUX_BUG();
+#endif
@@ -3031,7 +2962,7 @@
+
+static int __idle_event (tux_req_t *req)
+{
-+ struct tcp_sock *tp;
++ struct inet_connection_sock *icsk;
+ threadinfo_t *ti;
+
+ if (!req || (req->magic != TUX_MAGIC))
@@ -3048,9 +2979,9 @@
+ del_output_timer(req);
+ DEC_STAT(nr_idle_input_pending);
+
-+ tp = tcp_sk(req->sock->sk);
++ icsk = inet_csk(req->sock->sk);
+
-+ tp->ack.pingpong = tux_ack_pingpong;
++ icsk->icsk_ack.pingpong = tux_ack_pingpong;
+ SET_TIMESTAMP(req->accept_timestamp);
+
+ __add_req_to_workqueue(req);
@@ -3440,7 +3371,8 @@
+{
+ int count = 0, last_count = 0, error, socknr = 0;
+ struct socket *sock, *new_sock;
-+ struct tcp_sock *tp1, *tp2;
++ struct tcp_sock *tp2;
++ struct inet_connection_sock *icsk1, *icsk2;
+ tux_req_t *req;
+
+ if (ti->nr_requests > tux_max_connect)
@@ -3457,14 +3389,14 @@
+ if (unlikely(test_thread_flag(TIF_NEED_RESCHED)))
+ break;
+
-+ tp1 = tcp_sk(sock->sk);
++ icsk1 = inet_csk(sock->sk);
+ /*
+ * Quick test to see if there are connections on the queue.
+ * This is cheaper than accept() itself because this saves us
+ * the allocation of a new socket. (Which doesn't seem to be
+ * used anyway)
+ */
-+ if (!reqsk_queue_empty(&tp1->accept_queue)) {
++ if (!reqsk_queue_empty(&icsk1->icsk_accept_queue)) {
+ tux_proto_t *proto;
+
+ if (!count++)
@@ -3484,8 +3416,9 @@
+ goto err;
+
+ tp2 = tcp_sk(new_sock->sk);
++ icsk2 = inet_csk(new_sock->sk);
+ tp2->nonagle = 2;
-+ tp2->ack.pingpong = tux_ack_pingpong;
++ icsk2->icsk_ack.pingpong = tux_ack_pingpong;
+ new_sock->sk->sk_reuse = 1;
+ sock_set_flag(new_sock->sk, SOCK_URGINLINE);
+
@@ -3639,7 +3572,7 @@
+ spin_unlock_irq(¤t->sighand->siglock);
+
+ spin_unlock(&iot->async_lock);
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ {
+ cpumask_t mask;
+
@@ -3785,7 +3718,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/cgi.c
-@@ -0,0 +1,160 @@
+@@ -0,0 +1,171 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -3818,6 +3751,8 @@
+
+static int exec_usermode(char *program_path, char *argv[], char *envp[])
+{
++ struct files_struct *files = current->files;
++ struct fdtable *fdt;
+ int i, err;
+
+ err = tux_chroot(tux_cgiroot);
@@ -3829,8 +3764,13 @@
+ /* Allow execve args to be in kernel space. */
+ set_fs(KERNEL_DS);
+
-+ for (i = 3; i < current->files->max_fds; i++ )
-+ if (current->files->fd[i])
++ // TODO: is this RCU-safe?
++ spin_lock(&files->file_lock);
++ fdt = files_fdtable(files);
++ spin_unlock(&files->file_lock);
++
++ for (i = 3; i < fdt->max_fds; i++ )
++ if (fdt->fd[i])
+ tux_close(i);
+
+ err = __exec_usermodehelper(program_path, argv, envp, NULL);
@@ -3856,7 +3796,7 @@
+ int ret;
+
+ sprintf(current->comm,"doexec - %d", current->pid);
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ if (!tux_cgi_inherit_cpu) {
+ cpumask_t map;
+
@@ -3892,6 +3832,9 @@
+ * CGI application.
+ */
+ if (param->pipe_fds) {
++ struct files_struct *files = current->files;
++ struct fdtable *fdt;
++
+ tux_close(1);
+ tux_close(2);
+ tux_close(4);
@@ -3902,11 +3845,12 @@
+ tux_close(3);
+ tux_close(5);
+ // do not close on exec.
-+ spin_lock(¤t->files->file_lock);
-+ FD_CLR(0, current->files->close_on_exec);
-+ FD_CLR(1, current->files->close_on_exec);
-+ FD_CLR(2, current->files->close_on_exec);
-+ spin_unlock(¤t->files->file_lock);
++ spin_lock(&files->file_lock);
++ fdt = files_fdtable(files);
++ FD_CLR(0, fdt->close_on_exec);
++ FD_CLR(1, fdt->close_on_exec);
++ FD_CLR(2, fdt->close_on_exec);
++ spin_unlock(&files->file_lock);
+ }
+ ret = exec_usermode(param->command, param->argv, param->envp);
+ if (ret < 0)
@@ -4294,7 +4238,7 @@
+#define CGI_CHUNK_SIZE 1024
+#define MAX_CGI_COMMAND_LEN 256
+
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+#define PRINT_MESSAGE_LEFT \
+ Dprintk("CGI message left at %s:%d:\n--->{%s}<---\n", \
+ __FILE__, __LINE__, curr)
@@ -4636,7 +4580,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/input.c
-@@ -0,0 +1,640 @@
+@@ -0,0 +1,641 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -5053,6 +4997,7 @@
+ int len, parsed_len;
+ struct sock *sk = req->sock->sk;
+ struct tcp_sock *tp = tcp_sk(sk);
++ struct inet_connection_sock *icsk = inet_csk(sk);
+ int was_keepalive = req->keep_alive;
+
+ if (req->magic != TUX_MAGIC)
@@ -5115,8 +5060,8 @@
+ */
+ if (was_keepalive) {
+ lock_sock(sk);
-+ tp->ack.pingpong = 0;
-+ tp->ack.pending |= TCP_ACK_PUSHED;
++ icsk->icsk_ack.pingpong = 0;
++ icsk->icsk_ack.pending |= ICSK_ACK_PUSHED;
+ cleanup_rbuf(sk, 1);
+ release_sock(sk);
+ }
@@ -5236,7 +5181,7 @@
+ DEBUG_DEL_LIST(curr);
+ DEC_STAT(nr_input_pending);
+ spin_unlock_irq(&ti->work_lock);
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+#endif
+ req->in_file->f_pos = 0;
@@ -5281,7 +5226,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/logger.c
-@@ -0,0 +1,836 @@
+@@ -0,0 +1,837 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -5411,7 +5356,7 @@
+ remove_wait_queue(&log_full, &wait);
+}
+
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+#define CHECK_LOGPTR(ptr) \
+do { \
+ if ((ptr < log_buffer) || (ptr > log_buffer + LOG_LEN)) { \
@@ -5468,7 +5413,7 @@
+ Dprintk("version_str: {%s} [%d]\n", req->version_str, req->version_len);
+ len += req->version_len + 1;
+
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ Dprintk("user_agent_str: {%s} [%d]\n", req->user_agent_str, req->user_agent_len);
+ len += req->user_agent_len + 1;
+#endif
@@ -5479,7 +5424,7 @@
+ len++;
+
+ inc = 5*sizeof(u32) + len;
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ inc += 7*sizeof(u32);
+#endif
+
@@ -5509,7 +5454,7 @@
+ * and other damage. The signature also servers as a log format
+ * version identifier.
+ */
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ *(u32 *)str = 0x2223beef;
+#else
+ *(u32 *)str = 0x1112beef;
@@ -5526,7 +5471,7 @@
+ str += sizeof(u32);
+ CHECK_LOGPTR(str);
+
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ /*
+ * Log the client port number:
+ */
@@ -5544,7 +5489,7 @@
+ str += sizeof(u32);
+ CHECK_LOGPTR(str);
+
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ *(u32 *)str = req->accept_timestamp; str += sizeof(u32);
+ *(u32 *)str = req->parse_timestamp; str += sizeof(u32);
+ *(u32 *)str = req->output_timestamp; str += sizeof(u32);
@@ -5596,7 +5541,7 @@
+ CHECK_LOGPTR(str);
+ }
+ *str++ = 0;
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ if (req->user_agent_len) {
+ memcpy(str, req->user_agent_str, req->user_agent_len);
+ str += req->user_agent_len;
@@ -5638,11 +5583,12 @@
+void tux_push_pending (struct sock *sk)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
++ struct inet_connection_sock *icsk = inet_csk(sk);
+
+ Dprintk("pushing pending frames on sock %p.\n", sk);
+ lock_sock(sk);
+ if ((sk->sk_state == TCP_ESTABLISHED) && !sk->sk_err) {
-+ tp->ack.pingpong = tux_ack_pingpong;
++ icsk->icsk_ack.pingpong = tux_ack_pingpong;
+ tp->nonagle = 1;
+ __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 0), TCP_NAGLE_OFF);
+ }
@@ -5681,7 +5627,7 @@
+ TUX_BUG();
+ if (req->ti->thread != current)
+ TUX_BUG();
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ if (req->bytes_expected && (req->bytes_sent != req->bytes_expected)) {
+ printk("hm, bytes_expected: %d != bytes_sent: %d!\n",
+ req->bytes_expected, req->bytes_sent);
@@ -5815,7 +5761,7 @@
+ req->post_data_len = 0;
+
+ SET_TIMESTAMP(req->accept_timestamp);
-+#if CONFIG_TUX_EXTENDED_LOG
++#ifdef CONFIG_TUX_EXTENDED_LOG
+ req->parse_timestamp = 0;
+ req->output_timestamp = 0;
+ req->flush_timestamp = 0;
@@ -5824,7 +5770,7 @@
+
+ req->total_bytes += req->bytes_sent;
+ req->bytes_sent = 0;
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+#endif
+ req->body_len = 0;
@@ -6030,7 +5976,7 @@
+ oldmm = get_fs();
+ set_fs(KERNEL_DS);
+ printk(KERN_NOTICE "TUX: logger thread started.\n");
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ {
+ cpumask_t map;
+
@@ -6122,7 +6068,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/main.c
-@@ -0,0 +1,1413 @@
+@@ -0,0 +1,1417 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -6193,7 +6139,7 @@
+ break;
+ if (!ti->listen[j].sock)
+ break;
-+ if (!reqsk_queue_empty(&tcp_sk(ti->listen[j].sock->sk)->accept_queue))
++ if (!reqsk_queue_empty(&inet_csk(ti->listen[j].sock->sk)->icsk_accept_queue))
+ return 1;
+ }
+ return 0;
@@ -6569,7 +6515,7 @@
+ struct k_sigaction *ka;
+
+ cpu = ti->cpu;
-+#if CONFIG_SMP
++#ifdef CONFIG_SMP
+ {
+ unsigned int home_cpu;
+ cpumask_t map;
@@ -6750,7 +6696,7 @@
+ if (count)
+ continue;
+ Dprintk("flush_all_requests: %d requests still waiting.\n", ti->nr_requests);
-+#if TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ count = print_all_requests(ti);
+ Dprintk("flush_all_requests: printed %d requests.\n", count);
+#endif
@@ -7507,9 +7453,12 @@
+
+int tux_init(void)
+{
++ if (init_tux_request_slabs())
++ return -ENOMEM;
++
+ start_sysctl();
+
-+#if CONFIG_TUX_MODULE
++#ifdef CONFIG_TUX_MODULE
+ spin_lock(&tux_module_lock);
+ sys_tux_ptr = __sys_tux;
+ tux_module = THIS_MODULE;
@@ -7521,14 +7470,15 @@
+
+void tux_cleanup (void)
+{
-+#if CONFIG_TUX_MODULE
++#ifdef CONFIG_TUX_MODULE
+ spin_lock(&tux_module_lock);
+ tux_module = NULL;
+ sys_tux_ptr = NULL;
+ spin_unlock(&tux_module_lock);
+#endif
-+
+ end_sysctl();
++
++ free_tux_request_slabs();
+}
+
+module_init(tux_init)
@@ -8077,7 +8027,7 @@
+ TUX_BUG();
+ Dprintk("sendfile() wrote: %d bytes.\n", req->desc.written);
+ if (req->output_len && !req->desc.written && !req->desc.error) {
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+#endif
+ req->in_file->f_pos = 0;
@@ -8099,7 +8049,7 @@
+ break;
+ default:
+ len = req->desc.written;
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ if (req->desc.error)
+ TDprintk("TUX: sendfile() returned error %d (signals pending: %08lx)!\n", req->desc.error, current->pending.signal.sig[0]);
+#endif
@@ -8112,7 +8062,7 @@
+ goto repeat;
+ }
+ }
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ if (req->desc.written != want)
+ TDprintk("TUX: sendfile() wrote %d bytes, wanted %d! (pos %Ld) (signals pending: %08lx).\n", req->desc.written, want, req->in_file->f_pos, current->pending.signal.sig[0]);
+ else
@@ -8820,7 +8770,7 @@
+ NULL,
+ NULL
+ },
-+#if TUX_DPRINTK
++#ifdef TUX_DPRINTK
+#endif
+ { NET_TUX_LOGGING,
+ "logging",
@@ -9507,7 +9457,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/proto_ftp.c
-@@ -0,0 +1,1549 @@
+@@ -0,0 +1,1555 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -10109,7 +10059,7 @@
+ ftp_send_async_message(req, WRITE_ABORTED, 426);
+ return 1;
+ }
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+ if (tux_TDprintk)
+ dump_stack();
@@ -10397,23 +10347,25 @@
+void ftp_accept_pasv (tux_req_t *req, int cachemiss)
+{
+ struct socket *sock, *new_sock = NULL;
++ struct inet_connection_sock *icsk1, *icsk2;
+ struct tcp_sock *tp1, *tp2;
+ int err;
+
+ tp1 = tcp_sk(req->data_sock->sk);
++ icsk1 = inet_csk(req->data_sock->sk);
+
+ Dprintk("PASV accept on req %p, accept_queue: %p.\n",
-+ req, tp1->accept_queue);
++ req, &icsk->icsk_accept_queue);
+ if (req->error || (req->data_sock->sk->sk_state != TCP_LISTEN))
+ goto error;
+new_socket:
-+ if (reqsk_queue_empty(&tp1->accept_queue)) {
++ if (reqsk_queue_empty(&icsk1->icsk_accept_queue)) {
+ spin_lock_irq(&req->ti->work_lock);
+ add_keepalive_timer(req);
+ if (test_and_set_bit(0, &req->idle_input))
+ TUX_BUG();
+ spin_unlock_irq(&req->ti->work_lock);
-+ if (reqsk_queue_empty(&tp1->accept_queue)) {
++ if (reqsk_queue_empty(&icsk1->icsk_accept_queue)) {
+ add_tux_atom(req, ftp_accept_pasv);
+ return;
+ }
@@ -10447,8 +10399,9 @@
+ zap_data_socket(req);
+
+ tp2 = tcp_sk(new_sock->sk);
++ icsk2 = inet_csk(new_sock->sk);
+ tp2->nonagle = 2;
-+ tp2->ack.pingpong = tux_ack_pingpong;
++ icsk2->icsk_ack.pingpong = tux_ack_pingpong;
+ new_sock->sk->sk_reuse = 1;
+ sock_set_flag(new_sock->sk, SOCK_URGINLINE);
+ sock_reset_flag(new_sock->sk, SOCK_LINGER);
@@ -10798,6 +10751,7 @@
+ struct sockaddr_in addr;
+ unsigned int str_len;
+ struct tcp_sock *tp;
++ struct inet_connection_sock *icsk;
+ u32 local_addr;
+ int err;
+
@@ -10828,6 +10782,8 @@
+ err = data_sock->ops->bind(data_sock,
+ (struct sockaddr*)&addr, sizeof(addr));
+ tp = tcp_sk(data_sock->sk);
++ icsk = inet_csk(data_sock->sk);
++
+ tp->nonagle = 2;
+ Dprintk("PASV bind() ret: %d.\n", err);
+ if (err < 0) {
@@ -10837,7 +10793,7 @@
+ GOTO_ERR;
+ }
+
-+ tp->ack.pingpong = tux_ack_pingpong;
++ icsk->icsk_ack.pingpong = tux_ack_pingpong;
+
+ if (!tux_keepalive_timeout)
+ tp->linger2 = 0;
@@ -12014,7 +11970,7 @@
+ mntput(mnt);
+ mnt = NULL;
+ }
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ if (!not_modified) {
+ TDprintk("req %p has lookup errors!\n", req);
+ if (tux_TDprintk)
@@ -12749,7 +12705,7 @@
+ goto error;
+
+ case MIME_TYPE_CGI:
-+#if CONFIG_TUX_EXTCGI
++#ifdef CONFIG_TUX_EXTCGI
+ Dprintk("CGI request %p.\n", req);
+ query_extcgi(req);
+ return;
@@ -12811,7 +12767,7 @@
+
+static void http_post_header (tux_req_t *req, int cachemiss)
+{
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = req->output_len;
+#endif
+ req->bytes_sent = 0; // data comes now.
@@ -12828,7 +12784,7 @@
+ SET_TIMESTAMP(req->output_timestamp);
+
+ if (req->error) {
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+#endif
+ req->in_file->f_pos = 0;
@@ -12850,7 +12806,7 @@
+ ret = generic_send_file(req, req->sock, cachemiss);
+ Dprintk("body send-file returned: %d.\n", ret);
+ } else {
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+#endif
+ }
@@ -13068,7 +13024,7 @@
+
+ size = curr-buf;
+
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ *curr = 0;
+ Dprintk("{%s} [%d/%d]\n", buf, size, strlen(buf));
+#endif
@@ -13099,7 +13055,7 @@
+ Dprintk("http_check_req_err(%p,%d): 1 (state: %d, urg: %d)\n",
+ req, cachemiss, req->sock->sk->sk_state,
+ tcp_sk(req->sock->sk)->urg_data);
-+#if CONFIG_TUX_DEBUG
++#ifdef CONFIG_TUX_DEBUG
+ req->bytes_expected = 0;
+#endif
+ req->in_file->f_pos = 0;
@@ -13263,7 +13219,7 @@
===================================================================
--- /dev/null
+++ linux/net/tux/redirect.c
-@@ -0,0 +1,167 @@
+@@ -0,0 +1,172 @@
+/*
+ * TUX - Integrated Application Protocols Layer and Object Cache
+ *
@@ -13273,6 +13229,8 @@
+ */
+
+#include <net/tux.h>
++#include <linux/module.h>
++#include <linux/init.h>
+
+/****************************************************************
+ * This program is free software; you can redistribute it and/or modify
@@ -13311,7 +13269,7 @@
+ * Look up (optional) listening user-space socket.
+ */
+ local_bh_disable();
-+ sk = tcp_v4_lookup_listener(INADDR_ANY, port, 0);
++ sk = inet_lookup_listener(&tcp_hashinfo, INADDR_ANY, port, 0);
+ /*
+ * Look up localhost listeners as well.
+ */
@@ -13321,7 +13279,7 @@
+ ((unsigned char *)&daddr)[1] = 0;
+ ((unsigned char *)&daddr)[2] = 0;
+ ((unsigned char *)&daddr)[3] = 1;
-+ sk = tcp_v4_lookup_listener(daddr, port, 0);
++ sk = inet_lookup_listener(&tcp_hashinfo, daddr, port, 0);
+ }
+ local_bh_enable();
+
@@ -13362,7 +13320,7 @@
+
+ tcp_sk(oldsk)->nonagle = 0;
+
-+ tcp_acceptq_queue(sk, tcpreq, oldsk);
++ inet_csk_reqsk_queue_add(sk, tcpreq, oldsk);
+
+ sk->sk_data_ready(sk, 0);
+
@@ -13421,16 +13379,19 @@
+ flush_request(req, cachemiss);
+}
+
-+int __init init_tux_request_slabs(void)
++int init_tux_request_slabs(void)
+{
+ tux_req.slab = kmem_cache_create("tux-request",
+ sizeof(struct request_sock), 0, SLAB_HWCACHE_ALIGN,
+ NULL, NULL);
-+ return 0;
-+}
+
-+__initcall(init_tux_request_slabs);
++ return tux_req.slab == NULL;
++}
+
++void free_tux_request_slabs(void)
++{
++ kmem_cache_destroy(tux_req.slab);
++}
Index: linux/net/tux/times.c
===================================================================
--- /dev/null
@@ -13891,13 +13852,3 @@
+ *
+ ****************************************************************/
+
---- linux-2.6.12/net/ipv4/tcp_output.c~ 2005-07-14 18:20:31.000000000 -0400
-+++ linux-2.6.12/net/ipv4/tcp_output.c 2005-07-14 18:20:45.000000000 -0400
-@@ -1067,6 +1067,7 @@ void __tcp_push_pending_frames(struct so
- tcp_check_probe_timer(sk, tp);
- }
- }
-+EXPORT_SYMBOL_GPL(__tcp_push_pending_frames);
-
- /* Send _single_ skb sitting at the send head. This function requires
- * true push pending frames to setup probe timer etc.
More information about the fedora-cvs-commits
mailing list