Commit 7df2e632 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.92pre1

parent cad34273
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 91
SUBLEVEL = 92
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
......@@ -93,6 +93,7 @@ install: memsize vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage install
archclean:
rm -f .kernel_offset.lds
@$(MAKEBOOT) clean
archdep:
......
......@@ -32,6 +32,7 @@
#include <linux/fs.h>
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/file.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
......@@ -432,7 +433,7 @@ int nbd_init(void)
#endif
blksize_size[MAJOR_NR] = nbd_blksizes;
blk_size[MAJOR_NR] = nbd_sizes;
blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
blk_dev[MAJOR_NR].request_fn = do_nbd_request;
for (i = 0; i < MAX_NBD; i++) {
nbd_dev[i].refcnt = 0;
nbd_dev[i].file = NULL;
......
......@@ -1285,7 +1285,7 @@ static int tty_open(struct inode * inode, struct file * filp)
}
if ((tty->driver.type == TTY_DRIVER_TYPE_SERIAL) &&
(tty->driver.subtype == SERIAL_TYPE_CALLOUT)) {
printk("Warning, %s opened, is a deprecated tty "
printk(KERN_INFO "Warning, %s opened, is a deprecated tty "
"callout device\n", tty_name(tty, buf));
}
return 0;
......
......@@ -8,7 +8,7 @@
* Dynamic PPP devices by Jim Freeman <jfree@caldera.com>.
* ppp_tty_receive ``noisy-raise-bug'' fixed by Ove Ewerlid <ewerlid@syscon.uu.se>
*
* ==FILEVERSION 980123==
* ==FILEVERSION 980319==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the number above to the
......@@ -1326,6 +1326,10 @@ ppp_doframe (struct ppp *ppp)
(*ppp->sc_rcomp->incomp) (ppp->sc_rc_state,
data, count);
}
} else if (proto == PPP_COMP && (ppp->flags & SC_DEBUG)) {
printk(KERN_DEBUG "ppp: frame not decompressed: "
"flags=%x, count=%d, sc_rc_state=%p\n",
ppp->flags, count, ppp->sc_rc_state);
}
/*
* Process the uncompressed frame.
......@@ -1659,6 +1663,9 @@ static void ppp_proto_ccp (struct ppp *ppp, __u8 *dp, int len, int rcvd)
}
break;
}
if (ppp->flags & SC_DEBUG)
printk(KERN_DEBUG "ppp_proto_ccp: %s code %d, flags=%x\n",
(rcvd? "rcvd": "sent"), CCP_CODE(dp), ppp->flags);
restore_flags(flags);
}
......@@ -1977,16 +1984,15 @@ ppp_dev_xmit_frame (struct ppp *ppp, struct ppp_buffer *buf,
(control == PPP_UI) &&
(proto != PPP_LCP) &&
(proto != PPP_CCP)) {
new_data = kmalloc (ppp->mtu, GFP_ATOMIC);
new_data = kmalloc (ppp->mtu + PPP_HDRLEN, GFP_ATOMIC);
if (new_data == NULL) {
if (ppp->flags & SC_DEBUG)
printk (KERN_ERR
"ppp_dev_xmit_frame: no memory\n");
printk (KERN_ERR "ppp_dev_xmit_frame: no memory\n");
return 1;
}
new_count = (*ppp->sc_xcomp->compress)
(ppp->sc_xc_state, data, new_data, count, ppp->mtu);
(ppp->sc_xc_state, data, new_data, count,
ppp->mtu + PPP_HDRLEN);
if (new_count > 0 && (ppp->flags & SC_CCP_UP)) {
ppp_dev_xmit_lower (ppp, buf, new_data, new_count, 0);
......@@ -2153,7 +2159,7 @@ ppp_tty_write (struct tty_struct *tty, struct file *file, const __u8 * data,
}
/*
* Process the BSD compression IOCTL event for the tty device.
* Process the set-compression ioctl.
*/
static int
......@@ -2187,7 +2193,7 @@ ppp_set_compression (struct ppp *ppp, struct ppp_option_data *odp)
save_flags(flags);
cli();
ppp->flags &= ~(SC_COMP_RUN | SC_DECOMP_RUN);
ppp->flags &= ~(data.transmit? SC_COMP_RUN: SC_DECOMP_RUN);
restore_flags(flags);
cp = find_compressor (ccp_option[0]);
......@@ -2257,8 +2263,9 @@ ppp_tty_ioctl (struct tty_struct *tty, struct file * file,
unsigned int param2, unsigned long param3)
{
struct ppp *ppp = tty2ppp (tty);
register int temp_i = 0;
register int temp_i = 0, oldflags;
int error = 0;
unsigned long flags;
/*
* Verify the status of the PPP device.
*/
......@@ -2308,16 +2315,18 @@ ppp_tty_ioctl (struct tty_struct *tty, struct file * file,
if (error != 0)
break;
temp_i &= SC_MASK;
temp_i |= (ppp->flags & ~SC_MASK);
if ((ppp->flags & SC_CCP_OPEN) &&
(temp_i & SC_CCP_OPEN) == 0)
ppp_ccp_closed (ppp);
if ((ppp->flags & SC_CCP_OPEN) && (temp_i & SC_CCP_OPEN) == 0)
ppp_ccp_closed(ppp);
if ((ppp->flags | temp_i) & SC_DEBUG)
save_flags(flags);
cli();
oldflags = ppp->flags;
ppp->flags = temp_i |= (ppp->flags & ~SC_MASK);
restore_flags(flags);
if ((oldflags | temp_i) & SC_DEBUG)
printk (KERN_INFO
"ppp_tty_ioctl: set flags to %x\n", temp_i);
ppp->flags = temp_i;
break;
/*
* Set the compression mode
......
/*
* ==FILEVERSION 971001==
* ==FILEVERSION 980319==
*
* ppp_deflate.c - interface the zlib procedures for Deflate compression
* and decompression (as used by gzip) to the PPP code.
......@@ -188,20 +188,21 @@ z_comp_alloc(options, opt_len)
struct ppp_deflate_state *state;
int w_size;
MOD_INC_USE_COUNT;
if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE
if (opt_len != CILEN_DEFLATE
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| options[3] != DEFLATE_CHK_SEQUENCE)
goto out_fail;
return NULL;
w_size = DEFLATE_SIZE(options[2]);
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
goto out_fail;
return NULL;
state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
goto out_fail;
return NULL;
MOD_INC_USE_COUNT;
memset (state, 0, sizeof (struct ppp_deflate_state));
state->strm.next_in = NULL;
state->strm.zalloc = zalloc_init;
......@@ -217,7 +218,6 @@ z_comp_alloc(options, opt_len)
out_free:
z_comp_free(state);
out_fail:
MOD_DEC_USE_COUNT;
return NULL;
}
......@@ -230,7 +230,8 @@ z_comp_init(arg, options, opt_len, unit, hdrlen, debug)
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE
if (opt_len < CILEN_DEFLATE
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| DEFLATE_SIZE(options[2]) != state->w_size
......@@ -264,7 +265,7 @@ z_compress(arg, rptr, obuf, isize, osize)
int isize, osize;
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
int r, proto, off, olen;
int r, proto, off, olen, oavail;
unsigned char *wptr;
/*
......@@ -291,9 +292,10 @@ z_compress(arg, rptr, obuf, isize, osize)
wptr += PPP_HDRLEN;
wptr[0] = state->seqno >> 8;
wptr[1] = state->seqno;
wptr += 2;
wptr += DEFLATE_OVHD;
olen = PPP_HDRLEN + DEFLATE_OVHD;
state->strm.next_out = wptr;
state->strm.avail_out = osize - (PPP_HDRLEN + 2);
state->strm.avail_out = oavail = osize - olen;
++state->seqno;
off = (proto > 0xff) ? 2 : 3; /* skip 1st proto byte if 0 */
......@@ -301,25 +303,23 @@ z_compress(arg, rptr, obuf, isize, osize)
state->strm.next_in = rptr;
state->strm.avail_in = (isize - off);
olen = 0;
for (;;) {
r = deflate(&state->strm, Z_PACKET_FLUSH);
if (r != Z_OK) {
if (state->debug)
printk(KERN_DEBUG "z_compress: deflate returned %d (%s)\n",
r, (state->strm.msg? state->strm.msg: ""));
printk(KERN_ERR
"z_compress: deflate returned %d\n", r);
break;
}
if (state->strm.avail_out == 0) {
olen += osize;
olen += oavail;
state->strm.next_out = NULL;
state->strm.avail_out = 1000000;
state->strm.avail_out = oavail = 1000000;
} else {
break; /* all done */
}
}
if (olen < osize)
olen += osize - state->strm.avail_out;
olen += oavail - state->strm.avail_out;
/*
* See if we managed to reduce the size of the packet.
......@@ -372,19 +372,21 @@ z_decomp_alloc(options, opt_len)
struct ppp_deflate_state *state;
int w_size;
MOD_INC_USE_COUNT;
if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE
if (opt_len != CILEN_DEFLATE
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| options[3] != DEFLATE_CHK_SEQUENCE)
goto out_fail;
return NULL;
w_size = DEFLATE_SIZE(options[2]);
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
goto out_fail;
return NULL;
state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
if (state == NULL)
goto out_fail;
return NULL;
MOD_INC_USE_COUNT;
memset (state, 0, sizeof (struct ppp_deflate_state));
state->w_size = w_size;
state->strm.next_out = NULL;
......@@ -398,7 +400,6 @@ z_decomp_alloc(options, opt_len)
out_free:
z_decomp_free(state);
out_fail:
MOD_DEC_USE_COUNT;
return NULL;
}
......@@ -411,7 +412,8 @@ z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug)
{
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE
if (opt_len < CILEN_DEFLATE
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT)
|| options[1] != CILEN_DEFLATE
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL
|| DEFLATE_SIZE(options[2]) != state->w_size
......@@ -543,8 +545,12 @@ z_decompress(arg, ibuf, isize, obuf, osize)
}
}
if (decode_proto)
if (decode_proto) {
if (state->debug)
printk(KERN_DEBUG "z_decompress%d: didn't get proto\n",
state->unit);
return DECOMP_ERROR;
}
olen = osize + overflow - state->strm.avail_out;
state->stats.unc_bytes += olen;
......@@ -634,6 +640,23 @@ struct compressor ppp_deflate = {
z_comp_stats, /* decomp_stat */
};
struct compressor ppp_deflate_draft = {
CI_DEFLATE_DRAFT, /* compress_proto */
z_comp_alloc, /* comp_alloc */
z_comp_free, /* comp_free */
z_comp_init, /* comp_init */
z_comp_reset, /* comp_reset */
z_compress, /* compress */
z_comp_stats, /* comp_stat */
z_decomp_alloc, /* decomp_alloc */
z_decomp_free, /* decomp_free */
z_decomp_init, /* decomp_init */
z_decomp_reset, /* decomp_reset */
z_decompress, /* decompress */
z_incomp, /* incomp */
z_comp_stats, /* decomp_stat */
};
#ifdef MODULE
/*************************************************************
* Module support routines
......@@ -646,6 +669,7 @@ init_module(void)
if (answer == 0)
printk (KERN_INFO
"PPP Deflate Compression module registered\n");
ppp_register_compressor(&ppp_deflate_draft);
return answer;
}
......@@ -655,7 +679,9 @@ cleanup_module(void)
if (MOD_IN_USE)
printk (KERN_INFO
"Deflate Compression module busy, remove delayed\n");
else
else {
ppp_unregister_compressor (&ppp_deflate);
ppp_unregister_compressor (&ppp_deflate_draft);
}
}
#endif
......@@ -219,6 +219,11 @@ static ssize_t ext2_file_write (struct file * filp, const char * buf,
count -= c;
mark_buffer_uptodate(bh, 1);
mark_buffer_dirty(bh, 0);
/* Mark the buffer untouched if we'll move on to the next one.. */
if (!(pos & (sb->s_blocksize-1)))
clear_bit(BH_Touched, &bh->b_state);
if (filp->f_flags & O_SYNC)
bufferlist[buffercount++] = bh;
else
......
......@@ -65,7 +65,6 @@
#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
#define SC_DEBUG 0x00010000 /* enable debug messages */
......@@ -73,12 +72,9 @@
#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
#define SC_MASK 0x0fE0ffff /* bits that user can change */
#define SC_MASK 0x0f0000ff /* bits that user can change */
/* state bits */
#define SC_ESCAPED 0x80000000 /* saw a PPP_ESCAPE */
#define SC_FLUSH 0x40000000 /* flush input until next PPP_FLAG */
#define SC_VJ_RESET 0x20000000 /* Need to reset the VJ decompressor */
#define SC_XMIT_BUSY 0x10000000 /* ppp_write_wakeup is active */
#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
......
......@@ -24,11 +24,11 @@
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
* OR MODIFICATIONS.
*
* $Id: ppp-comp.h,v 1.7 1995/05/01 01:43:37 paulus Exp $
* $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
*/
/*
* ==FILEVERSION 971024==
* ==FILEVERSION 980319==
*
* NOTE TO MAINTAINERS:
* If you modify this file at all, please set the above date.
......@@ -173,7 +173,8 @@ struct compressor {
* Definitions for Deflate.
*/
#define CI_DEFLATE 24 /* config option for Deflate */
#define CI_DEFLATE 26 /* config option for Deflate */
#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */
#define CILEN_DEFLATE 4 /* length of its config option */
#define DEFLATE_MIN_SIZE 8
......
......@@ -461,12 +461,7 @@ extern __inline__ unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
if(skb->tail>skb->end)
{
__label__ here;
#if 1
printk(KERN_DEBUG "skbput: over: %p:tail=%p:end=%p:len=%u\n",
&&here, skb->tail, skb->end, len);
#else
panic(skb_put_errstr,&&here,len);
#endif
here: ;
}
return tmp;
......
......@@ -14,6 +14,7 @@
*/
int kmod_unload_delay = 60;
char modprobe_path[256] = "/sbin/modprobe";
static int kmod_running = 0;
static char module_name[64] = "";
static char * argv[] = { "modprobe", "-k", module_name, NULL, };
static char * envp[] = { "HOME=/", "TERM=linux", NULL, };
......@@ -41,6 +42,7 @@ int kmod_thread(void * data)
current->pgrp = 1;
sprintf(current->comm, "kmod");
sigfillset(&current->blocked);
kmod_running = 1;
/*
This is the main kmod_thread loop. It first sleeps, then
......@@ -133,6 +135,9 @@ int request_module(const char * name)
the module into module_name. Once that is done, wake up
kmod_thread.
*/
if(!kmod_running)
return 0;
strncpy(module_name, name, sizeof(module_name));
module_name[sizeof(module_name)-1] = '\0';
wake_up(&kmod_queue);
......
......@@ -126,7 +126,14 @@ int free_memory_available(int nr)
{
int retval = 0;
unsigned long flags;
struct free_area_struct * list = NULL;
struct free_area_struct * list;
/*
* If we have more than 25% of all memory free,
* consider it to be good enough for anything.
*/
if (nr_free_pages > num_physpages >> 2)
return nr+1;
list = free_area + NR_MEM_LISTS;
spin_lock_irqsave(&page_alloc_lock, flags);
......
......@@ -1144,7 +1144,7 @@ asmlinkage int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags)
unsigned char ctl[sizeof(struct cmsghdr) + 20]; /* 20 is size of ipv6_pktinfo */
unsigned char *ctl_buf = ctl;
struct msghdr msg_sys;
int err, total_len;
int err, ctl_len, total_len;
lock_kernel();
......@@ -1161,16 +1161,16 @@ asmlinkage int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags)
err = verify_iovec(&msg_sys, iov, address, VERIFY_READ);
if (err < 0)
goto out;
total_len=err;
sock = sockfd_lookup(fd, &err);
if (!sock)
goto out_freeiov;
if (msg_sys.msg_controllen)
ctl_len = msg_sys.msg_controllen;
if (ctl_len)
{
if (msg_sys.msg_controllen > sizeof(ctl))
if (ctl_len > sizeof(ctl))
{
/* Suggested by the Advanced Sockets API for IPv6 draft:
* Limit the msg_controllen size by the SO_SNDBUF size.
......@@ -1179,15 +1179,13 @@ asmlinkage int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags)
* SMP machines you have a race to fix here.
*/
err = -ENOBUFS;
ctl_buf = sock_kmalloc(sock->sk, msg_sys.msg_controllen,
GFP_KERNEL);
ctl_buf = sock_kmalloc(sock->sk, ctl_len, GFP_KERNEL);
if (ctl_buf == NULL)
goto failed2;
goto out_put;
}
err = -EFAULT;
if (copy_from_user(ctl_buf, msg_sys.msg_control,
msg_sys.msg_controllen))
goto failed;
if (copy_from_user(ctl_buf, msg_sys.msg_control, ctl_len))
goto out_freectl;
msg_sys.msg_control = ctl_buf;
}
msg_sys.msg_flags = flags;
......@@ -1196,10 +1194,10 @@ asmlinkage int sys_sendmsg(int fd, struct msghdr *msg, unsigned flags)
msg_sys.msg_flags |= MSG_DONTWAIT;
err = sock_sendmsg(sock, &msg_sys, total_len);
failed:
out_freectl:
if (ctl_buf != ctl)
sock_kfree_s(sock->sk, ctl_buf, msg_sys.msg_controllen);
failed2:
sock_kfree_s(sock->sk, ctl_buf, ctl_len);
out_put:
sockfd_put(sock);
out_freeiov:
if (msg_sys.msg_iov != iov)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment