Commit bed2f5d0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge kroah.com:/home/greg/linux/BK/bleed-2.5

into kroah.com:/home/greg/linux/BK/usb-2.6
parents 4c3e7927 4ee0756d
......@@ -5,17 +5,14 @@
* Licensed under the terms of the GNU GPL License version 2.
* Based upon datasheets & sample CPUs kindly provided by VIA.
*
* VIA have currently 3 different versions of Longhaul.
*
* +---------------------+----------+---------------------------------+
* | Marketing name | Codename | longhaul version / features. |
* +---------------------+----------+---------------------------------+
* | Samuel/CyrixIII | C5A | v1 : multipliers only |
* | Samuel2/C3 | C3E/C5B | v1 : multiplier only |
* | Ezra | C5C | v2 : multipliers & voltage |
* | Ezra-T | C5M | v3 : multipliers, voltage & FSB |
* | Nehemiah | C5N | v3 : multipliers, voltage & FSB |
* +---------------------+----------+---------------------------------+
* VIA have currently 2 different versions of Longhaul.
* Version 1 (Longhaul) uses the BCR2 MSR at 0x1147.
* It is present only in Samuel 1, Samuel 2 and Ezra.
* Version 2 (Powersaver) uses the POWERSAVER MSR at 0x110a.
* It is present in Ezra-T, Nehemiah and above.
* In addition to scaling multiplier, it can also scale voltage.
* There is provision for scaling FSB too, but this doesn't work
* too well in practice.
*
* BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
*/
......@@ -66,7 +63,11 @@ static struct cpufreq_frequency_table *longhaul_table;
static unsigned int calc_speed (int mult, int fsb)
{
return ((mult/10)*fsb) + ((mult%10)*(fsb/2));
int mhz;
mhz = (mult/10)*fsb;
if (mult%10)
mhz += fsb/2;
return mhz;
}
......@@ -76,7 +77,7 @@ static int longhaul_get_cpu_mult (void)
rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi);
invalue = (lo & (1<<22|1<<23|1<<24|1<<25)) >>22;
if (longhaul_version==3) {
if (longhaul_version==2) {
if (lo & (1<<27))
invalue+=16;
}
......@@ -132,32 +133,15 @@ static void longhaul_setstate (unsigned int clock_ratio_index)
break;
/*
* Longhaul v2. (Ezra [C5C])
* Powersaver. (Ezra-T [C5M], Nehemiah [C5N])
* We can scale voltage with this too, but that's currently
* disabled until we come up with a decent 'match freq to voltage'
* algorithm.
* We also need to do the voltage/freq setting in order depending
* on the direction of scaling (like we do in powernow-k7.c)
*/
case 2:
rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
longhaul.bits.EnableSoftBusRatio = 1;
/* We must program the revision key only with values we
* know about, not blindly copy it from 0:3 */
longhaul.bits.RevisionKey = 1;
wrmsrl (MSR_VIA_LONGHAUL, longhaul.val);
__hlt();
break;
/*
* Longhaul v3. (Ezra-T [C5M], Nehemiah [C5N])
* This can also do voltage scaling, but see above.
* Ezra-T was alleged to do FSB scaling too, but it never worked in practice.
*/
case 3:
case 2:
rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
......@@ -214,6 +198,7 @@ static int guess_fsb(int maxmult)
static int __init longhaul_get_ranges (void)
{
struct cpuinfo_x86 *c = cpu_data;
unsigned long invalue;
unsigned int minmult=0, maxmult=0;
unsigned int multipliers[32]= {
......@@ -232,10 +217,13 @@ static int __init longhaul_get_ranges (void)
maxmult = longhaul_get_cpu_mult();
rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi);
invalue = (lo & (1<<18|1<<19)) >>18;
fsb = eblcr_fsb_table[invalue];
if (c->x86_model==6)
fsb = eblcr_fsb_table[invalue];
else
fsb = guess_fsb(maxmult);
break;
case 2 ... 3:
case 2:
rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
invalue = longhaul.bits.MaxMHzBR;
......@@ -378,10 +366,10 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
break;
case 7: /* C5B / C5C */
longhaul_version=1;
switch (c->x86_mask) {
case 0:
cpuname = "C3 'Samuel 2' [C5B]";
longhaul_version=1;
/* Note, this is not a typo, early Samuel2's had Samuel1 ratios. */
memcpy (clock_ratio, samuel1_clock_ratio, sizeof(samuel1_clock_ratio));
memcpy (eblcr_table, samuel2_eblcr, sizeof(samuel2_eblcr));
......@@ -391,7 +379,6 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
cpuname = "C3 'Samuel 2' [C5B]";
else
cpuname = "C3 'Ezra' [C5C]";
longhaul_version=2;
memcpy (clock_ratio, ezra_clock_ratio, sizeof(ezra_clock_ratio));
memcpy (eblcr_table, ezra_eblcr, sizeof(ezra_eblcr));
break;
......@@ -399,20 +386,21 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
break;
case 8:
cpuname = "C3 'Ezra-T [C5M]";
longhaul_version=3;
cpuname = "C3 'Ezra-T' [C5M]";
longhaul_version=2;
numscales=32;
memcpy (clock_ratio, ezrat_clock_ratio, sizeof(ezrat_clock_ratio));
memcpy (eblcr_table, ezrat_eblcr, sizeof(ezrat_eblcr));
break;
/*
case 9:
cpuname = "C3 'Nehemiah' [C5N]";
longhaul_version=3;
longhaul_version=2;
numscales=32;
memcpy (clock_ratio, nehemiah_clock_ratio, sizeof(nehemiah_clock_ratio));
memcpy (eblcr_table, nehemiah_eblcr, sizeof(nehemiah_eblcr));
*/
break;
default:
cpuname = "Unknown";
break;
......@@ -421,7 +409,7 @@ static int longhaul_cpu_init (struct cpufreq_policy *policy)
printk (KERN_INFO PFX "VIA %s CPU detected. Longhaul v%d supported.\n",
cpuname, longhaul_version);
if ((longhaul_version==2 || longhaul_version==3) && (dont_scale_voltage==0))
if ((longhaul_version==2) && (dont_scale_voltage==0))
longhaul_setup_voltagescaling();
ret = longhaul_get_ranges();
......
......@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/tty.h>
#include <linux/vt_kern.h> /* For unblank_screen() */
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/system.h>
......@@ -55,6 +56,147 @@ void bust_spinlocks(int yes)
console_loglevel = loglevel_save;
}
/*
* Return EIP plus the CS segment base. The segment limit is also
* adjusted, clamped to the kernel/user address space (whichever is
* appropriate), and returned in *eip_limit.
*
* The segment is checked, because it might have been changed by another
* task between the original faulting instruction and here.
*
* If CS is no longer a valid code segment, or if EIP is beyond the
* limit, or if it is a kernel address when CS is not a kernel segment,
* then the returned value will be greater than *eip_limit.
*
* This is slow, but is very rarely executed.
*/
static inline unsigned long get_segment_eip(struct pt_regs *regs,
unsigned long *eip_limit)
{
unsigned long eip = regs->eip;
unsigned seg = regs->xcs & 0xffff;
u32 seg_ar, seg_limit, base, *desc;
/* The standard kernel/user address space limit. */
*eip_limit = (seg & 3) ? USER_DS.seg : KERNEL_DS.seg;
/* Unlikely, but must come before segment checks. */
if (unlikely((regs->eflags & VM_MASK) != 0))
return eip + (seg << 4);
/* By far the most common cases. */
if (likely(seg == __USER_CS || seg == __KERNEL_CS))
return eip;
/* Check the segment exists, is within the current LDT/GDT size,
that kernel/user (ring 0..3) has the appropriate privilege,
that it's a code segment, and get the limit. */
__asm__ ("larl %3,%0; lsll %3,%1"
: "=&r" (seg_ar), "=r" (seg_limit) : "0" (0), "rm" (seg));
if ((~seg_ar & 0x9800) || eip > seg_limit) {
*eip_limit = 0;
return 1; /* So that returned eip > *eip_limit. */
}
/* Get the GDT/LDT descriptor base.
When you look for races in this code remember that
LDT and other horrors are only used in user space. */
if (seg & (1<<2)) {
/* Must lock the LDT while reading it. */
down(&current->mm->context.sem);
desc = current->mm->context.ldt;
desc = (void *)desc + (seg & ~7);
} else {
/* Must disable preemption while reading the GDT. */
desc = (u32 *)&cpu_gdt_table[get_cpu()];
desc = (void *)desc + (seg & ~7);
}
/* Decode the code segment base from the descriptor */
base = (desc[0] >> 16) |
((desc[1] & 0xff) << 16) |
(desc[1] & 0xff000000);
if (seg & (1<<2)) {
up(&current->mm->context.sem);
} else
put_cpu();
/* Adjust EIP and segment limit, and clamp at the kernel limit.
It's legitimate for segments to wrap at 0xffffffff. */
seg_limit += base;
if (seg_limit < *eip_limit && seg_limit >= base)
*eip_limit = seg_limit;
return eip + base;
}
/*
* Sometimes AMD Athlon/Opteron CPUs report invalid exceptions on prefetch.
* Check that here and ignore it.
*/
static int __is_prefetch(struct pt_regs *regs, unsigned long addr)
{
unsigned long limit;
unsigned long instr = get_segment_eip (regs, &limit);
int scan_more = 1;
int prefetch = 0;
int i;
for (i = 0; scan_more && i < 15; i++) {
unsigned char opcode;
unsigned char instr_hi;
unsigned char instr_lo;
if (instr > limit)
break;
if (__get_user(opcode, (unsigned char *) instr))
break;
instr_hi = opcode & 0xf0;
instr_lo = opcode & 0x0f;
instr++;
switch (instr_hi) {
case 0x20:
case 0x30:
/* Values 0x26,0x2E,0x36,0x3E are valid x86 prefixes. */
scan_more = ((instr_lo & 7) == 0x6);
break;
case 0x60:
/* 0x64 thru 0x67 are valid prefixes in all modes. */
scan_more = (instr_lo & 0xC) == 0x4;
break;
case 0xF0:
/* 0xF0, 0xF2, and 0xF3 are valid prefixes */
scan_more = !instr_lo || (instr_lo>>1) == 1;
break;
case 0x00:
/* Prefetch instruction is 0x0F0D or 0x0F18 */
scan_more = 0;
if (instr > limit)
break;
if (__get_user(opcode, (unsigned char *) instr))
break;
prefetch = (instr_lo == 0xF) &&
(opcode == 0x0D || opcode == 0x18);
break;
default:
scan_more = 0;
break;
}
}
return prefetch;
}
static inline int is_prefetch(struct pt_regs *regs, unsigned long addr)
{
if (unlikely(boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
boot_cpu_data.x86 >= 6))
return __is_prefetch(regs, addr);
return 0;
}
asmlinkage void do_invalid_op(struct pt_regs *, unsigned long);
/*
......@@ -86,6 +228,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
tsk = current;
info.si_code = SEGV_MAPERR;
/*
* We fault-in kernel-space virtual memory on-demand. The
* 'reference' page table is init_mm.pgd.
......@@ -99,18 +243,24 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
* (error_code & 4) == 0, and that the fault was not a
* protection error (error_code & 1) == 0.
*/
if (address >= TASK_SIZE && !(error_code & 5))
goto vmalloc_fault;
if (unlikely(address >= TASK_SIZE)) {
if (!(error_code & 5))
goto vmalloc_fault;
/*
* Don't take the mm semaphore here. If we fixup a prefetch
* fault we could otherwise deadlock.
*/
goto bad_area_nosemaphore;
}
mm = tsk->mm;
info.si_code = SEGV_MAPERR;
/*
* If we're in an interrupt, have no user context or are running in an
* atomic region then we must not take the fault..
*/
if (in_atomic() || !mm)
goto no_context;
goto bad_area_nosemaphore;
down_read(&mm->mmap_sem);
......@@ -198,8 +348,16 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
bad_area:
up_read(&mm->mmap_sem);
bad_area_nosemaphore:
/* User mode accesses just cause a SIGSEGV */
if (error_code & 4) {
/*
* Valid to do another page fault here because this one came
* from user space.
*/
if (is_prefetch(regs, address))
return;
tsk->thread.cr2 = address;
tsk->thread.error_code = error_code;
tsk->thread.trap_no = 14;
......@@ -232,6 +390,14 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (fixup_exception(regs))
return;
/*
* Valid to do another page fault here, because if this fault
* had been triggered by is_prefetch fixup_exception would have
* handled it.
*/
if (is_prefetch(regs, address))
return;
/*
* Oops. The kernel tried to access some bad page. We'll have to
* terminate things with extreme prejudice.
......@@ -286,10 +452,14 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
do_sigbus:
up_read(&mm->mmap_sem);
/*
* Send a sigbus, regardless of whether we were in kernel
* or user mode.
*/
/* Kernel mode? Handle exceptions or die */
if (!(error_code & 4))
goto no_context;
/* User space => ok to do another page fault */
if (is_prefetch(regs, address))
return;
tsk->thread.cr2 = address;
tsk->thread.error_code = error_code;
tsk->thread.trap_no = 14;
......@@ -298,10 +468,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
info.si_code = BUS_ADRERR;
info.si_addr = (void *)address;
force_sig_info(SIGBUS, &info, tsk);
/* Kernel mode? Handle exceptions or die */
if (!(error_code & 4))
goto no_context;
return;
vmalloc_fault:
......
......@@ -1347,7 +1347,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
* be holding locks...
*/
if (user_mode(regs))
tty_write_message(process_tty(current), buf);
tty_write_message(current->tty, buf);
buf[len-1] = '\0'; /* drop '\r' */
printk(KERN_WARNING "%s", buf); /* watch for command names containing %s */
}
......
......@@ -799,11 +799,9 @@ CONFIG_ATM_TCP=m
# CONFIG_ATM_ENI is not set
# CONFIG_ATM_FIRESTREAM is not set
# CONFIG_ATM_ZATM is not set
# CONFIG_ATM_NICSTAR is not set
# CONFIG_ATM_IDT77252 is not set
# CONFIG_ATM_AMBASSADOR is not set
# CONFIG_ATM_HORIZON is not set
# CONFIG_ATM_IA is not set
CONFIG_ATM_FORE200E_MAYBE=m
CONFIG_ATM_FORE200E_PCA=y
CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
......@@ -835,7 +833,6 @@ CONFIG_ROSE=m
# CONFIG_BAYCOM_SER_FDX is not set
# CONFIG_BAYCOM_SER_HDX is not set
# CONFIG_BAYCOM_PAR is not set
# CONFIG_BAYCOM_EPP is not set
# CONFIG_YAM is not set
#
......@@ -1037,7 +1034,6 @@ CONFIG_I2C_I801=m
CONFIG_I2C_I810=m
CONFIG_I2C_NFORCE2=m
CONFIG_I2C_PHILIPSPAR=m
CONFIG_I2C_PIIX4=m
CONFIG_I2C_PROSAVAGE=m
CONFIG_I2C_SAVAGE4=m
CONFIG_SCx200_ACB=m
......@@ -1148,6 +1144,7 @@ CONFIG_UFS_FS_WRITE=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V4=y
CONFIG_NFS_DIRECTIO=y
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
CONFIG_NFSD_V4=y
......@@ -1273,7 +1270,7 @@ CONFIG_DVB_CORE=m
# Supported Frontend Modules
#
CONFIG_DVB_STV0299=m
CONFIG_DVB_ALPS_BSRV2=m
CONFIG_DVB_SP887X=m
CONFIG_DVB_ALPS_TDLB7=m
CONFIG_DVB_ALPS_TDMB7=m
CONFIG_DVB_ATMEL_AT76C651=m
......@@ -1282,6 +1279,7 @@ CONFIG_DVB_GRUNDIG_29504_491=m
CONFIG_DVB_GRUNDIG_29504_401=m
CONFIG_DVB_MT312=m
CONFIG_DVB_VES1820=m
CONFIG_DVB_VES1X93=m
#
# Supported SAA7146 based PCI Adapters
......@@ -1302,6 +1300,7 @@ CONFIG_DVB_BUDGET_PATCH=m
#
CONFIG_DVB_B2C2_SKYSTAR=m
CONFIG_VIDEO_SAA7146=m
CONFIG_VIDEO_SAA7146_VV=m
CONFIG_VIDEO_VIDEOBUF=m
CONFIG_VIDEO_TUNER=m
CONFIG_VIDEO_BUF=m
......
......@@ -73,6 +73,14 @@ static inline int decode_access_size(unsigned int insn)
else {
printk("Impossible unaligned trap. insn=%08x\n", insn);
die_if_kernel("Byte sized unaligned access?!?!", current_thread_info()->kregs);
/* GCC should never warn that control reaches the end
* of this function without returning a value because
* die_if_kernel() is marked with attribute 'noreturn'.
* Alas, some versions do...
*/
return 0;
}
}
......
......@@ -402,7 +402,7 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid)
Solaris setpgrp and setsid? */
ret = sys_setpgid(0, 0);
if (ret) return ret;
current->signal->tty = NULL;
current->tty = NULL;
return process_group(current);
}
case 2: /* getsid */
......
......@@ -166,7 +166,7 @@ config ATM_ZATM_DEBUG
# fi
config ATM_NICSTAR
tristate "IDT 77201 (NICStAR) (ForeRunnerLE)"
depends on PCI && ATM
depends on PCI && ATM && !64BIT
help
The NICStAR chipset family is used in a large number of ATM NICs for
25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE
......@@ -282,7 +282,7 @@ config ATM_HORIZON_DEBUG
config ATM_IA
tristate "Interphase ATM PCI x575/x525/x531"
depends on PCI && ATM
depends on PCI && ATM && !64BIT
---help---
This is a driver for the Interphase (i)ChipSAR adapter cards
which include a variety of variants in term of the size of the
......
......@@ -974,8 +974,7 @@ static ssize_t read_chan(struct tty_struct *tty, struct file *file,
/* NOTE: not yet done after every sleep pending a thorough
check of the logic of this change. -- jlc */
/* don't stop on /dev/console */
if (file->f_op->write != redirected_tty_write &&
process_tty(current) == tty) {
if (file->f_op->write != redirected_tty_write && current->tty == tty) {
if (tty->pgrp <= 0)
printk("read_chan: tty->pgrp <= 0!\n");
else if (process_group(current) != tty->pgrp) {
......
......@@ -953,7 +953,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
/*
* Info->count is now 1; so it's safe to sleep now.
*/
info->session = process_session(current);
info->session = current->session;
info->pgrp = process_group(current);
if ((info->flags & ROCKET_INITIALIZED) == 0) {
......
......@@ -316,7 +316,7 @@ struct tty_driver *get_tty_driver(dev_t device, int *index)
*/
int tty_check_change(struct tty_struct * tty)
{
if (process_tty(current) != tty)
if (current->tty != tty)
return 0;
if (tty->pgrp <= 0) {
printk(KERN_WARNING "tty_check_change: tty->pgrp <= 0!\n");
......@@ -483,14 +483,14 @@ void do_tty_hangup(void *data)
if (tty->session > 0) {
struct list_head *l;
for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) {
if (process_tty(p) == tty)
p->signal->tty = NULL;
if (!process_session_leader(p))
if (p->tty == tty)
p->tty = NULL;
if (!p->leader)
continue;
send_group_sig_info(SIGHUP, SEND_SIG_PRIV, p);
send_group_sig_info(SIGCONT, SEND_SIG_PRIV, p);
if (tty->pgrp > 0)
p->signal->tty_old_pgrp = tty->pgrp;
p->tty_old_pgrp = tty->pgrp;
}
}
read_unlock(&tasklist_lock);
......@@ -567,15 +567,15 @@ void disassociate_ctty(int on_exit)
lock_kernel();
tty = process_tty(current);
tty = current->tty;
if (tty) {
tty_pgrp = tty->pgrp;
if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY)
tty_vhangup(tty);
} else {
if (current->signal->tty_old_pgrp) {
kill_pg(current->signal->tty_old_pgrp, SIGHUP, on_exit);
kill_pg(current->signal->tty_old_pgrp, SIGCONT, on_exit);
if (current->tty_old_pgrp) {
kill_pg(current->tty_old_pgrp, SIGHUP, on_exit);
kill_pg(current->tty_old_pgrp, SIGCONT, on_exit);
}
unlock_kernel();
return;
......@@ -586,13 +586,13 @@ void disassociate_ctty(int on_exit)
kill_pg(tty_pgrp, SIGCONT, on_exit);
}
current->signal->tty_old_pgrp = 0;
current->tty_old_pgrp = 0;
tty->session = 0;
tty->pgrp = -1;
read_lock(&tasklist_lock);
for_each_task_pid(process_session(current), PIDTYPE_SID, p, l, pid)
p->signal->tty = NULL;
for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid)
p->tty = NULL;
read_unlock(&tasklist_lock);
unlock_kernel();
}
......@@ -1220,10 +1220,10 @@ static void release_dev(struct file * filp)
read_lock(&tasklist_lock);
for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid)
p->signal->tty = NULL;
p->tty = NULL;
if (o_tty)
for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid)
p->signal->tty = NULL;
p->tty = NULL;
read_unlock(&tasklist_lock);
}
......@@ -1294,10 +1294,10 @@ static int tty_open(struct inode * inode, struct file * filp)
retry_open:
noctty = filp->f_flags & O_NOCTTY;
if (device == MKDEV(TTYAUX_MAJOR,0)) {
if (!process_tty(current))
if (!current->tty)
return -ENXIO;
driver = process_tty(current)->driver;
index = process_tty(current)->index;
driver = current->tty->driver;
index = current->tty->index;
filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */
/* noctty = 1; */
goto got_driver;
......@@ -1391,13 +1391,15 @@ static int tty_open(struct inode * inode, struct file * filp)
filp->f_op = &tty_fops;
goto retry_open;
}
if (!noctty && process_session_leader(current) &&
!process_tty(current) && tty->session == 0) {
if (!noctty &&
current->leader &&
!current->tty &&
tty->session == 0) {
task_lock(current);
current->signal->tty = tty;
current->tty = tty;
task_unlock(current);
current->signal->tty_old_pgrp = 0;
tty->session = process_session(current);
current->tty_old_pgrp = 0;
tty->session = current->session;
tty->pgrp = process_group(current);
}
return 0;
......@@ -1455,7 +1457,7 @@ static int tiocsti(struct tty_struct *tty, char * arg)
{
char ch, mbz = 0;
if ((process_tty(current) != tty) && !capable(CAP_SYS_ADMIN))
if ((current->tty != tty) && !capable(CAP_SYS_ADMIN))
return -EPERM;
if (get_user(ch, arg))
return -EFAULT;
......@@ -1541,14 +1543,14 @@ static int tiocsctty(struct tty_struct *tty, int arg)
struct pid *pid;
task_t *p;
if (process_session_leader(current) &&
(process_session(current) == tty->session))
if (current->leader &&
(current->session == tty->session))
return 0;
/*
* The process must be a session leader and
* not have a controlling tty already.
*/
if (!process_session_leader(current) || process_tty(current))
if (!current->leader || current->tty)
return -EPERM;
if (tty->session > 0) {
/*
......@@ -1562,16 +1564,16 @@ static int tiocsctty(struct tty_struct *tty, int arg)
read_lock(&tasklist_lock);
for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid)
p->signal->tty = NULL;
p->tty = NULL;
read_unlock(&tasklist_lock);
} else
return -EPERM;
}
task_lock(current);
current->signal->tty = tty;
current->tty = tty;
task_unlock(current);
current->signal->tty_old_pgrp = 0;
tty->session = process_session(current);
current->tty_old_pgrp = 0;
tty->session = current->session;
tty->pgrp = process_group(current);
return 0;
}
......@@ -1582,13 +1584,12 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
* (tty == real_tty) is a cheap way of
* testing if the tty is NOT a master pty.
*/
if (tty == real_tty && process_tty(current) != real_tty)
if (tty == real_tty && current->tty != real_tty)
return -ENOTTY;
return put_user(real_tty->pgrp, arg);
}
static int tiocspgrp(struct tty_struct *tty,
struct tty_struct *real_tty, pid_t *arg)
static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t *arg)
{
pid_t pgrp;
int retval = tty_check_change(real_tty);
......@@ -1597,14 +1598,15 @@ static int tiocspgrp(struct tty_struct *tty,
return -ENOTTY;
if (retval)
return retval;
if (!process_tty(current) || (process_tty(current) != real_tty) ||
(real_tty->session != process_session(current)))
if (!current->tty ||
(current->tty != real_tty) ||
(real_tty->session != current->session))
return -ENOTTY;
if (get_user(pgrp, (pid_t *) arg))
return -EFAULT;
if (pgrp < 0)
return -EINVAL;
if (session_of_pgrp(pgrp) != process_session(current))
if (session_of_pgrp(pgrp) != current->session)
return -EPERM;
real_tty->pgrp = pgrp;
return 0;
......@@ -1616,7 +1618,7 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t *
* (tty == real_tty) is a cheap way of
* testing if the tty is NOT a master pty.
*/
if (tty == real_tty && process_tty(current) != real_tty)
if (tty == real_tty && current->tty != real_tty)
return -ENOTTY;
if (real_tty->session <= 0)
return -ENOTTY;
......@@ -1774,12 +1776,12 @@ int tty_ioctl(struct inode * inode, struct file * file,
clear_bit(TTY_EXCLUSIVE, &tty->flags);
return 0;
case TIOCNOTTY:
if (process_tty(current) != tty)
if (current->tty != tty)
return -ENOTTY;
if (process_session_leader(current))
if (current->leader)
disassociate_ctty(0);
task_lock(current);
current->signal->tty = NULL;
current->tty = NULL;
task_unlock(current);
return 0;
case TIOCSCTTY:
......@@ -1883,10 +1885,10 @@ static void __do_SAK(void *arg)
tty->driver->flush_buffer(tty);
read_lock(&tasklist_lock);
for_each_task_pid(session, PIDTYPE_SID, p, l, pid) {
if (process_tty(p) == tty || session > 0) {
if (p->tty == tty || session > 0) {
printk(KERN_NOTICE "SAK: killed process %d"
" (%s): process_session(p)==tty->session\n",
p->pid, p->comm);
" (%s): p->session==tty->session\n",
p->pid, p->comm);
send_sig(SIGKILL, p, 1);
continue;
}
......
......@@ -2226,7 +2226,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
if (tty->driver->type != TTY_DRIVER_TYPE_CONSOLE)
return -EINVAL;
if (process_tty(current) != tty && !capable(CAP_SYS_ADMIN))
if (current->tty != tty && !capable(CAP_SYS_ADMIN))
return -EPERM;
if (get_user(type, (char *)arg))
return -EFAULT;
......
......@@ -380,7 +380,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
* to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
*/
perm = 0;
if (process_tty(current) == tty || capable(CAP_SYS_TTY_CONFIG))
if (current->tty == tty || capable(CAP_SYS_TTY_CONFIG))
perm = 1;
kbd = kbd_table + console;
......@@ -1188,3 +1188,4 @@ void change_console(unsigned int new_console)
complete_change_console(new_console);
}
......@@ -47,6 +47,8 @@
#include <linux/video_decoder.h>
#include <linux/video_encoder.h>
#include <asm/io.h>
#include "videocodec.h"
#include "zoran.h"
#include "zoran_card.h"
......
......@@ -46,6 +46,8 @@
#include <linux/video_encoder.h>
#include <linux/delay.h>
#include <asm/io.h>
#include "videocodec.h"
#include "zoran.h"
#include "zoran_device.h"
......
......@@ -73,6 +73,7 @@
#include <linux/videodev.h>
#include "videocodec.h"
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/proc_fs.h>
......
......@@ -1132,12 +1132,8 @@ static void __exit sa1100_irda_exit(void)
release_mem_region(__PREG(Ser2HSCR0), 0x1c);
release_mem_region(__PREG(Ser2UTCR0), 0x24);
/*
* We now know that the netdevice is no longer in use, and all
* references to our driver have been removed. The only structure
* which may still be present is the netdevice, which will get
* cleaned up by net/core/dev.c
*/
if(dev)
free_netdev(dev);
}
static int __init sa1100ir_setup(char *line)
......
......@@ -125,19 +125,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct net_device_stats *stats = (struct net_device_stats *)dev->priv;
/*
* Optimise so buffers with skb->free=1 are not copied but
* instead are lobbed from tx queue to rx queue
*/
if (skb_shared(skb)) {
struct sk_buff *skb2=skb;
skb=skb_clone(skb, GFP_ATOMIC); /* Clone the buffer */
kfree_skb(skb2);
if (unlikely(skb==NULL))
return 0;
} else
skb_orphan(skb);
skb_orphan(skb);
skb->protocol=eth_type_trans(skb,dev);
skb->dev=dev;
......
......@@ -1307,7 +1307,7 @@ static int sl_ioctl(struct net_device *dev,struct ifreq *rq,int cmd)
/* Resolve race condition, when ioctl'ing hanged up
and opened by another process device.
*/
if (sl->tty != process_tty(current) && sl->pid != current->pid) {
if (sl->tty != current->tty && sl->pid != current->pid) {
spin_unlock_bh(&sl->lock);
return -EPERM;
}
......
......@@ -2731,6 +2731,19 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
if (gem_get_device_address(gp))
goto err_out_free_consistent;
dev->open = gem_open;
dev->stop = gem_close;
dev->hard_start_xmit = gem_start_xmit;
dev->get_stats = gem_get_stats;
dev->set_multicast_list = gem_set_multicast;
dev->do_ioctl = gem_ioctl;
dev->ethtool_ops = &gem_ethtool_ops;
dev->tx_timeout = gem_tx_timeout;
dev->watchdog_timeo = 5 * HZ;
dev->change_mtu = gem_change_mtu;
dev->irq = pdev->irq;
dev->dma = 0;
if (register_netdev(dev)) {
printk(KERN_ERR PFX "Cannot register net device, "
"aborting.\n");
......@@ -2759,19 +2772,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev);
dev->open = gem_open;
dev->stop = gem_close;
dev->hard_start_xmit = gem_start_xmit;
dev->get_stats = gem_get_stats;
dev->set_multicast_list = gem_set_multicast;
dev->do_ioctl = gem_ioctl;
dev->ethtool_ops = &gem_ethtool_ops;
dev->tx_timeout = gem_tx_timeout;
dev->watchdog_timeo = 5 * HZ;
dev->change_mtu = gem_change_mtu;
dev->irq = pdev->irq;
dev->dma = 0;
/* GEM can do it all... */
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
if (pci_using_dac)
......
......@@ -615,7 +615,7 @@ static void sppp_channel_init(struct channel_data *chan)
d->get_stats = cosa_net_stats;
d->tx_timeout = cosa_sppp_timeout;
d->watchdog_timeo = TX_TIMEOUT;
if (register_netdev(d) == -1) {
if (register_netdev(d)) {
printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
sppp_detach(chan->pppdev.dev);
free_netdev(chan->pppdev.dev);
......
......@@ -311,7 +311,9 @@ int hdlc_cisco_ioctl(hdlc_device *hdlc, struct ifreq *ifr)
hdlc->proto.id = IF_PROTO_CISCO;
dev->hard_start_xmit = hdlc->xmit;
dev->hard_header = cisco_hard_header;
dev->hard_header_cache = NULL;
dev->type = ARPHRD_CISCO;
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
dev->addr_len = 0;
return 0;
}
......
......@@ -1084,7 +1084,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
prstatus->pr_pid = p->pid;
prstatus->pr_ppid = p->parent->pid;
prstatus->pr_pgrp = process_group(p);
prstatus->pr_sid = process_session(p);
prstatus->pr_sid = p->session;
jiffies_to_timeval(p->utime, &prstatus->pr_utime);
jiffies_to_timeval(p->stime, &prstatus->pr_stime);
jiffies_to_timeval(p->cutime, &prstatus->pr_cutime);
......@@ -1112,7 +1112,7 @@ static void fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
psinfo->pr_pid = p->pid;
psinfo->pr_ppid = p->parent->pid;
psinfo->pr_pgrp = process_group(p);
psinfo->pr_sid = process_session(p);
psinfo->pr_sid = p->session;
i = p->state ? ffz(~p->state) + 1 : 0;
psinfo->pr_state = i;
......
......@@ -1574,7 +1574,7 @@ static int vt_check(struct file *file)
* To have permissions to do most of the vt ioctls, we either have
* to be the owner of the tty, or super-user.
*/
if (process_tty(current) == tty || capable(CAP_SYS_ADMIN))
if (current->tty == tty || capable(CAP_SYS_ADMIN))
return 1;
return 0;
}
......
......@@ -668,12 +668,12 @@ static void print_warning(struct dquot *dquot, const char warntype)
if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags)))
return;
tty_write_message(process_tty(current), dquot->dq_sb->s_id);
tty_write_message(current->tty, dquot->dq_sb->s_id);
if (warntype == ISOFTWARN || warntype == BSOFTWARN)
tty_write_message(process_tty(current), ": warning, ");
tty_write_message(current->tty, ": warning, ");
else
tty_write_message(process_tty(current), ": write failed, ");
tty_write_message(process_tty(current), quotatypes[dquot->dq_type]);
tty_write_message(current->tty, ": write failed, ");
tty_write_message(current->tty, quotatypes[dquot->dq_type]);
switch (warntype) {
case IHARDWARN:
msg = " file limit reached.\n";
......@@ -694,7 +694,7 @@ static void print_warning(struct dquot *dquot, const char warntype)
msg = " block quota exceeded.\n";
break;
}
tty_write_message(process_tty(current), msg);
tty_write_message(current->tty, msg);
}
static inline void flush_warnings(struct dquot **dquots, char *warntype)
......
......@@ -596,11 +596,6 @@ static inline int de_thread(struct task_struct *tsk)
newsig->group_stop_count = 0;
newsig->curr_target = NULL;
init_sigpending(&newsig->shared_pending);
newsig->pgrp = oldsig->pgrp;
newsig->session = oldsig->session;
newsig->leader = oldsig->leader;
newsig->tty_old_pgrp = oldsig->tty_old_pgrp;
}
if (thread_group_empty(current))
......
......@@ -1035,7 +1035,7 @@ EXPORT_SYMBOL(sys_close);
asmlinkage long sys_vhangup(void)
{
if (capable(CAP_SYS_TTY_CONFIG)) {
tty_vhangup(process_tty(current));
tty_vhangup(current->tty);
return 0;
}
return -EPERM;
......
......@@ -304,9 +304,9 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
mm = task->mm;
if(mm)
mm = mmgrab(mm);
if (process_tty(task)) {
tty_pgrp = process_tty(task)->pgrp;
tty_nr = new_encode_dev(tty_devnum(process_tty(task)));
if (task->tty) {
tty_pgrp = task->tty->pgrp;
tty_nr = new_encode_dev(tty_devnum(task->tty));
}
task_unlock(task);
if (mm) {
......@@ -345,7 +345,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
state,
ppid,
process_group(task),
process_session(task),
task->session,
tty_nr,
tty_pgrp,
task->flags,
......
......@@ -585,12 +585,12 @@ static inline void rep_nop(void)
/* Prefetch instructions for Pentium III and AMD Athlon */
/* It's not worth to care about 3dnow! prefetches for the K6
because they are microcoded there and very slow. */
because they are microcoded there and very slow.
However we don't do prefetches for pre XP Athlons currently
That should be fixed. */
#define ARCH_HAS_PREFETCH
extern inline void prefetch(const void *x)
{
if (cpu_data[0].x86_vendor == X86_VENDOR_AMD)
return; /* Some athlons fault if the address is bad */
alternative_input(ASM_NOP4,
"prefetchnta (%1)",
X86_FEATURE_XMM,
......
......@@ -264,15 +264,6 @@ struct signal_struct {
/* thread group stop support, overloads group_exit_code too */
int group_stop_count;
/* job control IDs */
pid_t pgrp;
pid_t tty_old_pgrp;
pid_t session;
/* boolean value for session group leader */
int leader;
struct tty_struct *tty; /* NULL if no tty */
};
/*
......@@ -375,7 +366,12 @@ struct task_struct {
unsigned long personality;
int did_exec:1;
pid_t pid;
pid_t __pgrp; /* Accessed via process_group() */
pid_t tty_old_pgrp;
pid_t session;
pid_t tgid;
/* boolean value for session group leader */
int leader;
/*
* pointers to (original) parent process, youngest child, younger sibling,
* older sibling, respectively. (p->father can be replaced with
......@@ -419,6 +415,7 @@ struct task_struct {
char comm[16];
/* file system info */
int link_count, total_link_count;
struct tty_struct *tty; /* NULL if no tty */
/* ipc stuff */
struct sysv_sem sysvsem;
/* CPU-specific state of this task */
......@@ -471,22 +468,7 @@ struct task_struct {
static inline pid_t process_group(struct task_struct *tsk)
{
return tsk->signal->pgrp;
}
static inline pid_t process_session(struct task_struct *tsk)
{
return tsk->signal->session;
}
static inline int process_session_leader(struct task_struct *tsk)
{
return tsk->signal->leader;
}
static inline struct tty_struct *process_tty(struct task_struct *tsk)
{
return tsk->signal->tty;
return tsk->group_leader->__pgrp;
}
extern void __put_task_struct(struct task_struct *tsk);
......
......@@ -343,7 +343,7 @@ static void do_acct_process(long exitcode, struct file *file)
/* we really need to bite the bullet and change layout */
ac.ac_uid = current->uid;
ac.ac_gid = current->gid;
ac.ac_tty = process_tty(current) ? old_encode_dev(tty_devnum(process_tty(current))) : 0;
ac.ac_tty = current->tty ? old_encode_dev(tty_devnum(current->tty)) : 0;
ac.ac_flag = 0;
if (current->flags & PF_FORKNOEXEC)
......
......@@ -119,13 +119,13 @@ int session_of_pgrp(int pgrp)
read_lock(&tasklist_lock);
for_each_task_pid(pgrp, PIDTYPE_PGID, p, l, pid)
if (process_session(p) > 0) {
sid = process_session(p);
if (p->session > 0) {
sid = p->session;
goto out;
}
p = find_task_by_pid(pgrp);
if (p)
sid = process_session(p);
sid = p->session;
out:
read_unlock(&tasklist_lock);
......@@ -153,7 +153,7 @@ static int will_become_orphaned_pgrp(int pgrp, task_t *ignored_task)
|| p->real_parent->pid == 1)
continue;
if (process_group(p->real_parent) != pgrp
&& process_session(p->real_parent) == process_session(p)) {
&& p->real_parent->session == p->session) {
ret = 0;
break;
}
......@@ -242,14 +242,14 @@ void __set_special_pids(pid_t session, pid_t pgrp)
{
struct task_struct *curr = current;
if (process_session(curr) != session) {
if (curr->session != session) {
detach_pid(curr, PIDTYPE_SID);
curr->signal->session = session;
curr->session = session;
attach_pid(curr, PIDTYPE_SID, session);
}
if (process_group(curr) != pgrp) {
detach_pid(curr, PIDTYPE_PGID);
curr->signal->pgrp = pgrp;
curr->group_leader->__pgrp = pgrp;
attach_pid(curr, PIDTYPE_PGID, pgrp);
}
}
......@@ -303,7 +303,7 @@ void daemonize(const char *name, ...)
exit_mm(current);
set_special_pids(1, 1);
current->signal->tty = NULL;
current->tty = NULL;
/* Block and flush all signals */
sigfillset(&blocked);
......@@ -515,7 +515,7 @@ static inline void reparent_thread(task_t *p, task_t *father, int traced)
* outside, so the child pgrp is now orphaned.
*/
if ((process_group(p) != process_group(father)) &&
(process_session(p) == process_session(father))) {
(p->session == father->session)) {
int pgrp = process_group(p);
if (will_become_orphaned_pgrp(pgrp, NULL) && has_stopped_jobs(pgrp)) {
......@@ -625,7 +625,7 @@ static void exit_notify(struct task_struct *tsk)
t = tsk->real_parent;
if ((process_group(t) != process_group(tsk)) &&
(process_session(t) == process_session(tsk)) &&
(t->session == tsk->session) &&
will_become_orphaned_pgrp(process_group(tsk), tsk) &&
has_stopped_jobs(process_group(tsk))) {
__kill_pg_info(SIGHUP, (void *)1, process_group(tsk));
......@@ -720,7 +720,7 @@ NORET_TYPE void do_exit(long code)
exit_itimers(tsk);
exit_thread();
if (process_session_leader(tsk))
if (tsk->leader)
disassociate_ctty(1);
module_put(tsk->thread_info->exec_domain->module);
......
......@@ -743,12 +743,6 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
sig->curr_target = NULL;
init_sigpending(&sig->shared_pending);
sig->tty = process_tty(current);
sig->pgrp = process_group(current);
sig->session = process_session(current);
sig->leader = 0; /* session leadership doesn't inherit */
sig->tty_old_pgrp = 0;
return 0;
}
......@@ -795,9 +789,7 @@ struct task_struct *copy_process(unsigned long clone_flags,
* Thread groups must share signals as well, and detached threads
* can only be started up within the thread group.
*/
if ((clone_flags & CLONE_THREAD) &&
(clone_flags & (CLONE_SIGHAND|CLONE_DETACHED)) !=
(CLONE_SIGHAND|CLONE_DETACHED))
if ((clone_flags & CLONE_THREAD) && !(clone_flags & CLONE_SIGHAND))
return ERR_PTR(-EINVAL);
/*
......@@ -902,6 +894,8 @@ struct task_struct *copy_process(unsigned long clone_flags,
init_timer(&p->real_timer);
p->real_timer.data = (unsigned long) p;
p->leader = 0; /* session leadership doesn't inherit */
p->tty_old_pgrp = 0;
p->utime = p->stime = 0;
p->cutime = p->cstime = 0;
p->array = NULL;
......@@ -1046,7 +1040,7 @@ struct task_struct *copy_process(unsigned long clone_flags,
if (thread_group_leader(p)) {
attach_pid(p, PIDTYPE_TGID, p->tgid);
attach_pid(p, PIDTYPE_PGID, process_group(p));
attach_pid(p, PIDTYPE_SID, process_session(p));
attach_pid(p, PIDTYPE_SID, p->session);
if (p->pid)
__get_cpu_var(process_counts)++;
} else
......
......@@ -253,14 +253,14 @@ void switch_exec_pids(task_t *leader, task_t *thread)
attach_pid(thread, PIDTYPE_PID, thread->pid);
attach_pid(thread, PIDTYPE_TGID, thread->tgid);
attach_pid(thread, PIDTYPE_PGID, thread->signal->pgrp);
attach_pid(thread, PIDTYPE_SID, thread->signal->session);
attach_pid(thread, PIDTYPE_PGID, leader->__pgrp);
attach_pid(thread, PIDTYPE_SID, thread->session);
list_add_tail(&thread->tasks, &init_task.tasks);
attach_pid(leader, PIDTYPE_PID, leader->pid);
attach_pid(leader, PIDTYPE_TGID, leader->tgid);
attach_pid(leader, PIDTYPE_PGID, leader->signal->pgrp);
attach_pid(leader, PIDTYPE_SID, leader->signal->session);
attach_pid(leader, PIDTYPE_PGID, leader->__pgrp);
attach_pid(leader, PIDTYPE_SID, leader->session);
}
/*
......
......@@ -593,8 +593,7 @@ static int check_kill_permission(int sig, struct siginfo *info,
error = -EPERM;
if ((!info || ((unsigned long)info != 1 &&
(unsigned long)info != 2 && SI_FROMUSER(info)))
&& ((sig != SIGCONT) ||
(process_session(current) != process_session(t)))
&& ((sig != SIGCONT) || (current->session != t->session))
&& (current->euid ^ t->suid) && (current->euid ^ t->uid)
&& (current->uid ^ t->suid) && (current->uid ^ t->uid)
&& !capable(CAP_KILL))
......@@ -1103,7 +1102,7 @@ kill_sl_info(int sig, struct siginfo *info, pid_t sid)
retval = -ESRCH;
read_lock(&tasklist_lock);
for_each_task_pid(sid, PIDTYPE_SID, p, l, pid) {
if (!process_session_leader(p))
if (!p->leader)
continue;
err = group_send_sig_info(sig, info, p);
if (retval)
......
......@@ -969,7 +969,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
if (p->parent == current || p->real_parent == current) {
err = -EPERM;
if (process_session(p) != process_session(current))
if (p->session != current->session)
goto out;
err = -EACCES;
if (p->did_exec)
......@@ -981,7 +981,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
}
err = -EPERM;
if (process_session_leader(p))
if (p->leader)
goto out;
if (pgid != pid) {
......@@ -990,7 +990,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
struct list_head *l;
for_each_task_pid(pgid, PIDTYPE_PGID, p, l, pid)
if (process_session(p) == process_session(current))
if (p->session == current->session)
goto ok_pgid;
goto out;
}
......@@ -1002,7 +1002,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid)
if (process_group(p) != pgid) {
detach_pid(p, PIDTYPE_PGID);
p->signal->pgrp = pgid;
p->group_leader->__pgrp = pgid;
attach_pid(p, PIDTYPE_PGID, pgid);
}
......@@ -1044,7 +1044,7 @@ asmlinkage long sys_getpgrp(void)
asmlinkage long sys_getsid(pid_t pid)
{
if (!pid) {
return process_session(current);
return current->session;
} else {
int retval;
struct task_struct *p;
......@@ -1056,7 +1056,7 @@ asmlinkage long sys_getsid(pid_t pid)
if(p) {
retval = security_task_getsid(p);
if (!retval)
retval = process_session(p);
retval = p->session;
}
read_unlock(&tasklist_lock);
return retval;
......@@ -1077,10 +1077,10 @@ asmlinkage long sys_setsid(void)
if (pid)
goto out;
current->signal->leader = 1;
current->leader = 1;
__set_special_pids(current->pid, current->pid);
current->signal->tty = NULL;
current->signal->tty_old_pgrp = 0;
current->tty = NULL;
current->tty_old_pgrp = 0;
err = process_group(current);
out:
write_unlock_irq(&tasklist_lock);
......
......@@ -76,7 +76,7 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
if (skb_shared(skb) || skb_cloned(skb)) {
struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
kfree(skb);
kfree_skb(skb);
skb = nskb;
}
if (skb) {
......
......@@ -90,7 +90,7 @@ match_sid(const struct sk_buff *skb, pid_t sid)
read_lock(&tasklist_lock);
do_each_thread(g, p) {
struct files_struct *files;
if (process_session(p) != sid)
if (p->session != sid)
continue;
task_lock(p);
......
......@@ -56,7 +56,7 @@ match_sid(const struct sk_buff *skb, pid_t sid)
read_lock(&tasklist_lock);
do_each_thread(g, p) {
struct files_struct *files;
if (process_session(p) != sid)
if (p->session != sid)
continue;
task_lock(p);
......
......@@ -961,19 +961,19 @@ call_verify(struct rpc_task *task)
case RPC_SUCCESS:
return p;
case RPC_PROG_UNAVAIL:
printk(KERN_WARNING "RPC: %4d call_verify: program %u is unsupported by server %s\n",
task->tk_pid, (unsigned int)task->tk_client->cl_prog,
printk(KERN_WARNING "RPC: call_verify: program %u is unsupported by server %s\n",
(unsigned int)task->tk_client->cl_prog,
task->tk_client->cl_server);
goto out_eio;
case RPC_PROG_MISMATCH:
printk(KERN_WARNING "RPC: %4d call_verify: program %u, version %u unsupported by server %s\n",
task->tk_pid, (unsigned int)task->tk_client->cl_prog,
printk(KERN_WARNING "RPC: call_verify: program %u, version %u unsupported by server %s\n",
(unsigned int)task->tk_client->cl_prog,
(unsigned int)task->tk_client->cl_vers,
task->tk_client->cl_server);
goto out_eio;
case RPC_PROC_UNAVAIL:
printk(KERN_WARNING "RPC: %4d call_verify: proc %p unsupported by program %u, version %u on server %s\n",
task->tk_pid, task->tk_msg.rpc_proc,
printk(KERN_WARNING "RPC: call_verify: proc %p unsupported by program %u, version %u on server %s\n",
task->tk_msg.rpc_proc,
task->tk_client->cl_prog,
task->tk_client->cl_vers,
task->tk_client->cl_server);
......
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