fix ! versus precedence in various places

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eaa0ff15c30dc9799eb4d12660edb73aeb6d32c5
Commit: eaa0ff15c30dc9799eb4d12660edb73aeb6d32c5
Parent: 551e4fb2465b87de9d4aa1669b27d624435443bb
Author: Alexey Dobriyan [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:06 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:40:59 2008 -0800

fix ! versus  precedence in various places

Fix various instances of

if (!expr  mask)

which should probably have been

if (!(expr  mask))

Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED]
Cc: Jens Axboe [EMAIL PROTECTED]
Cc: Peter Osterlund [EMAIL PROTECTED]
Cc: Karsten Keil [EMAIL PROTECTED]
Cc: Mauro Carvalho Chehab [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Cc: Mark Fasheh [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Cc: Al Viro [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/block/paride/pt.c|2 +-
 drivers/block/pktcdvd.c  |4 ++--
 drivers/isdn/act2000/module.c|   22 +++---
 drivers/isdn/i4l/isdn_ttyfax.c   |2 +-
 drivers/isdn/icn/icn.c   |   22 +++---
 drivers/isdn/isdnloop/isdnloop.c |   16 
 drivers/video/i810/i810_main.c   |2 +-
 drivers/video/sis/sis_main.c |2 +-
 8 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 76096ca..8b9549a 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -660,7 +660,7 @@ static int pt_open(struct inode *inode, struct file *file)
pt_identify(tape);
 
err = -ENODEV;
-   if (!tape-flags  PT_MEDIA)
+   if (!(tape-flags  PT_MEDIA))
goto out;
 
err = -EROFS;
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index e9de171..674cd66 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2212,11 +2212,11 @@ static int pkt_media_speed(struct pktcdvd_device *pd, 
unsigned *speed)
return ret;
}
 
-   if (!buf[6]  0x40) {
+   if (!(buf[6]  0x40)) {
printk(DRIVER_NAME: Disc type is not CD-RW\n);
return 1;
}
-   if (!buf[6]  0x4) {
+   if (!(buf[6]  0x4)) {
printk(DRIVER_NAME: A1 values on media are not valid, maybe 
not CDRW?\n);
return 1;
}
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c
index ee2b0b9..8325022 100644
--- a/drivers/isdn/act2000/module.c
+++ b/drivers/isdn/act2000/module.c
@@ -310,7 +310,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
}
break;
case ISDN_CMD_DIAL:
-   if (!card-flags  ACT2000_FLAGS_RUNNING)
+   if (!(card-flags  ACT2000_FLAGS_RUNNING))
return -ENODEV;
if (!(chan = find_channel(card, c-arg  0x0f)))
break;
@@ -339,7 +339,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
}
return ret;
case ISDN_CMD_ACCEPTD:
-   if (!card-flags  ACT2000_FLAGS_RUNNING)
+   if (!(card-flags  ACT2000_FLAGS_RUNNING))
return -ENODEV;
if (!(chan = find_channel(card, c-arg  0x0f)))
break;
@@ -347,11 +347,11 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
actcapi_select_b2_protocol_req(card, chan);
return 0;
case ISDN_CMD_ACCEPTB:
-   if (!card-flags  ACT2000_FLAGS_RUNNING)
+   if (!(card-flags  ACT2000_FLAGS_RUNNING))
return -ENODEV;
return 0;
case ISDN_CMD_HANGUP:
-   if (!card-flags  ACT2000_FLAGS_RUNNING)
+   if (!(card-flags  ACT2000_FLAGS_RUNNING))
return -ENODEV;
if (!(chan = find_channel(card, c-arg  0x0f)))
break;
@@ -366,7 +366,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
}
return 0;
case ISDN_CMD_SETEAZ:
-   if (!card-flags  ACT2000_FLAGS_RUNNING)
+   if (!(card-flags  ACT2000_FLAGS_RUNNING))
return -ENODEV;
if (!(chan = find_channel(card, c-arg  0x0f)))
break;
@@ -386,7 +386,7 @@ act2000_command(act2000_card * 

geode lists are subscriber only

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20292bc2c3feaee7f2e93911ffcb692732293894
Commit: 20292bc2c3feaee7f2e93911ffcb692732293894
Parent: eaa0ff15c30dc9799eb4d12660edb73aeb6d32c5
Author: Alan Cox [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:07 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:40:59 2008 -0800

geode lists are subscriber only

This gave me bounces and moans when chasing CS5536 so document it.

Signed-off-by: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 MAINTAINERS |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4f3da8b..c5057d0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -338,13 +338,12 @@ S:Maintained for 2.4; PCI support for 2.6.
 AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
 P: Thomas Dahlmann
 M: [EMAIL PROTECTED]
-L: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED]   (subscribers-only)
 S: Supported
 
 AMD GEODE PROCESSOR/CHIPSET SUPPORT
 P: Jordan Crouse
-M: [EMAIL PROTECTED]
-L: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED]   (subscribers-only)
 W: 
http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
 S: Supported
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs/fat/: refine chmod checks

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=19c561a60ffe52df88dd63de0bff480ca094efe4
Commit: 19c561a60ffe52df88dd63de0bff480ca094efe4
Parent: 20292bc2c3feaee7f2e93911ffcb692732293894
Author: Jan Engelhardt [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:08 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:40:59 2008 -0800

fs/fat/: refine chmod checks

Prohibit mode changes in non-quiet mode that cannot be stored reliably with
the on-disk format.

Suppose a vfat filesystem is mounted with umask=0 and [not-quiet].  Then
all files will have mode 0777.  Trying to change the owner will fail,
because fat does not know about owners or groups.  chmod 0770, on the other
hand, will succeed, even though fat does not know about the permission
triplet [user/group/other].

So this patch changes fat's not-quiet behavior so that only UNIX modes are
accepted that can be mapped lossless between the fat disk format and the
local system.  There is only one attribute, and that is the readonly
attribute, which is mapped to the UNIX write permission bit(s).  chmod 0555
is therefore valid (taking away the +w bits = setting the readonly
attribute).  Since chmod 0775 and chmod 0755 is an ambiguous case as to
whether to set or clear the readonly bit, these modes are also denied.

In quiet mode, chmod and chown will continue to succeed as they did
before, meaning that a subsequent stat() will temporarily return the new
mode as long as the inode is not reread from disk, and chown will silently
do nothing, not even return the new uid/gid in stat().

Signed-off-by: Jan Engelhardt [EMAIL PROTECTED]
Cc: OGAWA Hirofumi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/fat/file.c |   47 ---
 1 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/fs/fat/file.c b/fs/fat/file.c
index 69a83b5..c614175 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -155,6 +155,42 @@ out:
return err;
 }
 
+static int check_mode(const struct msdos_sb_info *sbi, mode_t mode)
+{
+   mode_t req = mode  ~S_IFMT;
+
+   /*
+* Of the r and x bits, all (subject to umask) must be present. Of the
+* w bits, either all (subject to umask) or none must be present.
+*/
+
+   if (S_ISREG(mode)) {
+   req = ~sbi-options.fs_fmask;
+
+   if ((req  (S_IRUGO | S_IXUGO)) !=
+   ((S_IRUGO | S_IXUGO)  ~sbi-options.fs_fmask))
+   return -EPERM;
+
+   if ((req  S_IWUGO) != 0 
+   (req  S_IWUGO) != (S_IWUGO  ~sbi-options.fs_fmask))
+   return -EPERM;
+   } else if (S_ISDIR(mode)) {
+   req = ~sbi-options.fs_dmask;
+
+   if ((req  (S_IRUGO | S_IXUGO)) !=
+   ((S_IRUGO | S_IXUGO)  ~sbi-options.fs_dmask))
+   return -EPERM;
+
+   if ((req  S_IWUGO) != 0 
+   (req  S_IWUGO) != (S_IWUGO  ~sbi-options.fs_dmask))
+   return -EPERM;
+   } else {
+   return -EPERM;
+   }
+
+   return 0;
+}
+
 int fat_notify_change(struct dentry *dentry, struct iattr *attr)
 {
struct msdos_sb_info *sbi = MSDOS_SB(dentry-d_sb);
@@ -186,9 +222,7 @@ int fat_notify_change(struct dentry *dentry, struct iattr 
*attr)
if (((attr-ia_valid  ATTR_UID) 
 (attr-ia_uid != sbi-options.fs_uid)) ||
((attr-ia_valid  ATTR_GID) 
-(attr-ia_gid != sbi-options.fs_gid)) ||
-   ((attr-ia_valid  ATTR_MODE) 
-(attr-ia_mode  ~MSDOS_VALID_MODE)))
+(attr-ia_gid != sbi-options.fs_gid)))
error = -EPERM;
 
if (error) {
@@ -196,6 +230,13 @@ int fat_notify_change(struct dentry *dentry, struct iattr 
*attr)
error = 0;
goto out;
}
+
+   if (attr-ia_valid  ATTR_MODE) {
+   error = check_mode(sbi, attr-ia_mode);
+   if (error != 0  !sbi-options.quiet)
+   goto out;
+   }
+
error = inode_setattr(inode, attr);
if (error)
goto out;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


A potential bug in inotify_user.c

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c17d18e3775485bf1e0ce79575eb637a94494a2
Commit: 1c17d18e3775485bf1e0ce79575eb637a94494a2
Parent: 19c561a60ffe52df88dd63de0bff480ca094efe4
Author: Yan Zheng [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:09 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

A potential bug in inotify_user.c

Following comment is at fs/inotify_user.c:287
/* coalescing: drop this event if it is a dupe of the previous */

I think the previous event in the comment should be the last event in the
link list.  But inotify_dev_get_event return the first event in the list.
In addition, it doesn't check whether the list is empty

Signed-off-by: Yan Zheng[EMAIL PROTECTED]
Acked-by: Robert Love [EMAIL PROTECTED]
Cc: John McCutchan [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/inotify_user.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/fs/inotify_user.c b/fs/inotify_user.c
index 5e00933..c509a81 100644
--- a/fs/inotify_user.c
+++ b/fs/inotify_user.c
@@ -248,6 +248,19 @@ inotify_dev_get_event(struct inotify_device *dev)
 }
 
 /*
+ * inotify_dev_get_last_event - return the last event in the given dev's queue
+ *
+ * Caller must hold dev-ev_mutex.
+ */
+static inline struct inotify_kernel_event *
+inotify_dev_get_last_event(struct inotify_device *dev)
+{
+   if (list_empty(dev-events))
+   return NULL;
+   return list_entry(dev-events.prev, struct inotify_kernel_event, list);
+}
+
+/*
  * inotify_dev_queue_event - event handler registered with core inotify, adds
  * a new event to the given device
  *
@@ -273,7 +286,7 @@ static void inotify_dev_queue_event(struct inotify_watch 
*w, u32 wd, u32 mask,
put_inotify_watch(w); /* final put */
 
/* coalescing: drop this event if it is a dupe of the previous */
-   last = inotify_dev_get_event(dev);
+   last = inotify_dev_get_last_event(dev);
if (last  last-event.mask == mask  last-event.wd == wd 
last-event.cookie == cookie) {
const char *lastname = last-name;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


riscom8: fix SMP brokenness

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9afa43532adf8a31b93c4c7601fda3f423d8972
Commit: d9afa43532adf8a31b93c4c7601fda3f423d8972
Parent: 1c17d18e3775485bf1e0ce79575eb637a94494a2
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:11 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

riscom8: fix SMP brokenness

After analyzing the elements that save_flags/cli/sti/restore_flags were
protecting, convert their usages to a global spinlock (the easiest and
most obvious next-step).  There were some usages of flags being
intentionally cached, because the code already knew the state of
interrupts.  These have been taken into account.

This allows us to remove CONFIG_BROKEN_ON_SMP.  Completely untested.

[EMAIL PROTECTED]: use DEFINE_SPINLOCK]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/Kconfig   |2 +-
 drivers/char/riscom8.c |  147 ++--
 2 files changed, 94 insertions(+), 55 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 4666295..eb5687b 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -276,7 +276,7 @@ config N_HDLC
 
 config RISCOM8
tristate SDL RISCom/8 card support
-   depends on SERIAL_NONSTANDARD  BROKEN_ON_SMP
+   depends on SERIAL_NONSTANDARD
help
  This is a driver for the SDL Communications RISCom/8 multiport card,
  which gives you many serial ports. You would need something like
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 102ece4..d130b87 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -47,6 +47,7 @@
 #include linux/init.h
 #include linux/delay.h
 #include linux/tty_flip.h
+#include linux/spinlock.h
 
 #include asm/uaccess.h
 
@@ -81,6 +82,8 @@
 
 static struct tty_driver *riscom_driver;
 
+static DEFINE_SPINLOCK(riscom_lock);
+
 static struct riscom_board rc_board[RC_NBOARD] =  {
{
.base   = RC_IOBASE1,
@@ -217,13 +220,14 @@ static void __init rc_init_CD180(struct riscom_board 
const * bp)
 {
unsigned long flags;

-   save_flags(flags); cli();
+   spin_lock_irqsave(riscom_lock, flags);
+
rc_out(bp, RC_CTOUT, 0);   /* Clear timeout 
*/
rc_wait_CCR(bp);   /* Wait for CCR ready
*/
rc_out(bp, CD180_CCR, CCR_HARDRESET);  /* Reset CD180 chip  
*/
-   sti();
+   spin_unlock_irqrestore(riscom_lock, flags);
msleep(50);/* Delay 0.05 sec
*/
-   cli();
+   spin_lock_irqsave(riscom_lock, flags);
rc_out(bp, CD180_GIVR, RC_ID); /* Set ID for this chip  
*/
rc_out(bp, CD180_GICR, 0); /* Clear all bits
*/
rc_out(bp, CD180_PILR1, RC_ACK_MINT);  /* Prio for modem intr   
*/
@@ -234,7 +238,7 @@ static void __init rc_init_CD180(struct riscom_board const 
* bp)
rc_out(bp, CD180_PPRH, (RC_OSCFREQ/(100/RISCOM_TPS))  8);
rc_out(bp, CD180_PPRL, (RC_OSCFREQ/(100/RISCOM_TPS))  0xff);

-   restore_flags(flags);
+   spin_unlock_irqrestore(riscom_lock, flags);
 }
 
 /* Main probing routine, also sets irq. */
@@ -812,9 +816,9 @@ static int rc_setup_port(struct riscom_board *bp, struct 
riscom_port *port)
}
port-xmit_buf = (unsigned char *) tmp;
}
-   
-   save_flags(flags); cli();
-   
+
+   spin_lock_irqsave(riscom_lock, flags);
+
if (port-tty) 
clear_bit(TTY_IO_ERROR, port-tty-flags);

@@ -825,7 +829,7 @@ static int rc_setup_port(struct riscom_board *bp, struct 
riscom_port *port)
rc_change_speed(bp, port);
port-flags |= ASYNC_INITIALIZED;

-   restore_flags(flags);
+   spin_unlock_irqrestore(riscom_lock, flags);
return 0;
 }
 
@@ -901,6 +905,7 @@ static int block_til_ready(struct tty_struct *tty, struct 
file * filp,
intretval;
intdo_clocal = 0;
intCD;
+   unsigned long flags;
 
/*
 * If the device is in the middle of being closed, then block
@@ -936,19 +941,26 @@ static int block_til_ready(struct tty_struct *tty, struct 
file * filp,
 */
retval = 0;
add_wait_queue(port-open_wait, wait);
-   cli();
+
+   spin_lock_irqsave(riscom_lock, flags);
+
if (!tty_hung_up_p(filp))
port-count--;
-   sti();
+
+   spin_unlock_irqrestore(riscom_lock, flags);
+
port-blocked_open++;
while (1) {
-   cli();
+   spin_lock_irqsave(riscom_lock, 

taskstats scaled time cleanup

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=06b8e878a9bc9301201cffe186eba99c4185f20a
Commit: 06b8e878a9bc9301201cffe186eba99c4185f20a
Parent: d9afa43532adf8a31b93c4c7601fda3f423d8972
Author: Michael Neuling [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:12 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

taskstats scaled time cleanup

This moves the ability to scale cputime into generic code.  This allows us
to fix the issue in kernel/timer.c (noticed by Balbir) where we could only
add an unscaled value to the scaled utime/stime.

This adds a cputime_to_scaled function.  As before, the POWERPC version
does the scaling based on the last SPURR/PURR ratio calculated.  The
generic and s390 (only other arch to implement asm/cputime.h) versions are
both NOPs.

Also moves the SPURR and PURR snapshots closer.

Signed-off-by: Michael Neuling [EMAIL PROTECTED]
Cc: Jay Lan [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Heiko Carstens [EMAIL PROTECTED]
Cc: Martin Schwidefsky [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/powerpc/kernel/time.c|   12 ++--
 include/asm-generic/cputime.h |1 +
 include/asm-powerpc/cputime.h |   14 ++
 include/asm-powerpc/paca.h|2 --
 include/asm-s390/cputime.h|1 +
 kernel/timer.c|   10 ++
 6 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 5cd3db5..3b26fbd 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -66,6 +66,7 @@
 #include asm/smp.h
 #include asm/vdso_datapage.h
 #include asm/firmware.h
+#include asm/cputime.h
 #ifdef CONFIG_PPC_ISERIES
 #include asm/iseries/it_lp_queue.h
 #include asm/iseries/hv_call_xm.h
@@ -189,6 +190,8 @@ u64 __cputime_sec_factor;
 EXPORT_SYMBOL(__cputime_sec_factor);
 u64 __cputime_clockt_factor;
 EXPORT_SYMBOL(__cputime_clockt_factor);
+DEFINE_PER_CPU(unsigned long, cputime_last_delta);
+DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static void calc_cputime_factors(void)
 {
@@ -257,8 +260,8 @@ void account_system_vtime(struct task_struct *tsk)
}
account_system_time(tsk, 0, delta);
account_system_time_scaled(tsk, deltascaled);
-   get_paca()-purrdelta = delta;
-   get_paca()-spurrdelta = deltascaled;
+   per_cpu(cputime_last_delta, smp_processor_id()) = delta;
+   per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled;
local_irq_restore(flags);
 }
 
@@ -276,10 +279,7 @@ void account_process_tick(struct task_struct *tsk, int 
user_tick)
get_paca()-user_time = 0;
account_user_time(tsk, utime);
 
-   /* Estimate the scaled utime by scaling the real utime based
-* on the last spurr to purr ratio */
-   utimescaled = utime * get_paca()-spurrdelta / get_paca()-purrdelta;
-   get_paca()-spurrdelta = get_paca()-purrdelta = 0;
+   utimescaled = cputime_to_scaled(utime);
account_user_time_scaled(tsk, utimescaled);
 }
 
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h
index 09204e4..1c1fa42 100644
--- a/include/asm-generic/cputime.h
+++ b/include/asm-generic/cputime.h
@@ -18,6 +18,7 @@ typedef unsigned long cputime_t;
 #define cputime_lt(__a, __b)   ((__a)   (__b))
 #define cputime_le(__a, __b)   ((__a) = (__b))
 #define cputime_to_jiffies(__ct)   (__ct)
+#define cputime_to_scaled(__ct)(__ct)
 #define jiffies_to_cputime(__hz)   (__hz)
 
 typedef u64 cputime64_t;
diff --git a/include/asm-powerpc/cputime.h b/include/asm-powerpc/cputime.h
index 3108044..f42e623 100644
--- a/include/asm-powerpc/cputime.h
+++ b/include/asm-powerpc/cputime.h
@@ -52,12 +52,26 @@ typedef u64 cputime64_t;
  * Convert cputime - jiffies
  */
 extern u64 __cputime_jiffies_factor;
+DECLARE_PER_CPU(unsigned long, cputime_last_delta);
+DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
 
 static inline unsigned long cputime_to_jiffies(const cputime_t ct)
 {
return mulhdu(ct, __cputime_jiffies_factor);
 }
 
+/* Estimate the scaled cputime by scaling the real cputime based on
+ * the last scaled to real ratio */
+static inline cputime_t cputime_to_scaled(const cputime_t ct)
+{
+   if (cpu_has_feature(CPU_FTR_SPURR) 
+   per_cpu(cputime_last_delta, smp_processor_id()))
+   return ct *
+   per_cpu(cputime_scaled_last_delta, smp_processor_id())/
+   per_cpu(cputime_last_delta, smp_processor_id());
+   return ct;
+}
+
 static inline cputime_t jiffies_to_cputime(const unsigned long jif)
 {
cputime_t ct;
diff --git a/include/asm-powerpc/paca.h 

use __set_task_state() for TRACED/STOPPED tasks

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9ae90ac4bdce769ddb27c2e24c3351a30c3daf8
Commit: d9ae90ac4bdce769ddb27c2e24c3351a30c3daf8
Parent: 06b8e878a9bc9301201cffe186eba99c4185f20a
Author: Oleg Nesterov [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:13 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

use __set_task_state() for TRACED/STOPPED tasks

1. It is much easier to grep for -state change if __set_task_state() is 
used
   instead of the direct assignment.

2. ptrace_stop() and handle_group_stop() use set_task_state() which adds the
   unneeded mb() (btw even if we use mb() it is still possible that 
do_wait()
   sees the new -state but not -exit_code, but this is ok).

Signed-off-by: Oleg Nesterov [EMAIL PROTECTED]
Acked-by: Roland McGrath [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/fork.c   |2 +-
 kernel/ptrace.c |   10 --
 kernel/signal.c |2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 2b55b74..8adfe5d 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1510,7 +1510,7 @@ long do_fork(unsigned long clone_flags,
if (!(clone_flags  CLONE_STOPPED))
wake_up_new_task(p, clone_flags);
else
-   p-state = TASK_STOPPED;
+   __set_task_state(p, TASK_STOPPED);
 
if (unlikely (trace)) {
current-ptrace_message = nr;
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index b0d4ab4..74730e0 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -53,7 +53,7 @@ void ptrace_untrace(struct task_struct *child)
spin_lock(child-sighand-siglock);
if (task_is_traced(child)) {
if (child-signal-flags  SIGNAL_STOP_STOPPED) {
-   child-state = TASK_STOPPED;
+   __set_task_state(child, TASK_STOPPED);
} else {
signal_wake_up(child, 1);
}
@@ -103,18 +103,16 @@ int ptrace_check_attach(struct task_struct *child, int 
kill)
 child-signal != NULL) {
ret = 0;
spin_lock_irq(child-sighand-siglock);
-   if (task_is_stopped(child)) {
+   if (task_is_stopped(child))
child-state = TASK_TRACED;
-   } else if (!task_is_traced(child)  !kill) {
+   else if (!task_is_traced(child)  !kill)
ret = -ESRCH;
-   }
spin_unlock_irq(child-sighand-siglock);
}
read_unlock(tasklist_lock);
 
-   if (!ret  !kill) {
+   if (!ret  !kill)
wait_task_inactive(child);
-   }
 
/* All systems go.. */
return ret;
diff --git a/kernel/signal.c b/kernel/signal.c
index 6a5f97c..e469715 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1601,7 +1601,7 @@ static void ptrace_stop(int exit_code, int nostop_code, 
siginfo_t *info)
current-exit_code = exit_code;
 
/* Let the debugger run.  */
-   set_current_state(TASK_TRACED);
+   __set_current_state(TASK_TRACED);
spin_unlock_irq(current-sighand-siglock);
try_to_freeze();
read_lock(tasklist_lock);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hash: add explicit u32 and u64 versions of hash

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e701482d1d7b90c358e2bd244bb71623f767120
Commit: 4e701482d1d7b90c358e2bd244bb71623f767120
Parent: d9ae90ac4bdce769ddb27c2e24c3351a30c3daf8
Author: Matthew Wilcox [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:14 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

hash: add explicit u32 and u64 versions of hash

The 32-bit version is more efficient (and apparently gives better hash
results than the 64-bit version), so users who are only hashing a 32-bit
quantity can now opt to use the 32-bit version explicitly, rather than
promoting to a long.

Signed-off-by: Matthew Wilcox [EMAIL PROTECTED]
Cc: William Lee Irwin III [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/hash.h |   42 +++---
 1 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/include/linux/hash.h b/include/linux/hash.h
index acf17bb..06d25c1 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -1,6 +1,6 @@
 #ifndef _LINUX_HASH_H
 #define _LINUX_HASH_H
-/* Fast hashing routine for a long.
+/* Fast hashing routine for ints,  longs and pointers.
(C) 2002 William Lee Irwin III, IBM */
 
 /*
@@ -13,23 +13,30 @@
  * them can use shifts and additions instead of multiplications for
  * machines where multiplications are slow.
  */
-#if BITS_PER_LONG == 32
+
+#include asm/types.h
+
 /* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
-#define GOLDEN_RATIO_PRIME 0x9e370001UL
-#elif BITS_PER_LONG == 64
+#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
 /*  2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
-#define GOLDEN_RATIO_PRIME 0x9e37fffc0001UL
+#define GOLDEN_RATIO_PRIME_64 0x9e37fffc0001UL
+
+#if BITS_PER_LONG == 32
+#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32
+#define hash_long(val, bits) hash_32(val, bits)
+#elif BITS_PER_LONG == 64
+#define hash_long(val, bits) hash_64(val, bits)
+#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64
 #else
-#error Define GOLDEN_RATIO_PRIME for your wordsize.
+#error Wordsize not 32 or 64
 #endif
 
-static inline unsigned long hash_long(unsigned long val, unsigned int bits)
+static inline u64 hash_64(u64 val, unsigned int bits)
 {
-   unsigned long hash = val;
+   u64 hash = val;
 
-#if BITS_PER_LONG == 64
/*  Sigh, gcc can't optimise this alone like it does for 32 bits. */
-   unsigned long n = hash;
+   u64 n = hash;
n = 18;
hash -= n;
n = 33;
@@ -42,15 +49,20 @@ static inline unsigned long hash_long(unsigned long val, 
unsigned int bits)
hash += n;
n = 2;
hash += n;
-#else
+
+   /* High bits are more random, so use them. */
+   return hash  (64 - bits);
+}
+
+static inline u32 hash_32(u32 val, unsigned int bits)
+{
/* On some cpus multiply is faster, on others gcc will do shifts */
-   hash *= GOLDEN_RATIO_PRIME;
-#endif
+   u32 hash = val * GOLDEN_RATIO_PRIME_32;
 
/* High bits are more random, so use them. */
-   return hash  (BITS_PER_LONG - bits);
+   return hash  (32 - bits);
 }
-   
+
 static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
 {
return hash_long((unsigned long)ptr, bits);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Remove inclusions of linux/autoconf.h

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=911f21501f50b16ce77f37b01e90b5b73c8c80bf
Commit: 911f21501f50b16ce77f37b01e90b5b73c8c80bf
Parent: 4e701482d1d7b90c358e2bd244bb71623f767120
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:15 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

Remove inclusions of linux/autoconf.h

Nothing should ever include this file.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
Acked-by: Mike Frysinger [EMAIL PROTECTED]
Acked-by: Bryan Wu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/m68knommu/lib/memcpy.c|1 -
 arch/mips/au1000/common/gpio.c |1 -
 drivers/char/mxser.c   |1 -
 drivers/char/mxser_new.c   |1 -
 drivers/firmware/dmi-id.c  |1 -
 drivers/misc/asus-laptop.c |1 -
 drivers/misc/fujitsu-laptop.c  |1 -
 drivers/misc/msi-laptop.c  |1 -
 drivers/spi/spi.c  |1 -
 9 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/arch/m68knommu/lib/memcpy.c b/arch/m68knommu/lib/memcpy.c
index 0d55775..b50dbca 100644
--- a/arch/m68knommu/lib/memcpy.c
+++ b/arch/m68knommu/lib/memcpy.c
@@ -1,6 +1,5 @@
 
 #include linux/types.h
-#include linux/autoconf.h
 
 void * memcpy(void * to, const void * from, size_t n)
 {
diff --git a/arch/mips/au1000/common/gpio.c b/arch/mips/au1000/common/gpio.c
index 8527856..0b658f1 100644
--- a/arch/mips/au1000/common/gpio.c
+++ b/arch/mips/au1000/common/gpio.c
@@ -27,7 +27,6 @@
  * others have a second one : GPIO2
  */
 
-#include linux/autoconf.h
 #include linux/init.h
 #include linux/io.h
 #include linux/types.h
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index fd0abef..4742078 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -37,7 +37,6 @@
 
 
 #include linux/module.h
-#include linux/autoconf.h
 #include linux/errno.h
 #include linux/signal.h
 #include linux/sched.h
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 081c84c..bf1bee4 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -20,7 +20,6 @@
  */
 
 #include linux/module.h
-#include linux/autoconf.h
 #include linux/errno.h
 #include linux/signal.h
 #include linux/sched.h
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c
index 313c99c..e880d6c 100644
--- a/drivers/firmware/dmi-id.c
+++ b/drivers/firmware/dmi-id.c
@@ -11,7 +11,6 @@
 #include linux/init.h
 #include linux/dmi.h
 #include linux/device.h
-#include linux/autoconf.h
 
 struct dmi_device_attribute{
struct device_attribute dev_attr;
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index 7dce318..0846c33 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -33,7 +33,6 @@
  *  Sam Lin- GPS support
  */
 
-#include linux/autoconf.h
 #include linux/kernel.h
 #include linux/module.h
 #include linux/init.h
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c
index c8d62c2..1cfd7f3 100644
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -50,7 +50,6 @@
 #include linux/dmi.h
 #include linux/backlight.h
 #include linux/platform_device.h
-#include linux/autoconf.h
 
 #define FUJITSU_DRIVER_VERSION 0.3
 
diff --git a/drivers/misc/msi-laptop.c b/drivers/misc/msi-laptop.c
index 83679c7..de898c6 100644
--- a/drivers/misc/msi-laptop.c
+++ b/drivers/misc/msi-laptop.c
@@ -58,7 +58,6 @@
 #include linux/dmi.h
 #include linux/backlight.h
 #include linux/platform_device.h
-#include linux/autoconf.h
 
 #define MSI_DRIVER_VERSION 0.5
 
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 682a6a4..5e5d29b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -18,7 +18,6 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include linux/autoconf.h
 #include linux/kernel.h
 #include linux/device.h
 #include linux/init.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sound/oss/pss: set_io_base() always returns success, mark it void

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ffce7a829d913f40678e0ccf2d87a8c2050261a0
Commit: ffce7a829d913f40678e0ccf2d87a8c2050261a0
Parent: 911f21501f50b16ce77f37b01e90b5b73c8c80bf
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:15 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

sound/oss/pss: set_io_base() always returns success, mark it void

[EMAIL PROTECTED]: coding-style fixes]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 sound/oss/pss.c |   30 +++---
 1 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index ece428b..16ed069 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -232,14 +232,12 @@ static int set_irq(pss_confdata * devc, int dev, int irq)
return 1;
 }
 
-static int set_io_base(pss_confdata * devc, int dev, int base)
+static void set_io_base(pss_confdata * devc, int dev, int base)
 {
unsigned short  tmp = inw(REG(dev))  0x003f;
unsigned short  bits = (base  0x0ffc)  4;
 
outw(bits | tmp, REG(dev));
-
-   return 1;
 }
 
 static int set_dma(pss_confdata * devc, int dev, int dma)
@@ -673,20 +671,12 @@ static void configure_nonsound_components(void)
 
/* Configure CDROM port */
 
-   if(pss_cdrom_port == -1)/* If cdrom port enablation wasn't 
requested */
-   {
+   if (pss_cdrom_port == -1) { /* If cdrom port enablation wasn't 
requested */
printk(KERN_INFO PSS: CDROM port not enabled.\n);
-   }
-   else if(check_region(pss_cdrom_port, 2))
-   {
+   } else if (check_region(pss_cdrom_port, 2)) {
printk(KERN_ERR PSS: CDROM I/O port conflict.\n);
-   }
-   else if(!set_io_base(devc, CONF_CDROM, pss_cdrom_port))
-   {
-   printk(KERN_ERR PSS: CDROM I/O port could not be set.\n);
-   }
-   else/* CDROM port successfully 
configured */
-   {
+   } else {
+   set_io_base(devc, CONF_CDROM, pss_cdrom_port);
printk(KERN_INFO PSS: CDROM I/O port set to 0x%x.\n, 
pss_cdrom_port);
}
 }
@@ -758,10 +748,7 @@ static int __init probe_pss_mpu(struct address_info 
*hw_config)
printk(KERN_ERR PSS: MPU I/O port conflict\n);
return 0;
}
-   if (!set_io_base(devc, CONF_MIDI, hw_config-io_base)) {
-   printk(KERN_ERR PSS: MIDI base could not be set.\n);
-   goto fail;
-   }
+   set_io_base(devc, CONF_MIDI, hw_config-io_base);
if (!set_irq(devc, CONF_MIDI, hw_config-irq)) {
printk(KERN_ERR PSS: MIDI IRQ allocation error.\n);
goto fail;
@@ -1057,10 +1044,7 @@ static int __init probe_pss_mss(struct address_info 
*hw_config)
release_region(hw_config-io_base, 4);
return 0;
}
-   if (!set_io_base(devc, CONF_WSS, hw_config-io_base)) {
-   printk(PSS: WSS base not settable.\n);
-   goto fail;
-   }
+   set_io_base(devc, CONF_WSS, hw_config-io_base);
if (!set_irq(devc, CONF_WSS, hw_config-irq)) {
printk(PSS: WSS IRQ allocation error.\n);
goto fail;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sound/oss/sb_common.c: fix casting warning

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73de76a0a42efa173c29aff32e555ac6de992573
Commit: 73de76a0a42efa173c29aff32e555ac6de992573
Parent: ffce7a829d913f40678e0ccf2d87a8c2050261a0
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:16 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

sound/oss/sb_common.c: fix casting warning

sound/oss/sb_common.c: In function 'probe_sbmpu':
sound/oss/sb_common.c:1231: warning: cast to pointer from integer of 
different size

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 sound/oss/sb_common.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c
index 07cbacf..77d0e5e 100644
--- a/sound/oss/sb_common.c
+++ b/sound/oss/sb_common.c
@@ -1228,7 +1228,8 @@ int probe_sbmpu(struct address_info *hw_config, struct 
module *owner)
}
attach_mpu401(hw_config, owner);
if (last_sb-irq == -hw_config-irq)
-   last_sb-midi_irq_cookie=(void *)hw_config-slots[1];
+   last_sb-midi_irq_cookie =
+   (void *)(long) hw_config-slots[1];
return 1;
}
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext2: return after ext2_error in case of failures

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f0adaecede9ca68d9fcddae5a5a7ed6fc31a5e5
Commit: 7f0adaecede9ca68d9fcddae5a5a7ed6fc31a5e5
Parent: 73de76a0a42efa173c29aff32e555ac6de992573
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:17 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

ext2: return after ext2_error in case of failures

This fixes some instances where we were continuing after calling
ext2_error.  ext2_error call panic only if errors=panic mount option is
set.  So we need to make sure we return correctly after ext2_error call.

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ext2/balloc.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 377ad17..794008b 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -474,11 +474,13 @@ do_more:
in_range (block, le32_to_cpu(desc-bg_inode_table),
  sbi-s_itb_per_group) ||
in_range (block + count - 1, le32_to_cpu(desc-bg_inode_table),
- sbi-s_itb_per_group))
+ sbi-s_itb_per_group)) {
ext2_error (sb, ext2_free_blocks,
Freeing blocks in system zones - 
Block = %lu, count = %lu,
block, count);
+   goto error_return;
+   }
 
for (i = 0, group_freed = 0; i  count; i++) {
if (!ext2_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
@@ -1311,11 +1313,13 @@ allocated:
in_range(ret_block, le32_to_cpu(gdp-bg_inode_table),
  EXT2_SB(sb)-s_itb_per_group) ||
in_range(ret_block + num - 1, le32_to_cpu(gdp-bg_inode_table),
- EXT2_SB(sb)-s_itb_per_group))
+ EXT2_SB(sb)-s_itb_per_group)) {
ext2_error(sb, ext2_new_blocks,
Allocating block in system zone - 
blocks from E2FSBLK, length %lu,
ret_block, num);
+   goto out;
+   }
 
performed_allocation = 1;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext2: change the default behaviour on error

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14e11e106bf90c52c69373ac6abd3a494918808f
Commit: 14e11e106bf90c52c69373ac6abd3a494918808f
Parent: 7f0adaecede9ca68d9fcddae5a5a7ed6fc31a5e5
Author: Aneesh Kumar K.V [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:17 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

ext2: change the default behaviour on error

ext2 file system was by default ignoring errors and continuing.  This is
not a good default as continuing on error could lead to file system
corruption.  Change the default to mark the file system readonly.  Debian
and ubuntu already does this as the default in their fstab.

Signed-off-by: Aneesh Kumar K.V [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Cc: Eric Sandeen [EMAIL PROTECTED]
Cc: Jan Kara [EMAIL PROTECTED]
Cc: Dave Jones [EMAIL PROTECTED]
Cc: Chuck Ebbert [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ext2/super.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 6abaf75..0ff8913 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -234,16 +234,16 @@ static int ext2_show_options(struct seq_file *seq, struct 
vfsmount *vfs)
le16_to_cpu(es-s_def_resgid) != EXT2_DEF_RESGID) {
seq_printf(seq, ,resgid=%u, sbi-s_resgid);
}
-   if (test_opt(sb, ERRORS_CONT)) {
+   if (test_opt(sb, ERRORS_RO)) {
int def_errors = le16_to_cpu(es-s_errors);
 
if (def_errors == EXT2_ERRORS_PANIC ||
-   def_errors == EXT2_ERRORS_RO) {
-   seq_puts(seq, ,errors=continue);
+   def_errors == EXT2_ERRORS_CONTINUE) {
+   seq_puts(seq, ,errors=remount-ro);
}
}
-   if (test_opt(sb, ERRORS_RO))
-   seq_puts(seq, ,errors=remount-ro);
+   if (test_opt(sb, ERRORS_CONT))
+   seq_puts(seq, ,errors=continue);
if (test_opt(sb, ERRORS_PANIC))
seq_puts(seq, ,errors=panic);
if (test_opt(sb, NO_UID32))
@@ -820,10 +820,10 @@ static int ext2_fill_super(struct super_block *sb, void 
*data, int silent)

if (le16_to_cpu(sbi-s_es-s_errors) == EXT2_ERRORS_PANIC)
set_opt(sbi-s_mount_opt, ERRORS_PANIC);
-   else if (le16_to_cpu(sbi-s_es-s_errors) == EXT2_ERRORS_RO)
-   set_opt(sbi-s_mount_opt, ERRORS_RO);
-   else
+   else if (le16_to_cpu(sbi-s_es-s_errors) == EXT2_ERRORS_CONTINUE)
set_opt(sbi-s_mount_opt, ERRORS_CONT);
+   else
+   set_opt(sbi-s_mount_opt, ERRORS_RO);
 
sbi-s_resuid = le16_to_cpu(es-s_def_resuid);
sbi-s_resgid = le16_to_cpu(es-s_def_resgid);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SIGIO-driven I/O with inotify queues

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bcfbf84d4067674b0740a39605f8057622ad5230
Commit: bcfbf84d4067674b0740a39605f8057622ad5230
Parent: 14e11e106bf90c52c69373ac6abd3a494918808f
Author: Dmitry Antipov [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:19 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:00 2008 -0800

SIGIO-driven I/O with inotify queues

Add SIGIO-driven I/O for descriptors returned by inotify_init().  The thing
may be enabled by convenient fcntl (fd, F_SETFL, O_ASYNC) call.

Signed-off-by: Dmitry Antipov [EMAIL PROTECTED]
Cc: Robert Love [EMAIL PROTECTED]
Cc: John McCutchan [EMAIL PROTECTED]
Cc: Michael Kerrisk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/inotify_user.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/fs/inotify_user.c b/fs/inotify_user.c
index c509a81..a336c97 100644
--- a/fs/inotify_user.c
+++ b/fs/inotify_user.c
@@ -79,6 +79,7 @@ struct inotify_device {
atomic_tcount;  /* reference count */
struct user_struct  *user;  /* user who opened this dev */
struct inotify_handle   *ih;/* inotify handle */
+   struct fasync_struct*fa;/* async notification */
unsigned intqueue_size; /* size of the queue (bytes) */
unsigned intevent_count;/* number of pending events */
unsigned intmax_events; /* maximum number of events */
@@ -315,6 +316,7 @@ static void inotify_dev_queue_event(struct inotify_watch 
*w, u32 wd, u32 mask,
dev-queue_size += sizeof(struct inotify_event) + kevent-event.len;
list_add_tail(kevent-list, dev-events);
wake_up_interruptible(dev-wq);
+   kill_fasync(dev-fa, SIGIO, POLL_IN);
 
 out:
mutex_unlock(dev-ev_mutex);
@@ -503,6 +505,13 @@ static ssize_t inotify_read(struct file *file, char __user 
*buf,
return ret;
 }
 
+static int inotify_fasync(int fd, struct file *file, int on)
+{
+   struct inotify_device *dev = file-private_data;
+
+   return fasync_helper(fd, file, on, dev-fa) = 0 ? 0 : -EIO;
+}
+
 static int inotify_release(struct inode *ignored, struct file *file)
 {
struct inotify_device *dev = file-private_data;
@@ -515,6 +524,9 @@ static int inotify_release(struct inode *ignored, struct 
file *file)
inotify_dev_event_dequeue(dev);
mutex_unlock(dev-ev_mutex);
 
+   if (file-f_flags  FASYNC)
+   inotify_fasync(-1, file, 0);
+
/* free this device: the put matching the get in inotify_init() */
put_inotify_dev(dev);
 
@@ -543,6 +555,7 @@ static long inotify_ioctl(struct file *file, unsigned int 
cmd,
 static const struct file_operations inotify_fops = {
.poll   = inotify_poll,
.read   = inotify_read,
+   .fasync = inotify_fasync,
.release= inotify_release,
.unlocked_ioctl = inotify_ioctl,
.compat_ioctl   = inotify_ioctl,
@@ -590,6 +603,7 @@ asmlinkage long sys_inotify_init(void)
goto out_free_dev;
}
dev-ih = ih;
+   dev-fa = NULL;
 
filp-f_op = inotify_fops;
filp-f_path.mnt = mntget(inotify_mnt);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Remove pointless casts from void pointers

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15aafa2f9d8399b22e418c53a87dfc0c43f4030f
Commit: 15aafa2f9d8399b22e418c53a87dfc0c43f4030f
Parent: bcfbf84d4067674b0740a39605f8057622ad5230
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:20 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

Remove pointless casts from void pointers

Mostly in and around irq handlers.

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Cc: Russell King [EMAIL PROTECTED]
Cc: Luck Tony [EMAIL PROTECTED]
Cc: Roman Zippel [EMAIL PROTECTED]
Cc: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Acked-by: Dmitry Torokhov [EMAIL PROTECTED]
Cc: Karsten Keil [EMAIL PROTECTED]
Acked-by: John W. Linville [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Cc: David Brownell [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Acked-by: Josh Boyer [EMAIL PROTECTED]
Acked-by: Holger Schurig [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/ia64/sn/pci/pcibr/pcibr_provider.c|6 +++---
 arch/m68k/amiga/cia.c  |2 +-
 arch/ppc/8260_io/enet.c|2 +-
 arch/ppc/8260_io/fcc_enet.c|2 +-
 drivers/input/touchscreen/h3600_ts_input.c |4 ++--
 drivers/isdn/hardware/eicon/diva.c |5 ++---
 drivers/scsi/aic7xxx_old.c |2 +-
 drivers/scsi/ibmvscsi/ibmvstgt.c   |4 ++--
 drivers/serial/cpm_uart/cpm_uart_core.c|2 +-
 drivers/serial/dz.c|2 +-
 drivers/serial/imx.c   |4 ++--
 drivers/serial/uartlite.c  |2 +-
 drivers/spi/spi_bfin5xx.c  |2 +-
 drivers/video/bf54x-lq043fb.c  |3 +--
 drivers/video/intelfb/intelfbhw.c  |2 +-
 15 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c 
b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index ab3eaf8..2c676cc 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -100,11 +100,11 @@ u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus)
 static irqreturn_t
 pcibr_error_intr_handler(int irq, void *arg)
 {
-   struct pcibus_info *soft = (struct pcibus_info *)arg;
+   struct pcibus_info *soft = arg;
 
-   if (sal_pcibr_error_interrupt(soft)  0) {
+   if (sal_pcibr_error_interrupt(soft)  0)
panic(pcibr_error_intr_handler(): Fatal Bridge Error);
-   }
+
return IRQ_HANDLED;
 }
 
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c
index c4a4ffd..343fab4 100644
--- a/arch/m68k/amiga/cia.c
+++ b/arch/m68k/amiga/cia.c
@@ -84,7 +84,7 @@ unsigned char cia_able_irq(struct ciabase *base, unsigned 
char mask)
 
 static irqreturn_t cia_handler(int irq, void *dev_id)
 {
-   struct ciabase *base = (struct ciabase *)dev_id;
+   struct ciabase *base = dev_id;
int mach_irq;
unsigned char ints;
 
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
index 25ef55b..ec1defe 100644
--- a/arch/ppc/8260_io/enet.c
+++ b/arch/ppc/8260_io/enet.c
@@ -418,7 +418,7 @@ scc_enet_rx(struct net_device *dev)
struct  sk_buff *skb;
ushort  pkt_len;
 
-   cep = (struct scc_enet_private *)dev-priv;
+   cep = dev-priv;
 
/* First, grab all of the stats for the incoming packet.
 * These get messed up if we get called due to a busy condition.
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c
index a3a27da..bcc3aa9 100644
--- a/arch/ppc/8260_io/fcc_enet.c
+++ b/arch/ppc/8260_io/fcc_enet.c
@@ -682,7 +682,7 @@ fcc_enet_rx(struct net_device *dev)
struct  sk_buff *skb;
ushort  pkt_len;
 
-   cep = (struct fcc_enet_private *)dev-priv;
+   cep = dev-priv;
 
/* First, grab all of the stats for the incoming packet.
 * These get messed up if we get called due to a busy condition.
diff --git a/drivers/input/touchscreen/h3600_ts_input.c 
b/drivers/input/touchscreen/h3600_ts_input.c
index 2ae6c60..28ae15e 100644
--- a/drivers/input/touchscreen/h3600_ts_input.c
+++ b/drivers/input/touchscreen/h3600_ts_input.c
@@ -109,7 +109,7 @@ struct h3600_dev {
 static irqreturn_t action_button_handler(int irq, void *dev_id)
 {
int down = (GPLR  GPIO_BITSY_ACTION_BUTTON) ? 0 : 1;
-   struct input_dev *dev = (struct input_dev *) dev_id;
+   struct input_dev *dev = dev_id;
 
input_report_key(dev, KEY_ENTER, down);
input_sync(dev);
@@ -120,7 +120,7 @@ static irqreturn_t action_button_handler(int irq, void 
*dev_id)
 static irqreturn_t npower_button_handler(int irq, void *dev_id)
 {
int down = (GPLR  

IPC: fix error check in all new xxx_lock() and xxx_exit_ns() functions

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b1ed88b47f5e18c6efb8041275c16eeead5377df
Commit: b1ed88b47f5e18c6efb8041275c16eeead5377df
Parent: 15aafa2f9d8399b22e418c53a87dfc0c43f4030f
Author: Pierre Peiffer [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:23 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

IPC: fix error check in all new xxx_lock() and xxx_exit_ns() functions

In the new implementation of the [sem|shm|msg]_lock[_check]() routines, we
use the return value of ipc_lock() in container_of() without any check.
But ipc_lock may return a errcode.  The use of this errcode in
container_of() may alter this errcode, and we don't want this.

And in xxx_exit_ns, the pointer return by idr_find is of type 'struct
kern_ipc_per'...

Today, the code will work as is because the member used in these
container_of() is the first member of its container (offset == 0), the
errcode isn't changed then.  But in the general case, we can't count on
this assumption and this may lead later to a real bug if we don't correct
this.

Again, the proposed solution is simple and correct.  But, as pointed by
Nadia, with this solution, the same check will be done several times (in
all sub-callers...), what is not very funny/optimal...

Signed-off-by: Pierre Peiffer [EMAIL PROTECTED]
Cc: Nadia Derbey [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 ipc/msg.c |   17 ++---
 ipc/sem.c |   17 ++---
 ipc/shm.c |   20 +---
 3 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index fdf3db5..ec0c724 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -105,6 +105,7 @@ int msg_init_ns(struct ipc_namespace *ns)
 void msg_exit_ns(struct ipc_namespace *ns)
 {
struct msg_queue *msq;
+   struct kern_ipc_perm *perm;
int next_id;
int total, in_use;
 
@@ -113,10 +114,11 @@ void msg_exit_ns(struct ipc_namespace *ns)
in_use = msg_ids(ns).in_use;
 
for (total = 0, next_id = 0; total  in_use; next_id++) {
-   msq = idr_find(msg_ids(ns).ipcs_idr, next_id);
-   if (msq == NULL)
+   perm = idr_find(msg_ids(ns).ipcs_idr, next_id);
+   if (perm == NULL)
continue;
-   ipc_lock_by_ptr(msq-q_perm);
+   ipc_lock_by_ptr(perm);
+   msq = container_of(perm, struct msg_queue, q_perm);
freeque(ns, msq);
total++;
}
@@ -144,6 +146,9 @@ static inline struct msg_queue *msg_lock_check_down(struct 
ipc_namespace *ns,
 {
struct kern_ipc_perm *ipcp = ipc_lock_check_down(msg_ids(ns), id);
 
+   if (IS_ERR(ipcp))
+   return (struct msg_queue *)ipcp;
+
return container_of(ipcp, struct msg_queue, q_perm);
 }
 
@@ -155,6 +160,9 @@ static inline struct msg_queue *msg_lock(struct 
ipc_namespace *ns, int id)
 {
struct kern_ipc_perm *ipcp = ipc_lock(msg_ids(ns), id);
 
+   if (IS_ERR(ipcp))
+   return (struct msg_queue *)ipcp;
+
return container_of(ipcp, struct msg_queue, q_perm);
 }
 
@@ -163,6 +171,9 @@ static inline struct msg_queue *msg_lock_check(struct 
ipc_namespace *ns,
 {
struct kern_ipc_perm *ipcp = ipc_lock_check(msg_ids(ns), id);
 
+   if (IS_ERR(ipcp))
+   return (struct msg_queue *)ipcp;
+
return container_of(ipcp, struct msg_queue, q_perm);
 }
 
diff --git a/ipc/sem.c b/ipc/sem.c
index 35952c0..d65e285 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -143,6 +143,7 @@ int sem_init_ns(struct ipc_namespace *ns)
 void sem_exit_ns(struct ipc_namespace *ns)
 {
struct sem_array *sma;
+   struct kern_ipc_perm *perm;
int next_id;
int total, in_use;
 
@@ -151,10 +152,11 @@ void sem_exit_ns(struct ipc_namespace *ns)
in_use = sem_ids(ns).in_use;
 
for (total = 0, next_id = 0; total  in_use; next_id++) {
-   sma = idr_find(sem_ids(ns).ipcs_idr, next_id);
-   if (sma == NULL)
+   perm = idr_find(sem_ids(ns).ipcs_idr, next_id);
+   if (perm == NULL)
continue;
-   ipc_lock_by_ptr(sma-sem_perm);
+   ipc_lock_by_ptr(perm);
+   sma = container_of(perm, struct sem_array, sem_perm);
freeary(ns, sma);
total++;
}
@@ -181,6 +183,9 @@ static inline struct sem_array *sem_lock_check_down(struct 
ipc_namespace *ns,
 {
struct kern_ipc_perm *ipcp = ipc_lock_check_down(sem_ids(ns), id);
 
+   if (IS_ERR(ipcp))
+   return (struct sem_array *)ipcp;
+
return container_of(ipcp, struct sem_array, sem_perm);
 }
 
@@ -192,6 +197,9 @@ static inline struct sem_array 

Genericizing iova.[ch]

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f661197e0a95ec7305e1e790d95b72a74a1c4a0f
Commit: f661197e0a95ec7305e1e790d95b72a74a1c4a0f
Parent: b1ed88b47f5e18c6efb8041275c16eeead5377df
Author: David Miller [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:23 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

Genericizing iova.[ch]

I would like to potentially move the sparc64 IOMMU code over to using
the nice new drivers/pci/iova.[ch] code for free area management..

In order to do that we have to detach the IOMMU page size assumptions
which only really need to exist in the intel-iommu.[ch] code.

This patch attempts to implement that.

[EMAIL PROTECTED]: build fix]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
Acked-by: Anil S Keshavamurthy [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/pci/dmar.c|1 +
 drivers/pci/intel-iommu.c |4 ++--
 drivers/pci/intel-iommu.h |   14 ++
 drivers/pci/iova.c|8 
 drivers/pci/iova.h|   16 ++--
 5 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 91b2dc9..8ed2648 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -26,6 +26,7 @@
 #include linux/pci.h
 #include linux/dmar.h
 #include iova.h
+#include intel-iommu.h
 
 #undef PREFIX
 #define PREFIX DMAR:
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 4e01df9..31fa6c9 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -1088,7 +1088,7 @@ static void dmar_init_reserved_ranges(void)
int i;
u64 addr, size;
 
-   init_iova_domain(reserved_iova_list);
+   init_iova_domain(reserved_iova_list, DMA_32BIT_PFN);
 
/* IOAPIC ranges shouldn't be accessed by DMA */
iova = reserve_iova(reserved_iova_list, IOVA_PFN(IOAPIC_RANGE_START),
@@ -1142,7 +1142,7 @@ static int domain_init(struct dmar_domain *domain, int 
guest_width)
int adjust_width, agaw;
unsigned long sagaw;
 
-   init_iova_domain(domain-iovad);
+   init_iova_domain(domain-iovad, DMA_32BIT_PFN);
spin_lock_init(domain-mapping_lock);
 
domain_reserve_special_ranges(domain);
diff --git a/drivers/pci/intel-iommu.h b/drivers/pci/intel-iommu.h
index 459ad1f..0e48626 100644
--- a/drivers/pci/intel-iommu.h
+++ b/drivers/pci/intel-iommu.h
@@ -23,10 +23,24 @@
 
 #include linux/types.h
 #include linux/msi.h
+#include linux/sysdev.h
 #include iova.h
 #include linux/io.h
 
 /*
+ * We need a fixed PAGE_SIZE of 4K irrespective of
+ * arch PAGE_SIZE for IOMMU page tables.
+ */
+#define PAGE_SHIFT_4K  (12)
+#define PAGE_SIZE_4K   (1UL  PAGE_SHIFT_4K)
+#define PAGE_MASK_4K   (((u64)-1)  PAGE_SHIFT_4K)
+#define PAGE_ALIGN_4K(addr)(((addr) + PAGE_SIZE_4K - 1)  PAGE_MASK_4K)
+
+#define IOVA_PFN(addr) ((addr)  PAGE_SHIFT_4K)
+#define DMA_32BIT_PFN  IOVA_PFN(DMA_32BIT_MASK)
+#define DMA_64BIT_PFN  IOVA_PFN(DMA_64BIT_MASK)
+
+/*
  * Intel IOMMU register specification per version 1.0 public spec.
  */
 
diff --git a/drivers/pci/iova.c b/drivers/pci/iova.c
index a84571c..8de7ab6 100644
--- a/drivers/pci/iova.c
+++ b/drivers/pci/iova.c
@@ -9,19 +9,19 @@
 #include iova.h
 
 void
-init_iova_domain(struct iova_domain *iovad)
+init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit)
 {
spin_lock_init(iovad-iova_alloc_lock);
spin_lock_init(iovad-iova_rbtree_lock);
iovad-rbroot = RB_ROOT;
iovad-cached32_node = NULL;
-
+   iovad-dma_32bit_pfn = pfn_32bit;
 }
 
 static struct rb_node *
 __get_cached_rbnode(struct iova_domain *iovad, unsigned long *limit_pfn)
 {
-   if ((*limit_pfn != DMA_32BIT_PFN) ||
+   if ((*limit_pfn != iovad-dma_32bit_pfn) ||
(iovad-cached32_node == NULL))
return rb_last(iovad-rbroot);
else {
@@ -37,7 +37,7 @@ static void
 __cached_rbnode_insert_update(struct iova_domain *iovad,
unsigned long limit_pfn, struct iova *new)
 {
-   if (limit_pfn != DMA_32BIT_PFN)
+   if (limit_pfn != iovad-dma_32bit_pfn)
return;
iovad-cached32_node = new-node;
 }
diff --git a/drivers/pci/iova.h b/drivers/pci/iova.h
index ae3028d..d521b5b 100644
--- a/drivers/pci/iova.h
+++ b/drivers/pci/iova.h
@@ -15,22 +15,9 @@
 #include linux/rbtree.h
 #include linux/dma-mapping.h
 
-/*
- * We need a fixed PAGE_SIZE of 4K irrespective of
- * arch PAGE_SIZE for IOMMU page tables.
- */
-#define PAGE_SHIFT_4K  (12)
-#define PAGE_SIZE_4K   (1UL  PAGE_SHIFT_4K)
-#define PAGE_MASK_4K   (((u64)-1)  PAGE_SHIFT_4K)
-#define PAGE_ALIGN_4K(addr)(((addr) + PAGE_SIZE_4K - 1)  PAGE_MASK_4K)
-
 /* IO virtual address start page frame 

dcdbas: add DMI-based module autloading

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f47f0b688bba7642dac4e979896e4692177670b
Commit: 8f47f0b688bba7642dac4e979896e4692177670b
Parent: f661197e0a95ec7305e1e790d95b72a74a1c4a0f
Author: Matt Domsch [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:24 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

dcdbas: add DMI-based module autloading

DMI autoload dcdbas on all Dell systems.

This looks for BIOS Vendor or System Vendor == Dell, so this should
work for systems both Dell-branded and those Dell builds but brands
for others.  It causes udev to load the dcdbas module at startup,
which is used by tools called by HAL for wireless control and
backlight control, among other uses.

Thanks to Kay Sievers for figuring out how to do this with a single alias.

Signed-off-by: Matt Domsch [EMAIL PROTECTED]
Cc: Kay Sievers [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/firmware/dcdbas.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c
index 18cdcb3..1636806 100644
--- a/drivers/firmware/dcdbas.c
+++ b/drivers/firmware/dcdbas.c
@@ -658,4 +658,5 @@ MODULE_DESCRIPTION(DRIVER_DESCRIPTION  (version  
DRIVER_VERSION ));
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_AUTHOR(Dell Inc.);
 MODULE_LICENSE(GPL);
-
+/* Any System or BIOS claiming to be by Dell */
+MODULE_ALIAS(dmi:*:[bs]vnD[Ee][Ll][Ll]*:*);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Parallel port: convert port_mutex to the mutex API

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0a5dcb51770be3cd0202d6b90a07996fb40130b6
Commit: 0a5dcb51770be3cd0202d6b90a07996fb40130b6
Parent: 8f47f0b688bba7642dac4e979896e4692177670b
Author: Matthias Kaehlcke [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:25 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

Parallel port: convert port_mutex to the mutex API

Parallel port: Convert port_mutex to the mutex API

[EMAIL PROTECTED]: coding-style fixes]
Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/lp.c  |   10 +-
 include/linux/lp.h |4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 81674d7..60ac642 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -312,7 +312,7 @@ static ssize_t lp_write(struct file * file, const char 
__user * buf,
if (copy_size  LP_BUFFER_SIZE)
copy_size = LP_BUFFER_SIZE;
 
-   if (down_interruptible (lp_table[minor].port_mutex))
+   if (mutex_lock_interruptible(lp_table[minor].port_mutex))
return -EINTR;
 
if (copy_from_user (kbuf, buf, copy_size)) {
@@ -399,7 +399,7 @@ static ssize_t lp_write(struct file * file, const char 
__user * buf,
lp_release_parport (lp_table[minor]);
}
 out_unlock:
-   up (lp_table[minor].port_mutex);
+   mutex_unlock(lp_table[minor].port_mutex);
 
return retv;
 }
@@ -421,7 +421,7 @@ static ssize_t lp_read(struct file * file, char __user * 
buf,
if (count  LP_BUFFER_SIZE)
count = LP_BUFFER_SIZE;
 
-   if (down_interruptible (lp_table[minor].port_mutex))
+   if (mutex_lock_interruptible(lp_table[minor].port_mutex))
return -EINTR;
 
lp_claim_parport_or_block (lp_table[minor]);
@@ -479,7 +479,7 @@ static ssize_t lp_read(struct file * file, char __user * 
buf,
if (retval  0  copy_to_user (buf, kbuf, retval))
retval = -EFAULT;
 
-   up (lp_table[minor].port_mutex);
+   mutex_unlock(lp_table[minor].port_mutex);
 
return retval;
 }
@@ -888,7 +888,7 @@ static int __init lp_init (void)
lp_table[i].last_error = 0;
init_waitqueue_head (lp_table[i].waitq);
init_waitqueue_head (lp_table[i].dataq);
-   init_MUTEX (lp_table[i].port_mutex);
+   mutex_init(lp_table[i].port_mutex);
lp_table[i].timeout = 10 * HZ;
}
 
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 7059b6b..0df024b 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -99,7 +99,7 @@
 #ifdef __KERNEL__
 
 #include linux/wait.h
-#include asm/semaphore.h
+#include linux/mutex.h
 
 /* Magic numbers for defining port-device mappings */
 #define LP_PARPORT_UNSPEC -4
@@ -145,7 +145,7 @@ struct lp_struct {
 #endif
wait_queue_head_t waitq;
unsigned int last_error;
-   struct semaphore port_mutex;
+   struct mutex port_mutex;
wait_queue_head_t dataq;
long timeout;
unsigned int best_mode;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


remove support for un-needed _extratext section

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a3b81113fb6658629f4ebaabf8dd3067cd341020
Commit: a3b81113fb6658629f4ebaabf8dd3067cd341020
Parent: 0a5dcb51770be3cd0202d6b90a07996fb40130b6
Author: Robin Getz [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:26 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

remove support for un-needed _extratext section

When passing a zero address to kallsyms_lookup(), the kernel thought it was
a valid kernel address, even if it is not.  This is because is_ksym_addr()
called is_kernel_extratext() and checked against labels that don't exist on
many archs (which default as zero).  Since PPC was the only kernel which
defines _extra_text, (in 2005), and no longer needs it, this patch removes
_extra_text support.

For some history (provided by Jon):
 http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019734.html
 http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019736.html
 http://ozlabs.org/pipermail/linuxppc-dev/2005-September/019751.html

[EMAIL PROTECTED]: coding-style fixes]
Signed-off-by: Robin Getz [EMAIL PROTECTED]
Cc: David Woodhouse [EMAIL PROTECTED]
Cc: Jon Loeliger [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/ppc/kernel/vmlinux.lds.S  |5 -
 include/asm-generic/sections.h |2 --
 kernel/kallsyms.c  |   11 +--
 scripts/kallsyms.c |   24 ++--
 4 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index 52b64fc..8a24bc4 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -143,11 +143,6 @@ SECTIONS
 
   . = ALIGN(4096);
   __init_end = .;
-
-  . = ALIGN(4096);
-  _sextratext = .;
-  _eextratext = .;
-
   __bss_start = .;
   .bss   :
   {
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 962cad7..8feeae1 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -8,8 +8,6 @@ extern char _data[], _sdata[], _edata[];
 extern char __bss_start[], __bss_stop[];
 extern char __init_begin[], __init_end[];
 extern char _sinittext[], _einittext[];
-extern char _sextratext[] __attribute__((weak));
-extern char _eextratext[] __attribute__((weak));
 extern char _end[];
 extern char __per_cpu_start[], __per_cpu_end[];
 extern char __kprobes_text_start[], __kprobes_text_end[];
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 7dadc71..f091d13 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -53,14 +53,6 @@ static inline int is_kernel_inittext(unsigned long addr)
return 0;
 }
 
-static inline int is_kernel_extratext(unsigned long addr)
-{
-   if (addr = (unsigned long)_sextratext
-addr = (unsigned long)_eextratext)
-   return 1;
-   return 0;
-}
-
 static inline int is_kernel_text(unsigned long addr)
 {
if (addr = (unsigned long)_stext  addr = (unsigned long)_etext)
@@ -80,8 +72,7 @@ static int is_ksym_addr(unsigned long addr)
if (all_var)
return is_kernel(addr);
 
-   return is_kernel_text(addr) || is_kernel_inittext(addr) ||
-   is_kernel_extratext(addr);
+   return is_kernel_text(addr) || is_kernel_inittext(addr);
 }
 
 /* expand a compressed symbol data into the resulting uncompressed string,
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 1f11d84..8fb8700 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -41,7 +41,7 @@ struct sym_entry {
 
 static struct sym_entry *table;
 static unsigned int table_size, table_cnt;
-static unsigned long long _text, _stext, _etext, _sinittext, _einittext, 
_sextratext, _eextratext;
+static unsigned long long _text, _stext, _etext, _sinittext, _einittext;
 static int all_symbols = 0;
 static char symbol_prefix_char = '\0';
 
@@ -99,10 +99,6 @@ static int read_symbol(FILE *in, struct sym_entry *s)
_sinittext = s-addr;
else if (strcmp(sym, _einittext) == 0)
_einittext = s-addr;
-   else if (strcmp(sym, _sextratext) == 0)
-   _sextratext = s-addr;
-   else if (strcmp(sym, _eextratext) == 0)
-   _eextratext = s-addr;
else if (toupper(stype) == 'A')
{
/* Keep these useful absolute symbols */
@@ -165,18 +161,18 @@ static int symbol_valid(struct sym_entry *s)
 * and inittext sections are discarded */
if (!all_symbols) {
if ((s-addr  _stext || s-addr  _etext)
-(s-addr  _sinittext || s-addr  _einittext)
-(s-addr  _sextratext || s-addr  

Allow auto-destruction of loop devices

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=96c5865559cee0f9cbc5173f3c949f6ce3525581
Commit: 96c5865559cee0f9cbc5173f3c949f6ce3525581
Parent: a3b81113fb6658629f4ebaabf8dd3067cd341020
Author: David Woodhouse [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:27 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

Allow auto-destruction of loop devices

This allows a flag to be set on loop devices so that when they are
closed for the last time, they'll self-destruct.

In general, so that we can automatically allocate loop devices (as with
losetup -f) and have them disappear when we're done with them.

In particular, right now, so that we can stop relying on the hackish
special-case in umount(8) which kills off loop devices which were set up by
'mount -oloop'.  That means we can stop putting crap in /etc/mtab which
doesn't belong there, which means it can be a symlink to /proc/mounts, which
means yet another writable file on the root filesystem is eliminated and the
'stateless' folks get happier...  and OLPC trac #356 can be closed.

The mount(8) side of that is at
http://marc.info/?l=util-linux-ngm=119362955431694w=2

[EMAIL PROTECTED]: coding-style fixes]
Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Cc: Bernardo Innocenti [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/block/loop.c |8 
 include/linux/loop.h |1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index b8af22e..91ebb00 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -973,6 +973,10 @@ loop_set_status(struct loop_device *lo, const struct 
loop_info64 *info)
lo-transfer = xfer-transfer;
lo-ioctl = xfer-ioctl;
 
+   if ((lo-lo_flags  LO_FLAGS_AUTOCLEAR) !=
+(info-lo_flags  LO_FLAGS_AUTOCLEAR))
+   lo-lo_flags ^= LO_FLAGS_AUTOCLEAR;
+
lo-lo_encrypt_key_size = info-lo_encrypt_key_size;
lo-lo_init[0] = info-lo_init[0];
lo-lo_init[1] = info-lo_init[1];
@@ -1331,6 +1335,10 @@ static int lo_release(struct inode *inode, struct file 
*file)
 
mutex_lock(lo-lo_ctl_mutex);
--lo-lo_refcnt;
+
+   if ((lo-lo_flags  LO_FLAGS_AUTOCLEAR)  !lo-lo_refcnt)
+   loop_clr_fd(lo, inode-i_bdev);
+
mutex_unlock(lo-lo_ctl_mutex);
 
return 0;
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 26a0a10..46169a7 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -76,6 +76,7 @@ struct loop_device {
 enum {
LO_FLAGS_READ_ONLY  = 1,
LO_FLAGS_USE_AOPS   = 2,
+   LO_FLAGS_AUTOCLEAR  = 4,
 };
 
 #include asm/posix_types.h   /* for __kernel_old_dev_t */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


register_cpu __devinit or __cpuinit

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33b5f31bbc4d047d048d8635fccdab38ffe6c287
Commit: 33b5f31bbc4d047d048d8635fccdab38ffe6c287
Parent: 96c5865559cee0f9cbc5173f3c949f6ce3525581
Author: Randy Dunlap [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:28 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

register_cpu __devinit or __cpuinit

Is there some reason why register_cpu() is __devinit instead of __cpuinit ?
Make it __cpuinit.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/base/cpu.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index c5885f5..499b003 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -110,7 +110,7 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, 
NULL);
  *
  * Initialize and register the CPU device.
  */
-int __devinit register_cpu(struct cpu *cpu, int num)
+int __cpuinit register_cpu(struct cpu *cpu, int num)
 {
int error;
cpu-node_id = cpu_to_node(num);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


make ipc/util.c:sysvipc_find_ipc() static

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b524b9adb3f655697fe6df9197b3ed6f14bc1729
Commit: b524b9adb3f655697fe6df9197b3ed6f14bc1729
Parent: 33b5f31bbc4d047d048d8635fccdab38ffe6c287
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:28 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

make ipc/util.c:sysvipc_find_ipc() static

sysvipc_find_ipc() can become static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: Nadia Derbey [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 ipc/util.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipc/util.c b/ipc/util.c
index 1aa0ebf..76c1f34 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -802,8 +802,8 @@ struct ipc_proc_iter {
 /*
  * This routine locks the ipc structure found at least at position pos.
  */
-struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
-   loff_t *new_pos)
+static struct kern_ipc_perm *sysvipc_find_ipc(struct ipc_ids *ids, loff_t pos,
+ loff_t *new_pos)
 {
struct kern_ipc_perm *ipc;
int total, id;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cleanup after APUS removal

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b892806b09dca77db8ef6acbb6c51271578d34d
Commit: 7b892806b09dca77db8ef6acbb6c51271578d34d
Parent: b524b9adb3f655697fe6df9197b3ed6f14bc1729
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:29 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

cleanup after APUS removal

After the APUS removal, some code can be removed.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: Geert Uytterhoeven [EMAIL PROTECTED]
Cc: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
Cc: Karsten Keil [EMAIL PROTECTED]
Cc: James Bottomley [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/m68k/amiga/chipram.c   |2 --
 drivers/ide/ide-probe.c |6 +++---
 drivers/isdn/hisax/avm_pci.c|8 
 drivers/scsi/a2091.c|3 +--
 drivers/scsi/a3000.c|3 +--
 drivers/scsi/gvp11.c|3 +--
 drivers/video/console/fbcon.c   |2 +-
 drivers/video/console/fonts.c   |4 ++--
 include/asm-m68k/pgtable.h  |2 --
 sound/oss/dmasound/Kconfig  |2 +-
 sound/oss/dmasound/dmasound_paula.c |4 
 11 files changed, 10 insertions(+), 29 deletions(-)

diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c
index d10726f..cbe3653 100644
--- a/arch/m68k/amiga/chipram.c
+++ b/arch/m68k/amiga/chipram.c
@@ -32,12 +32,10 @@ void __init amiga_chip_init(void)
 if (!AMIGAHW_PRESENT(CHIP_RAM))
return;
 
-#ifndef CONFIG_APUS_FAST_EXCEPT
 /*
  *  Remove the first 4 pages where PPC exception handlers will be located
  */
 amiga_chip_size -= 0x4000;
-#endif
 chipram_res.end = amiga_chip_size-1;
 request_resource(iomem_resource, chipram_res);
 
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index fd0ef82..6daea89 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1049,7 +1049,7 @@ static int init_irq (ide_hwif_t *hwif)
 */
if (!match || match-irq != hwif-irq) {
int sa = 0;
-#if defined(__mc68000__) || defined(CONFIG_APUS)
+#if defined(__mc68000__)
sa = IRQF_SHARED;
 #endif /* __mc68000__ || CONFIG_APUS */
 
@@ -1072,7 +1072,7 @@ static int init_irq (ide_hwif_t *hwif)
hwif-rqsize = 65536;
}
 
-#if !defined(__mc68000__)  !defined(CONFIG_APUS)
+#if !defined(__mc68000__)
printk(%s at 0x%03lx-0x%03lx,0x%03lx on irq %d, hwif-name,
hwif-io_ports[IDE_DATA_OFFSET],
hwif-io_ports[IDE_DATA_OFFSET]+7,
@@ -1080,7 +1080,7 @@ static int init_irq (ide_hwif_t *hwif)
 #else
printk(%s at 0x%08lx on irq %d, hwif-name,
hwif-io_ports[IDE_DATA_OFFSET], hwif-irq);
-#endif /* __mc68000__  CONFIG_APUS */
+#endif /* __mc68000__ */
if (match)
printk( (%sed with %s),
hwif-sharing_irq ? shar : serializ, match-name);
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index 035d158..0f1db1f 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -263,11 +263,7 @@ hdlc_empty_fifo(struct BCState *bcs, int count)
outl(idx, cs-hw.avm.cfg_reg + 4);
while (cnt  count) {
 #ifdef __powerpc__
-#ifdef CONFIG_APUS
-   *ptr++ = in_le32((unsigned *)(cs-hw.avm.isac 
+_IO_BASE));
-#else
*ptr++ = in_be32((unsigned *)(cs-hw.avm.isac 
+_IO_BASE));
-#endif /* CONFIG_APUS */
 #else
*ptr++ = inl(cs-hw.avm.isac);
 #endif /* __powerpc__ */
@@ -328,11 +324,7 @@ hdlc_fill_fifo(struct BCState *bcs)
if (cs-subtyp == AVM_FRITZ_PCI) {
while (cntcount) {
 #ifdef __powerpc__
-#ifdef CONFIG_APUS
-   out_le32((unsigned *)(cs-hw.avm.isac +_IO_BASE), 
*ptr++);
-#else
out_be32((unsigned *)(cs-hw.avm.isac +_IO_BASE), 
*ptr++);
-#endif /* CONFIG_APUS */
 #else
outl(*ptr++, cs-hw.avm.isac);
 #endif /* __powerpc__ */
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 23f27c9..5ac3a3e 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -46,8 +46,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
 struct Scsi_Host *instance = cmd-device-host;
 
 /* don't allow DMA if the physical address is bad */
-if (addr  A2091_XFER_MASK ||
-   (!dir_in  mm_end_of_chunk (addr, cmd-SCp.this_residual)))
+if (addr  A2091_XFER_MASK)
 {
HDATA(instance)-dma_bounce_len = (cmd-SCp.this_residual + 511)
 ~0x1ff;
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index d7255c8..3aeec96 100644
--- a/drivers/scsi/a3000.c
+++ 

remove mm_{ptov,vtop}()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=870b8f8c43d000bb321b42a12212facc1087a748
Commit: 870b8f8c43d000bb321b42a12212facc1087a748
Parent: 7b892806b09dca77db8ef6acbb6c51271578d34d
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:30 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:01 2008 -0800

remove mm_{ptov,vtop}()

This patch removes the unused mm_{ptov,vtop}().

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Acked-by: Greg Ungerer [EMAIL PROTECTED]
Acked-by: Bryan Wu [EMAIL PROTECTED]
Cc: Miles Bader [EMAIL PROTECTED]
Cc: Yoshinori Sato [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-blackfin/io.h   |2 --
 include/asm-h8300/io.h  |2 --
 include/asm-h8300/virtconvert.h |2 --
 include/asm-m68knommu/io.h  |2 --
 include/asm-v850/io.h   |2 --
 5 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
index 1601d62..574fe56 100644
--- a/include/asm-blackfin/io.h
+++ b/include/asm-blackfin/io.h
@@ -188,8 +188,6 @@ extern void blkfin_inv_cache_all(void);
 #define page_to_phys(page)  ((page - mem_map)  PAGE_SHIFT)
 #define page_to_bus(page)   ((page - mem_map)  PAGE_SHIFT)
 
-#define mm_ptov(vaddr) ((void *) (vaddr))
-#define mm_vtop(vaddr) ((unsigned long) (vaddr))
 #define phys_to_virt(vaddr)((void *) (vaddr))
 #define virt_to_phys(vaddr)((unsigned long) (vaddr))
 
diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h
index 7543a57..26dc6cc 100644
--- a/include/asm-h8300/io.h
+++ b/include/asm-h8300/io.h
@@ -302,8 +302,6 @@ static __inline__ void ctrl_outl(unsigned long b, unsigned 
long addr)
 /*
  * Macros used for converting between virtual and physical mappings.
  */
-#define mm_ptov(vaddr) ((void *) (vaddr))
-#define mm_vtop(vaddr) ((unsigned long) (vaddr))
 #define phys_to_virt(vaddr)((void *) (vaddr))
 #define virt_to_phys(vaddr)((unsigned long) (vaddr))
 
diff --git a/include/asm-h8300/virtconvert.h b/include/asm-h8300/virtconvert.h
index ee7d5ea..19cfd62 100644
--- a/include/asm-h8300/virtconvert.h
+++ b/include/asm-h8300/virtconvert.h
@@ -10,8 +10,6 @@
 #include asm/setup.h
 #include asm/page.h
 
-#define mm_ptov(vaddr) ((void *) (vaddr))
-#define mm_vtop(vaddr) ((unsigned long) (vaddr))
 #define phys_to_virt(vaddr)((void *) (vaddr))
 #define virt_to_phys(vaddr)((unsigned long) (vaddr))
 
diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h
index 653d9b2..6adef1e 100644
--- a/include/asm-m68knommu/io.h
+++ b/include/asm-m68knommu/io.h
@@ -172,8 +172,6 @@ extern void iounmap(void *addr);
 /*
  * Macros used for converting between virtual and physical mappings.
  */
-#define mm_ptov(vaddr) ((void *) (vaddr))
-#define mm_vtop(vaddr) ((unsigned long) (vaddr))
 #define phys_to_virt(vaddr)((void *) (vaddr))
 #define virt_to_phys(vaddr)((unsigned long) (vaddr))
 
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h
index cc364fc..cdad251 100644
--- a/include/asm-v850/io.h
+++ b/include/asm-v850/io.h
@@ -122,8 +122,6 @@ outsl (unsigned long port, const void *src, unsigned long 
count)
 #endif
 
 /* Conversion between virtual and physical mappings.  */
-#define mm_ptov(addr)  ((void *)__phys_to_virt (addr))
-#define mm_vtop(addr)  ((unsigned long)__virt_to_phys (addr))
 #define phys_to_virt(addr) ((void *)__phys_to_virt (addr))
 #define virt_to_phys(addr) ((unsigned long)__virt_to_phys (addr))
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


MNT_UNBINDABLE fix

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0b03cfb25fa944bc106e816146846dcb48b2e907
Commit: 0b03cfb25fa944bc106e816146846dcb48b2e907
Parent: 870b8f8c43d000bb321b42a12212facc1087a748
Author: Andries E. Brouwer [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:32 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

MNT_UNBINDABLE fix

Some time ago ( http://lkml.org/lkml/2007/6/19/128 ) I wrote about
MNT_UNBINDABLE that it felt like a bug that it is not reset by mount
--make-private.

Today I happened to see mount(8) and Documentation/sharedsubtree.txt and
both document the version obtained by applying the little patch given in
the above (and again below).

So, the present kernel code is not according to specs and must be regarded
as buggy.

Specification in Documentation/sharedsubtree.txt:
See state diagram: unbindable should become private upon make-private.

Specification in mount(8):
...  It's
also possible to  set  up  uni-directional  propagation  (with  --make-
slave),  to  make  a  mount  point unavailable for --bind/--rbind (with
--make-unbindable), and to undo any  of  these  (with  --make-private).

Repeat of old fix-shared-subtrees-make-private.patch
(due to Dirk Gerrits, René Gabriëls, Peter Kooijmans):

Acked-by: Ram Pai [EMAIL PROTECTED]
Cc: Al Viro [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/pnode.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/pnode.c b/fs/pnode.c
index 89940f2..05ba692 100644
--- a/fs/pnode.c
+++ b/fs/pnode.c
@@ -83,6 +83,8 @@ void change_mnt_propagation(struct vfsmount *mnt, int type)
mnt-mnt_master = NULL;
if (type == MS_UNBINDABLE)
mnt-mnt_flags |= MNT_UNBINDABLE;
+   else
+   mnt-mnt_flags = ~MNT_UNBINDABLE;
}
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


proper show_interrupts() prototype

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f74596d07957235ad9da5120029348b372224a27
Commit: f74596d07957235ad9da5120029348b372224a27
Parent: 0b03cfb25fa944bc106e816146846dcb48b2e907
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:35 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

proper show_interrupts() prototype

Add a proper prototype for show_interrupts() in include/linux/interrupt.h

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/h8300/kernel/irq.c   |1 +
 fs/proc/proc_misc.c   |2 +-
 include/linux/interrupt.h |2 ++
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c
index 8dec4dd..5a1b4cf 100644
--- a/arch/h8300/kernel/irq.c
+++ b/arch/h8300/kernel/irq.c
@@ -14,6 +14,7 @@
 #include linux/random.h
 #include linux/bootmem.h
 #include linux/irq.h
+#include linux/interrupt.h
 
 #include asm/system.h
 #include asm/traps.h
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 51288db..c0a9095 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -29,6 +29,7 @@
 #include linux/mm.h
 #include linux/mmzone.h
 #include linux/pagemap.h
+#include linux/interrupt.h
 #include linux/swap.h
 #include linux/slab.h
 #include linux/smp.h
@@ -599,7 +600,6 @@ static void int_seq_stop(struct seq_file *f, void *v)
 }
 
 
-extern int show_interrupts(struct seq_file *f, void *v); /* In arch code */
 static struct seq_operations int_seq_ops = {
.start = int_seq_start,
.next  = int_seq_next,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index c3db4a0..dea7598 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -444,4 +444,6 @@ static inline void init_irq_proc(void)
 }
 #endif
 
+int show_interrupts(struct seq_file *p, void *v);
+
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


FAT: Fix printk format strings

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4cf9c342a2887f425780c23ad2be3077949cee2
Commit: b4cf9c342a2887f425780c23ad2be3077949cee2
Parent: f74596d07957235ad9da5120029348b372224a27
Author: Vegard Nossum [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:36 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

FAT: Fix printk format strings

This makes sure printk format strings contain no more than a single line.

Signed-off-by: Vegard Nossum [EMAIL PROTECTED]
[the message was tweaked.]
Signed-off-by: OGAWA Hirofumi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/fat/inode.c |6 ++
 fs/fat/misc.c  |5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 920a576..24c0aaa 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1295,10 +1295,8 @@ int fat_fill_super(struct super_block *sb, void *data, 
int silent,
 
fsinfo = (struct fat_boot_fsinfo *)fsinfo_bh-b_data;
if (!IS_FSINFO(fsinfo)) {
-   printk(KERN_WARNING
-  FAT: Did not find valid FSINFO signature.\n
-   Found signature1 0x%08x signature2 0x%08x
-   (sector = %lu)\n,
+   printk(KERN_WARNING FAT: Invalid FSINFO signature: 
+  0x%08x, 0x%08x (sector = %lu)\n,
   le32_to_cpu(fsinfo-signature1),
   le32_to_cpu(fsinfo-signature2),
   sbi-fsinfo_sector);
diff --git a/fs/fat/misc.c b/fs/fat/misc.c
index 308f2b6..61f2351 100644
--- a/fs/fat/misc.c
+++ b/fs/fat/misc.c
@@ -55,9 +55,8 @@ void fat_clusters_flush(struct super_block *sb)
fsinfo = (struct fat_boot_fsinfo *)bh-b_data;
/* Sanity check */
if (!IS_FSINFO(fsinfo)) {
-   printk(KERN_ERR FAT: Did not find valid FSINFO signature.\n
-   Found signature1 0x%08x signature2 0x%08x
-   (sector = %lu)\n,
+   printk(KERN_ERR FAT: Invalid FSINFO signature: 
+  0x%08x, 0x%08x (sector = %lu)\n,
   le32_to_cpu(fsinfo-signature1),
   le32_to_cpu(fsinfo-signature2),
   sbi-fsinfo_sector);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


read_current_timer() cleanups

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=941e492bdb1239d2ca8f5736cdfd3ff83d00cb90
Commit: 941e492bdb1239d2ca8f5736cdfd3ff83d00cb90
Parent: 83bad1d764b836a482b88e0a1f44d7a5c3e1fee0
Author: Andrew Morton [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:42 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

read_current_timer() cleanups

- All implementations can be __devinit

- The function prototypes were in asm/timex.h but they all must be the same,
  so create a single declaration in linux/timex.h.

- uninline the sparc64 version to match the other architectures

- Don't bother #defining ARCH_HAS_READ_CURRENT_TIMER to a particular value.

[EMAIL PROTECTED]: fix build]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Haavard Skinnemoen [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: Andi Kleen [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/avr32/lib/delay.c  |4 +++-
 arch/sparc64/kernel/time.c  |5 +
 arch/x86/lib/delay_32.c |4 +++-
 arch/x86/lib/delay_64.c |4 +++-
 include/asm-avr32/timex.h   |3 +--
 include/asm-sparc64/timex.h |6 +-
 include/asm-x86/timex.h |3 +--
 include/linux/timex.h   |2 ++
 init/calibrate.c|3 +--
 9 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/arch/avr32/lib/delay.c b/arch/avr32/lib/delay.c
index b3bc0b5..9aa8800 100644
--- a/arch/avr32/lib/delay.c
+++ b/arch/avr32/lib/delay.c
@@ -12,13 +12,15 @@
 
 #include linux/delay.h
 #include linux/module.h
+#include linux/timex.h
 #include linux/param.h
 #include linux/types.h
+#include linux/init.h
 
 #include asm/processor.h
 #include asm/sysreg.h
 
-int read_current_timer(unsigned long *timer_value)
+int __devinit read_current_timer(unsigned long *timer_value)
 {
*timer_value = sysreg_read(COUNT);
return 0;
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 4352ee4..d204f1a 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -1707,6 +1707,11 @@ static void __exit rtc_mini_exit(void)
misc_deregister(rtc_mini_dev);
 }
 
+int __devinit read_current_timer(unsigned long *timer_val)
+{
+   *timer_val = tick_ops-get_tick();
+   return 0;
+}
 
 module_init(rtc_mini_init);
 module_exit(rtc_mini_exit);
diff --git a/arch/x86/lib/delay_32.c b/arch/x86/lib/delay_32.c
index aad9d95..4535e6d 100644
--- a/arch/x86/lib/delay_32.c
+++ b/arch/x86/lib/delay_32.c
@@ -12,8 +12,10 @@
 
 #include linux/module.h
 #include linux/sched.h
+#include linux/timex.h
 #include linux/preempt.h
 #include linux/delay.h
+#include linux/init.h
 
 #include asm/processor.h
 #include asm/delay.h
@@ -63,7 +65,7 @@ void use_tsc_delay(void)
delay_fn = delay_tsc;
 }
 
-int read_current_timer(unsigned long *timer_val)
+int __devinit read_current_timer(unsigned long *timer_val)
 {
if (delay_fn == delay_tsc) {
rdtscl(*timer_val);
diff --git a/arch/x86/lib/delay_64.c b/arch/x86/lib/delay_64.c
index 45cdd3f..bbc6105 100644
--- a/arch/x86/lib/delay_64.c
+++ b/arch/x86/lib/delay_64.c
@@ -10,8 +10,10 @@
 
 #include linux/module.h
 #include linux/sched.h
+#include linux/timex.h
 #include linux/preempt.h
 #include linux/delay.h
+#include linux/init.h
 
 #include asm/delay.h
 #include asm/msr.h
@@ -20,7 +22,7 @@
 #include asm/smp.h
 #endif
 
-int read_current_timer(unsigned long *timer_value)
+int __devinit read_current_timer(unsigned long *timer_value)
 {
rdtscll(*timer_value);
return 0;
diff --git a/include/asm-avr32/timex.h b/include/asm-avr32/timex.h
index 5e44ecb..187dcf3 100644
--- a/include/asm-avr32/timex.h
+++ b/include/asm-avr32/timex.h
@@ -34,7 +34,6 @@ static inline cycles_t get_cycles (void)
return 0;
 }
 
-extern int read_current_timer(unsigned long *timer_value);
-#define ARCH_HAS_READ_CURRENT_TIMER1
+#define ARCH_HAS_READ_CURRENT_TIMER
 
 #endif /* __ASM_AVR32_TIMEX_H */
diff --git a/include/asm-sparc64/timex.h b/include/asm-sparc64/timex.h
index 2a5e4eb..c622535 100644
--- a/include/asm-sparc64/timex.h
+++ b/include/asm-sparc64/timex.h
@@ -14,10 +14,6 @@
 typedef unsigned long cycles_t;
 #define get_cycles()   tick_ops-get_tick()
 
-#define ARCH_HAS_READ_CURRENT_TIMER1
-#define read_current_timer(timer_val_p)\
-({ *timer_val_p = tick_ops-get_tick();\
-   0;  \
-})
+#define ARCH_HAS_READ_CURRENT_TIMER
 
 #endif
diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h
index 27cfd6c..43e5a78 100644
--- a/include/asm-x86/timex.h
+++ b/include/asm-x86/timex.h
@@ -14,7 +14,6 @@
 #endif
 #define CLOCK_TICK_RATEPIT_TICK_RATE
 
-extern int read_current_timer(unsigned long *timer_value);

smbfs: fix calculation of kernel_recvmsg size parameter in smb_receive()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce88cc5ed80de746f5bd2d8242291c87e7b87f63
Commit: ce88cc5ed80de746f5bd2d8242291c87e7b87f63
Parent: 941e492bdb1239d2ca8f5736cdfd3ff83d00cb90
Author: Jeff Layton [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:43 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

smbfs: fix calculation of kernel_recvmsg size parameter in smb_receive()

smb_receive calls kernel_recvmsg with a size that's the minimum of the
amount of buffer space in the kvec passed in or req-rq_rlen (which
represents the length of the response).  This does not take into account
any data that was read in a request earlier pass through smb_receive.

If the first pass through smb_receive receives some but not all of the
response, then the next pass can call kernel_recvmsg with a size field
that's too big.  kernel_recvmsg can overrun into the next response,
throwing off the alignment and making it unrecognizable.

This causes messages like this to pop up in the ring buffer:

smb_get_length: Invalid NBT packet, code=69

as well as other errors indicating that the response is unrecognizable.
Typically this is seen on a smbfs mount under heavy I/O.

This patch changes the code to use (req-rq_rlen - req-rq_bytes_recvd)
instead instead of just req-rq_rlen, since that should represent the
amount of unread data in the response.

I think this is correct, but an ACK or NACK from someone more familiar
with this code would be appreciated...

Signed-off-by: Jeff Layton [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/smbfs/sock.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/smbfs/sock.c b/fs/smbfs/sock.c
index e48bd82..e37fe4d 100644
--- a/fs/smbfs/sock.c
+++ b/fs/smbfs/sock.c
@@ -329,9 +329,8 @@ smb_receive(struct smb_sb_info *server, struct smb_request 
*req)
msg.msg_control = NULL;
 
/* Dont repeat bytes and count available bufferspace */
-   rlen = smb_move_iov(p, num, iov, req-rq_bytes_recvd);
-   if (req-rq_rlen  rlen)
-   rlen = req-rq_rlen;
+   rlen = min_t(int, smb_move_iov(p, num, iov, req-rq_bytes_recvd),
+   (req-rq_rlen - req-rq_bytes_recvd));
 
result = kernel_recvmsg(sock, msg, p, num, rlen, flags);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


proper prototype for signals_init()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a1c9eea9e56a7196c6891f6426b799c4598b38e2
Commit: a1c9eea9e56a7196c6891f6426b799c4598b38e2
Parent: ce88cc5ed80de746f5bd2d8242291c87e7b87f63
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:44 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

proper prototype for signals_init()

Add a proper prototype for signals_init() in include/linux/signal.h

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/signal.h |2 ++
 init/main.c|2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0ae3388..7e09514 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -371,6 +371,8 @@ int unhandled_signal(struct task_struct *tsk, int sig);
(!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK)  \
 (t)-sighand-action[(signr)-1].sa.sa_handler == SIG_DFL)
 
+void signals_init(void);
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_SIGNAL_H */
diff --git a/init/main.c b/init/main.c
index cb81ed1..c691f5f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -57,6 +57,7 @@
 #include linux/device.h
 #include linux/kthread.h
 #include linux/sched.h
+#include linux/signal.h
 
 #include asm/io.h
 #include asm/bugs.h
@@ -83,7 +84,6 @@ extern void init_IRQ(void);
 extern void fork_init(unsigned long);
 extern void mca_init(void);
 extern void sbus_init(void);
-extern void signals_init(void);
 extern void pidhash_init(void);
 extern void pidmap_init(void);
 extern void prio_tree_init(void);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kernel/ptrace.c should #include linux/syscalls.h

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f17d30a803e8434c4ef381bb5cfa1956ff0201f0
Commit: f17d30a803e8434c4ef381bb5cfa1956ff0201f0
Parent: a1c9eea9e56a7196c6891f6426b799c4598b38e2
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:44 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

kernel/ptrace.c should #include linux/syscalls.h

Every file should include the headers containing the prototypes for its 
global
functions (in this case sys_ptrace()).

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/ptrace.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 74730e0..628b03a 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -20,6 +20,7 @@
 #include linux/signal.h
 #include linux/audit.h
 #include linux/pid_namespace.h
+#include linux/syscalls.h
 
 #include asm/pgtable.h
 #include asm/uaccess.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kernel/notifier.c should #include linux/reboot.h

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c166f23cb56a76983ce860739d95c8296e57d6b3
Commit: c166f23cb56a76983ce860739d95c8296e57d6b3
Parent: bb695170d8dff3f22682b6c19df64dc093f58c0a
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:46 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

kernel/notifier.c should #include linux/reboot.h

Every file should include the headers containing the prototypes for its 
global
functions (in this case {,un}register_reboot_notifier()).

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/notifier.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/notifier.c b/kernel/notifier.c
index 4253f47..643360d 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -4,6 +4,7 @@
 #include linux/notifier.h
 #include linux/rcupdate.h
 #include linux/vmalloc.h
+#include linux/reboot.h
 
 /*
  * Notifier list for kernel code which wants to be called
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs/utimes.c should #include linux/syscalls.h

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12c2ab5e8fdfde67f3f6778a366cbdef06de410d
Commit: 12c2ab5e8fdfde67f3f6778a366cbdef06de410d
Parent: 011e3fcd1e1f14ef54db30b93404ab7caa726477
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:47 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

fs/utimes.c should #include linux/syscalls.h

Every file should include the headers containing the prototypes for its 
global
functions.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/utimes.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/utimes.c b/fs/utimes.c
index b9912ec..e5588cd 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -6,6 +6,7 @@
 #include linux/sched.h
 #include linux/stat.h
 #include linux/utime.h
+#include linux/syscalls.h
 #include asm/uaccess.h
 #include asm/unistd.h
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


proper prototype for get_filesystem_list()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=011e3fcd1e1f14ef54db30b93404ab7caa726477
Commit: 011e3fcd1e1f14ef54db30b93404ab7caa726477
Parent: c166f23cb56a76983ce860739d95c8296e57d6b3
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:47 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:02 2008 -0800

proper prototype for get_filesystem_list()

Ad a proper prototype for migration_init() in include/linux/fs.h

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/proc/proc_misc.c |1 -
 include/linux/fs.h  |1 +
 init/do_mounts.c|3 +--
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index c0a9095..383ff06 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -65,7 +65,6 @@
  */
 extern int get_hardware_list(char *);
 extern int get_stram_list(char *);
-extern int get_filesystem_list(char *);
 extern int get_exec_domain_list(char *);
 extern int get_dma_list(char *);
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 56bd421..ed289a9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2113,6 +2113,7 @@ struct ctl_table;
 int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
  void __user *buffer, size_t *lenp, loff_t *ppos);
 
+int get_filesystem_list(char * buf);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_FS_H */
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 1161dfd..f865731 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -11,6 +11,7 @@
 #include linux/mount.h
 #include linux/device.h
 #include linux/init.h
+#include linux/fs.h
 
 #include linux/nfs_fs.h
 #include linux/nfs_fs_sb.h
@@ -18,8 +19,6 @@
 
 #include do_mounts.h
 
-extern int get_filesystem_list(char * buf);
-
 int __initdata rd_doload;  /* 1 = load RAM disk, 0 = don't load */
 
 int root_mountflags = MS_RDONLY | MS_SILENT;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs/signalfd.c should #include linux/syscalls.h

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ec37dfd4d282ce132dcb048398800951f6d11ef
Commit: 7ec37dfd4d282ce132dcb048398800951f6d11ef
Parent: 12c2ab5e8fdfde67f3f6778a366cbdef06de410d
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:48 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

fs/signalfd.c should #include linux/syscalls.h

Every file should include the headers containing the prototypes for its 
global
functions (in this case sys_signalfd()).

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Davide Libenzi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/signalfd.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/signalfd.c b/fs/signalfd.c
index 2d3e107..cb2b63a 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -27,6 +27,7 @@
 #include linux/list.h
 #include linux/anon_inodes.h
 #include linux/signalfd.h
+#include linux/syscalls.h
 
 struct signalfd_ctx {
sigset_t sigmask;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs/eventfd.c should #include linux/syscalls.h

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7747cdb2f8302c2e1121f6d604b62a060fb04603
Commit: 7747cdb2f8302c2e1121f6d604b62a060fb04603
Parent: 7ec37dfd4d282ce132dcb048398800951f6d11ef
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:49 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

fs/eventfd.c should #include linux/syscalls.h

Every file should include the headers containing the prototypes for its 
global
functions (in this case sys_eventfd()).

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Davide Libenzi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/eventfd.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/eventfd.c b/fs/eventfd.c
index 2ce19c0..a9f130c 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -15,6 +15,7 @@
 #include linux/spinlock.h
 #include linux/anon_inodes.h
 #include linux/eventfd.h
+#include linux/syscalls.h
 
 struct eventfd_ctx {
wait_queue_head_t wqh;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


proper prototype for vty_init()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26464378c4af9f7461b9d9e359f98dbd34ab3544
Commit: 26464378c4af9f7461b9d9e359f98dbd34ab3544
Parent: 7747cdb2f8302c2e1121f6d604b62a060fb04603
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:49 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

proper prototype for vty_init()

Add a proper prototype for vty_init() in include/linux/vt_kern.h

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/tty_io.c   |4 
 include/linux/vt_kern.h |1 +
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index f36fecd..c927f42 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -4048,10 +4048,6 @@ void __init console_init(void)
}
 }
 
-#ifdef CONFIG_VT
-extern int vty_init(void);
-#endif
-
 static int __init tty_class_init(void)
 {
tty_class = class_create(THIS_MODULE, tty);
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index feb5e99..9448ffb 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -77,6 +77,7 @@ void change_console(struct vc_data *new_vc);
 void reset_vc(struct vc_data *vc);
 extern int unbind_con_driver(const struct consw *csw, int first, int last,
 int deflt);
+int vty_init(void);
 
 /*
  * vc_screen.c shares this temporary buffer with the console write code so that
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/misc/lkdtm.c: cleanups

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2118116e5ed2432a054d52f9925dbf92d2cb7279
Commit: 2118116e5ed2432a054d52f9925dbf92d2cb7279
Parent: 26464378c4af9f7461b9d9e359f98dbd34ab3544
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:50 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

drivers/misc/lkdtm.c: cleanups

- make needlessly global functions static
- make lkdtm_module_{init,exit}() as __{init,exit}

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Ankita Garg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/misc/lkdtm.c |   24 +---
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/lkdtm.c b/drivers/misc/lkdtm.c
index 552b795..c884730 100644
--- a/drivers/misc/lkdtm.c
+++ b/drivers/misc/lkdtm.c
@@ -129,27 +129,28 @@ module_param(cpoint_count, int, 0644);
 MODULE_PARM_DESC(cpoint_count,  Crash Point Count, number of times the \
crash point is to be hit to trigger action);
 
-unsigned int jp_do_irq(unsigned int irq)
+static unsigned int jp_do_irq(unsigned int irq)
 {
lkdtm_handler();
jprobe_return();
return 0;
 }
 
-irqreturn_t jp_handle_irq_event(unsigned int irq, struct irqaction *action)
+static irqreturn_t jp_handle_irq_event(unsigned int irq,
+  struct irqaction *action)
 {
lkdtm_handler();
jprobe_return();
return 0;
 }
 
-void jp_tasklet_action(struct softirq_action *a)
+static void jp_tasklet_action(struct softirq_action *a)
 {
lkdtm_handler();
jprobe_return();
 }
 
-void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
+static void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
 {
lkdtm_handler();
jprobe_return();
@@ -157,23 +158,24 @@ void jp_ll_rw_block(int rw, int nr, struct buffer_head 
*bhs[])
 
 struct scan_control;
 
-unsigned long jp_shrink_inactive_list(unsigned long max_scan,
-   struct zone *zone, struct scan_control *sc)
+static unsigned long jp_shrink_inactive_list(unsigned long max_scan,
+struct zone *zone,
+struct scan_control *sc)
 {
lkdtm_handler();
jprobe_return();
return 0;
 }
 
-int jp_hrtimer_start(struct hrtimer *timer, ktime_t tim,
-   const enum hrtimer_mode mode)
+static int jp_hrtimer_start(struct hrtimer *timer, ktime_t tim,
+   const enum hrtimer_mode mode)
 {
lkdtm_handler();
jprobe_return();
return 0;
 }
 
-int jp_scsi_dispatch_cmd(struct scsi_cmnd *cmd)
+static int jp_scsi_dispatch_cmd(struct scsi_cmnd *cmd)
 {
lkdtm_handler();
jprobe_return();
@@ -270,7 +272,7 @@ void lkdtm_handler(void)
}
 }
 
-int lkdtm_module_init(void)
+static int __init lkdtm_module_init(void)
 {
int ret;
 
@@ -331,7 +333,7 @@ int lkdtm_module_init(void)
return 0;
 }
 
-void lkdtm_module_exit(void)
+static void __exit lkdtm_module_exit(void)
 {
 unregister_jprobe(lkdtm);
 printk(KERN_INFO lkdtm : Crash point unregistered\n);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


rd: use is_power_of_2() in drivers/block/rd.c.

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67a3b2b6ce09809b21f60401e81663f2c8131640
Commit: 67a3b2b6ce09809b21f60401e81663f2c8131640
Parent: 2118116e5ed2432a054d52f9925dbf92d2cb7279
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:51 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

rd: use is_power_of_2() in drivers/block/rd.c.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/block/rd.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 82f4eec..06e23be 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -56,6 +56,7 @@
 #include linux/backing-dev.h
 #include linux/blkpg.h
 #include linux/writeback.h
+#include linux/log2.h
 
 #include asm/uaccess.h
 
@@ -450,7 +451,7 @@ static int __init rd_init(void)
err = -ENOMEM;
 
if (rd_blocksize  PAGE_SIZE || rd_blocksize  512 ||
-   (rd_blocksize  (rd_blocksize-1))) {
+   !is_power_of_2(rd_blocksize)) {
printk(RAMDISK: wrong blocksize %d, reverting to defaults\n,
   rd_blocksize);
rd_blocksize = BLOCK_SIZE;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sound/oss/trident.c: fix incorrect test in trident_ac97_set()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be6c28e62e3a304b74013afab029af2021e1f50d
Commit: be6c28e62e3a304b74013afab029af2021e1f50d
Parent: 67a3b2b6ce09809b21f60401e81663f2c8131640
Author: Roel Kluin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:51 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

sound/oss/trident.c: fix incorrect test in trident_ac97_set()

If count reaches zero, the loop ends, but the postfix decrement still
subtracts: testing for 'count == 0' will not work.

Signed-off-by: Roel Kluin [EMAIL PROTECTED]
Reviewed-by: Ray Lee [EMAIL PROTECTED]
Acked-by: Muli Ben-Yehuda [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 sound/oss/trident.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index 96adc47..6959ee1 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -2935,7 +2935,7 @@ trident_ac97_set(struct ac97_codec *codec, u8 reg, u16 
val)
do {
if ((inw(TRID_REG(card, address))  busy) == 0)
break;
-   } while (count--);
+   } while (--count);
 
data |= (mask | (reg  AC97_REG_ADDR));
 
@@ -2996,7 +2996,7 @@ trident_ac97_get(struct ac97_codec *codec, u8 reg)
data = inl(TRID_REG(card, address));
if ((data  busy) == 0)
break;
-   } while (count--);
+   } while (--count);
spin_unlock_irqrestore(card-lock, flags);
 
if (count == 0) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cciss: use upper_32_bits() macro to eliminate warnings

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=582539e5a0480f1e00e3b9ffbe50bd5b2f59a16f
Commit: 582539e5a0480f1e00e3b9ffbe50bd5b2f59a16f
Parent: 5e2cb1018a8a583b83d56c80f46507da6f3f2b57
Author: Randy Dunlap [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:54 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

cciss: use upper_32_bits() macro to eliminate warnings

Use upper_32_bits(x) macro to handle shifts that may be = the width of
the data type.

drivers/block/cciss.c: In function 'do_cciss_request':
drivers/block/cciss.c:2655: warning: right shift count = width of type
drivers/block/cciss.c:2656: warning: right shift count = width of type
drivers/block/cciss.c:2657: warning: right shift count = width of type
drivers/block/cciss.c:2658: warning: right shift count = width of type

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/block/cciss.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 855ce8e..9715be3 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -2630,12 +2630,14 @@ static void do_cciss_request(struct request_queue *q)
c-Request.CDB[8] = creq-nr_sectors  0xff;
c-Request.CDB[9] = c-Request.CDB[11] = 
c-Request.CDB[12] = 0;
} else {
+   u32 upper32 = upper_32_bits(start_blk);
+
c-Request.CDBLen = 16;
c-Request.CDB[1]= 0;
-   c-Request.CDB[2]= (start_blk  56)  0xff;//MSB
-   c-Request.CDB[3]= (start_blk  48)  0xff;
-   c-Request.CDB[4]= (start_blk  40)  0xff;
-   c-Request.CDB[5]= (start_blk  32)  0xff;
+   c-Request.CDB[2]= (upper32  24)  0xff;  //MSB
+   c-Request.CDB[3]= (upper32  16)  0xff;
+   c-Request.CDB[4]= (upper32   8)  0xff;
+   c-Request.CDB[5]= upper32  0xff;
c-Request.CDB[6]= (start_blk  24)  0xff;
c-Request.CDB[7]= (start_blk  16)  0xff;
c-Request.CDB[8]= (start_blk   8)  0xff;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


log2.h: Define order_base_2() macro for convenience.

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de9330d13eac1f331e63ab1d18c506365b0151f3
Commit: de9330d13eac1f331e63ab1d18c506365b0151f3
Parent: 582539e5a0480f1e00e3b9ffbe50bd5b2f59a16f
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:54 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

log2.h: Define order_base_2() macro for convenience.

Given a number of places in the tree that need to calculate this value
explicitly, might as well just create a macro for it.

(akpm: must be implemented as a macro for callee typeof() usage)

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/log2.h |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/linux/log2.h b/include/linux/log2.h
index c8cf5e8..25b8086 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
__rounddown_pow_of_two(n)   \
  )
 
+/**
+ * order_base_2 - calculate the (rounded up) base 2 order of the argument
+ * @n: parameter
+ *
+ * The first few values calculated by this routine:
+ *  ob2(0) = 0
+ *  ob2(1) = 0
+ *  ob2(2) = 1
+ *  ob2(3) = 2
+ *  ob2(4) = 2
+ *  ob2(5) = 3
+ *  ... and so on.
+ */
+
+#define order_base_2(n) ilog2(roundup_pow_of_two(n))
+
 #endif /* _LINUX_LOG2_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs: remove dead config CONFIG_HAS_COMPAT_EPOLL_EVENT symbol

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0321155926b32cbc46f6603c6cc455e046b4d9b2
Commit: 0321155926b32cbc46f6603c6cc455e046b4d9b2
Parent: de9330d13eac1f331e63ab1d18c506365b0151f3
Author: Jiri Olsa [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:55 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

fs: remove dead config CONFIG_HAS_COMPAT_EPOLL_EVENT symbol

Remove dead config CONFIG_HAS_COMPAT_EPOLL_EVENT symbol.

Signed-off-by: Jiri Olsa [EMAIL PROTECTED]
Cc: Davide Libenzi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/compat.c|   49 
 include/linux/compat.h |8 ---
 2 files changed, 0 insertions(+), 57 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index 69baca5..ee80ff3 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -2083,51 +2083,6 @@ long asmlinkage compat_sys_nfsservctl(int cmd, void 
*notused, void *notused2)
 
 #ifdef CONFIG_EPOLL
 
-#ifdef CONFIG_HAS_COMPAT_EPOLL_EVENT
-asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
-   struct compat_epoll_event __user *event)
-{
-   long err = 0;
-   struct compat_epoll_event user;
-   struct epoll_event __user *kernel = NULL;
-
-   if (event) {
-   if (copy_from_user(user, event, sizeof(user)))
-   return -EFAULT;
-   kernel = compat_alloc_user_space(sizeof(struct epoll_event));
-   err |= __put_user(user.events, kernel-events);
-   err |= __put_user(user.data, kernel-data);
-   }
-
-   return err ? err : sys_epoll_ctl(epfd, op, fd, kernel);
-}
-
-
-asmlinkage long compat_sys_epoll_wait(int epfd,
-   struct compat_epoll_event __user *events,
-   int maxevents, int timeout)
-{
-   long i, ret, err = 0;
-   struct epoll_event __user *kbuf;
-   struct epoll_event ev;
-
-   if ((maxevents = 0) ||
-   (maxevents  (INT_MAX / sizeof(struct epoll_event
-   return -EINVAL;
-   kbuf = compat_alloc_user_space(sizeof(struct epoll_event) * maxevents);
-   ret = sys_epoll_wait(epfd, kbuf, maxevents, timeout);
-   for (i = 0; i  ret; i++) {
-   err |= __get_user(ev.events, kbuf[i].events);
-   err |= __get_user(ev.data, kbuf[i].data);
-   err |= __put_user(ev.events, events-events);
-   err |= __put_user_unaligned(ev.data, events-data);
-   events++;
-   }
-
-   return err ? -EFAULT: ret;
-}
-#endif /* CONFIG_HAS_COMPAT_EPOLL_EVENT */
-
 #ifdef TIF_RESTORE_SIGMASK
 asmlinkage long compat_sys_epoll_pwait(int epfd,
struct compat_epoll_event __user *events,
@@ -2153,11 +2108,7 @@ asmlinkage long compat_sys_epoll_pwait(int epfd,
sigprocmask(SIG_SETMASK, ksigmask, sigsaved);
}
 
-#ifdef CONFIG_HAS_COMPAT_EPOLL_EVENT
-   err = compat_sys_epoll_wait(epfd, events, maxevents, timeout);
-#else
err = sys_epoll_wait(epfd, events, maxevents, timeout);
-#endif
 
/*
 * If we changed the signal mask, we need to restore the original one.
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ae0a483..a671dbf 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -257,16 +257,8 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, 
compat_long_t pid,
 /*
  * epoll (fs/eventpoll.c) compat bits follow ...
  */
-#ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT
 struct epoll_event;
 #define compat_epoll_event epoll_event
-#else
-asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
-   struct compat_epoll_event __user *event);
-asmlinkage long compat_sys_epoll_wait(int epfd,
-   struct compat_epoll_event __user *events,
-   int maxevents, int timeout);
-#endif
 asmlinkage long compat_sys_epoll_pwait(int epfd,
struct compat_epoll_event __user *events,
int maxevents, int timeout,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


alpha/parisc: remove config variable DEBUG_RWLOCK

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20420bba13bf79c86cab1e5bdfc4c938d9e44bc9
Commit: 20420bba13bf79c86cab1e5bdfc4c938d9e44bc9
Parent: 0321155926b32cbc46f6603c6cc455e046b4d9b2
Author: Jiri Olsa [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:56 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

alpha/parisc: remove config variable DEBUG_RWLOCK

Remove config variable DEBUG_RWLOCK, since it is not used.

Signed-off-by: Jiri Olsa [EMAIL PROTECTED]
Acked-by: Grant Grundler [EMAIL PROTECTED]
Acked-by: Kyle McMartin [EMAIL PROTECTED]
Cc: Richard Henderson [EMAIL PROTECTED]
Cc: Ivan Kokshaysky [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/alpha/Kconfig.debug   |9 -
 arch/alpha/defconfig   |1 -
 arch/parisc/Kconfig.debug  |9 -
 arch/parisc/configs/a500_defconfig |1 -
 4 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/arch/alpha/Kconfig.debug b/arch/alpha/Kconfig.debug
index f45f28c..3f6265f 100644
--- a/arch/alpha/Kconfig.debug
+++ b/arch/alpha/Kconfig.debug
@@ -7,15 +7,6 @@ config EARLY_PRINTK
depends on ALPHA_GENERIC || ALPHA_SRM
default y
 
-config DEBUG_RWLOCK
-   bool Read-write spinlock debugging
-   depends on DEBUG_KERNEL
-   help
- If you say Y here then read-write lock processing will count how many
- times it has tried to get the lock and issue an error message after
- too many attempts.  If you suspect a rwlock problem or a kernel
- hacker asks for this option then say Y.  Otherwise say N.
-
 config ALPHA_LEGACY_START_ADDRESS
bool Legacy kernel start address
depends on ALPHA_GENERIC
diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig
index 6da9c3d..e43f68f 100644
--- a/arch/alpha/defconfig
+++ b/arch/alpha/defconfig
@@ -882,7 +882,6 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_INFO=y
 CONFIG_EARLY_PRINTK=y
-# CONFIG_DEBUG_RWLOCK is not set
 # CONFIG_DEBUG_SEMAPHORE is not set
 CONFIG_ALPHA_LEGACY_START_ADDRESS=y
 CONFIG_MATHEMU=y
diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug
index 9166bd1..bc989e5 100644
--- a/arch/parisc/Kconfig.debug
+++ b/arch/parisc/Kconfig.debug
@@ -2,15 +2,6 @@ menu Kernel hacking
 
 source lib/Kconfig.debug
 
-config DEBUG_RWLOCK
-bool Read-write spinlock debugging
-depends on DEBUG_KERNEL  SMP
-help
-  If you say Y here then read-write lock processing will count how many
-  times it has tried to get the lock and issue an error message after
-  too many attempts.  If you suspect a rwlock problem or a kernel
-  hacker asks for this option then say Y.  Otherwise say N.
-
 config DEBUG_RODATA
bool Write protect kernel read-only data structures
depends on DEBUG_KERNEL
diff --git a/arch/parisc/configs/a500_defconfig 
b/arch/parisc/configs/a500_defconfig
index ea07121..ddacc72 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -1050,7 +1050,6 @@ CONFIG_SCHED_DEBUG=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
-# CONFIG_DEBUG_RWLOCK is not set
 # CONFIG_DEBUG_RODATA is not set
 
 #
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Document I_SYNC and I_DATASYNC

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7ca2d41a029577a8cff453d1445951d4f96bfd8
Commit: e7ca2d41a029577a8cff453d1445951d4f96bfd8
Parent: 20420bba13bf79c86cab1e5bdfc4c938d9e44bc9
Author: Joern Engel [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:36:59 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:03 2008 -0800

Document I_SYNC and I_DATASYNC

After some archeology (see http://logfs.org/logfs/inode_state_bits) I
finally figured out what the three I_DIRTY bits do.  Maybe others would
prefer less effort to reach this insight.

Signed-off-by: Joern Engel [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/fs.h |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index ed289a9..e260d9a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1279,8 +1279,10 @@ struct super_operations {
  *
  * Two bits are used for locking and completion notification, I_LOCK and 
I_SYNC.
  *
- * I_DIRTY_SYNCInode itself is dirty.
- * I_DIRTY_DATASYNCData-related inode changes pending
+ * I_DIRTY_SYNCInode is dirty, but doesn't have to be written 
on
+ * fdatasync().  i_atime is the usual cause.
+ * I_DIRTY_DATASYNCInode is dirty and must be written on fdatasync(), f.e.
+ * because i_size changed.
  * I_DIRTY_PAGES   Inode has dirty pages.  Inode itself may be clean.
  * I_NEW   get_new_inode() sets i_state to I_LOCK|I_NEW.  Both
  * are cleared by unlock_new_inode(), called from iget().
@@ -1312,8 +1314,6 @@ struct super_operations {
  * purpose reduces latency and prevents some filesystem-
  * specific deadlocks.
  *
- * Q: Why does I_DIRTY_DATASYNC exist?  It appears as if it could be replaced
- *by (I_DIRTY_SYNC|I_DIRTY_PAGES).
  * Q: What is the difference between I_WILL_FREE and I_FREEING?
  * Q: igrab() only checks on (I_FREEING|I_WILL_FREE).  Should it also check on
  *I_CLEAR?  If not, why?
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3242151906372f30f57feaa43b4cac96a23edb1
Commit: b3242151906372f30f57feaa43b4cac96a23edb1
Parent: e7ca2d41a029577a8cff453d1445951d4f96bfd8
Author: Eric Dumazet [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:01 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

PERCPU : __percpu_alloc_mask() can dynamically size percpu_data storage

Instead of allocating a fix sized array of NR_CPUS pointers for percpu_data,
we can use nr_cpu_ids, which is generally  NR_CPUS.

Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
Cc: Christoph Lameter [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/percpu.h |2 +-
 mm/allocpercpu.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 50faa0e..1ac9697 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -54,7 +54,7 @@
 #ifdef CONFIG_SMP
 
 struct percpu_data {
-   void *ptrs[NR_CPUS];
+   void *ptrs[1];
 };
 
 #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
diff --git a/mm/allocpercpu.c b/mm/allocpercpu.c
index 00b0262..7e58322 100644
--- a/mm/allocpercpu.c
+++ b/mm/allocpercpu.c
@@ -98,7 +98,7 @@ EXPORT_SYMBOL_GPL(__percpu_populate_mask);
  */
 void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
 {
-   void *pdata = kzalloc(sizeof(struct percpu_data), gfp);
+   void *pdata = kzalloc(nr_cpu_ids * sizeof(void *), gfp);
void *__pdata = __percpu_disguise(pdata);
 
if (unlikely(!pdata))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


printk.c: use unsigned ints instead of longs for logbuf index

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eed4a2aba7ff6d8c40d3d55b81f80352765ffcee
Commit: eed4a2aba7ff6d8c40d3d55b81f80352765ffcee
Parent: b3242151906372f30f57feaa43b4cac96a23edb1
Author: Denys Vlasenko [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:02 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

printk.c: use unsigned ints instead of longs for logbuf index

Stop using unsigned _longs_ for printk buffer indexes.  Log buffer is way
smaller than 2 gigabytes and unsigned ints will work too .  Indeed, they do
work nicely on all 32-bit platforms where longs and ints are the same.

With this patch, we have following size savings on amd64:

   textdata bss dec hex filename
   5997 313   17736   240465dee 2.6.23.1.t64/kernel/printk.o
   5858 313   17700   238715d3f 2.6.23.1.printk.t64/kernel/printk.o

Signed-off-by: Denys Vlasenko [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/printk.c |   36 ++--
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 29ae1e9..4a09062 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -93,16 +93,16 @@ static int console_locked, console_suspended;
  */
 static DEFINE_SPINLOCK(logbuf_lock);
 
-#define LOG_BUF_MASK   (log_buf_len-1)
+#define LOG_BUF_MASK (log_buf_len-1)
 #define LOG_BUF(idx) (log_buf[(idx)  LOG_BUF_MASK])
 
 /*
  * The indices into log_buf are not constrained to log_buf_len - they
  * must be masked before subscripting
  */
-static unsigned long log_start;/* Index into log_buf: next char to be 
read by syslog() */
-static unsigned long con_start;/* Index into log_buf: next char to be 
sent to consoles */
-static unsigned long log_end;  /* Index into log_buf: 
most-recently-written-char + 1 */
+static unsigned log_start; /* Index into log_buf: next char to be read by 
syslog() */
+static unsigned con_start; /* Index into log_buf: next char to be sent to 
consoles */
+static unsigned log_end;   /* Index into log_buf: 
most-recently-written-char + 1 */
 
 /*
  * Array of consoles built from command line options (console=)
@@ -128,17 +128,17 @@ static int console_may_schedule;
 static char __log_buf[__LOG_BUF_LEN];
 static char *log_buf = __log_buf;
 static int log_buf_len = __LOG_BUF_LEN;
-static unsigned long logged_chars; /* Number of chars produced since last 
read+clear operation */
+static unsigned logged_chars; /* Number of chars produced since last 
read+clear operation */
 
 static int __init log_buf_len_setup(char *str)
 {
-   unsigned long size = memparse(str, str);
+   unsigned size = memparse(str, str);
unsigned long flags;
 
if (size)
size = roundup_pow_of_two(size);
if (size  log_buf_len) {
-   unsigned long start, dest_idx, offset;
+   unsigned start, dest_idx, offset;
char *new_log_buf;
 
new_log_buf = alloc_bootmem(size);
@@ -295,7 +295,7 @@ int log_buf_read(int idx)
  */
 int do_syslog(int type, char __user *buf, int len)
 {
-   unsigned long i, j, limit, count;
+   unsigned i, j, limit, count;
int do_clear = 0;
char c;
int error = 0;
@@ -436,7 +436,7 @@ asmlinkage long sys_syslog(int type, char __user *buf, int 
len)
 /*
  * Call the console drivers on a range of log_buf
  */
-static void __call_console_drivers(unsigned long start, unsigned long end)
+static void __call_console_drivers(unsigned start, unsigned end)
 {
struct console *con;
 
@@ -463,8 +463,8 @@ early_param(ignore_loglevel, ignore_loglevel_setup);
 /*
  * Write out chars from start to end - 1 inclusive
  */
-static void _call_console_drivers(unsigned long start,
-   unsigned long end, int msg_log_level)
+static void _call_console_drivers(unsigned start,
+   unsigned end, int msg_log_level)
 {
if ((msg_log_level  console_loglevel || ignore_loglevel) 
console_drivers  start != end) {
@@ -484,12 +484,12 @@ static void _call_console_drivers(unsigned long start,
  * log_buf[start] to log_buf[end - 1].
  * The console_sem must be held.
  */
-static void call_console_drivers(unsigned long start, unsigned long end)
+static void call_console_drivers(unsigned start, unsigned end)
 {
-   unsigned long cur_index, start_print;
+   unsigned cur_index, start_print;
static int msg_level = -1;
 
-   BUG_ON(((long)(start - end))  0);
+   BUG_ON(((int)(start - end))  0);
 
cur_index = start;
start_print = start;
@@ -790,7 +790,7 @@ asmlinkage long sys_syslog(int type, char __user *buf, int 
len)
return -ENOSYS;
 }
 
-static void 

tpm.c: fix crash during device removal

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5bd91f18be2fc0dd0384fbfca6d3cdd79a8050dd
Commit: 5bd91f18be2fc0dd0384fbfca6d3cdd79a8050dd
Parent: eed4a2aba7ff6d8c40d3d55b81f80352765ffcee
Author: Richard MUSIL [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:02 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

tpm.c: fix crash during device removal

The clean up procedure now uses platform device release callback to
handle memory clean up.  For this purpose release function callback was
added to struct tpm_vendor_specific, so hw device driver provider can get
called when it is safe to remove all allocated resources.

This is supposed to fix a bug in device removal, where device while in
receive function (waiting on timeout) was prone to segfault, if the
tpm_chip struct was unallocated before the timeout expired (in
tpm_remove_hardware).

Acked-by: Marcel Selhorst [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/tpm/tpm.c |   44 +++-
 drivers/char/tpm/tpm.h |2 ++
 2 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index c88424a..a5d8bcb 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1031,18 +1031,13 @@ void tpm_remove_hardware(struct device *dev)
 
spin_unlock(driver_lock);
 
-   dev_set_drvdata(dev, NULL);
misc_deregister(chip-vendor.miscdev);
-   kfree(chip-vendor.miscdev.name);
 
sysfs_remove_group(dev-kobj, chip-vendor.attr_group);
tpm_bios_log_teardown(chip-bios_dir);
 
-   clear_bit(chip-dev_num, dev_mask);
-
-   kfree(chip);
-
-   put_device(dev);
+   /* write it this way to be explicit (chip-dev == dev) */
+   put_device(chip-dev);
 }
 EXPORT_SYMBOL_GPL(tpm_remove_hardware);
 
@@ -1083,6 +1078,26 @@ int tpm_pm_resume(struct device *dev)
 EXPORT_SYMBOL_GPL(tpm_pm_resume);
 
 /*
+ * Once all references to platform device are down to 0,
+ * release all allocated structures.
+ * In case vendor provided release function,
+ * call it too.
+ */
+static void tpm_dev_release(struct device *dev)
+{
+   struct tpm_chip *chip = dev_get_drvdata(dev);
+
+   if (chip-vendor.release)
+   chip-vendor.release(dev);
+
+   chip-release(dev);
+
+   clear_bit(chip-dev_num, dev_mask);
+   kfree(chip-vendor.miscdev.name);
+   kfree(chip);
+}
+
+/*
  * Called from tpm_specific.c probe function only for devices 
  * the driver has determined it should claim.  Prior to calling
  * this function the specific probe function has called pci_enable_device
@@ -1136,23 +1151,21 @@ struct tpm_chip *tpm_register_hardware(struct device 
*dev, const struct tpm_vend
 
chip-vendor.miscdev.parent = dev;
chip-dev = get_device(dev);
+   chip-release = dev-release;
+   dev-release = tpm_dev_release;
+   dev_set_drvdata(dev, chip);
 
if (misc_register(chip-vendor.miscdev)) {
dev_err(chip-dev,
unable to misc_register %s, minor %d\n,
chip-vendor.miscdev.name,
chip-vendor.miscdev.minor);
-   put_device(dev);
-   clear_bit(chip-dev_num, dev_mask);
-   kfree(chip);
-   kfree(devname);
+   put_device(chip-dev);
return NULL;
}
 
spin_lock(driver_lock);
 
-   dev_set_drvdata(dev, chip);
-
list_add(chip-list, tpm_chip_list);
 
spin_unlock(driver_lock);
@@ -1160,10 +1173,7 @@ struct tpm_chip *tpm_register_hardware(struct device 
*dev, const struct tpm_vend
if (sysfs_create_group(dev-kobj, chip-vendor.attr_group)) {
list_del(chip-list);
misc_deregister(chip-vendor.miscdev);
-   put_device(dev);
-   clear_bit(chip-dev_num, dev_mask);
-   kfree(chip);
-   kfree(devname);
+   put_device(chip-dev);
return NULL;
}
 
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index d15ccdd..e885148 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -74,6 +74,7 @@ struct tpm_vendor_specific {
int (*send) (struct tpm_chip *, u8 *, size_t);
void (*cancel) (struct tpm_chip *);
u8 (*status) (struct tpm_chip *);
+   void (*release) (struct device *);
struct miscdevice miscdev;
struct attribute_group *attr_group;
struct list_head list;
@@ -106,6 +107,7 @@ struct tpm_chip {
struct dentry **bios_dir;
 
struct list_head list;
+   void (*release) (struct device *);
 };
 
 #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor)
-
To 

vt: bitlock fix

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0940003f25dd3d2c54c4879809a432a35197f54
Commit: b0940003f25dd3d2c54c4879809a432a35197f54
Parent: 5bd91f18be2fc0dd0384fbfca6d3cdd79a8050dd
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:04 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

vt: bitlock fix

vt is missing a memory barrier to close the critical section.  Use a real
spinlock for this.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Cc: Antonino A. Daplas [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/vt.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 7a5badf..367be91 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2400,13 +2400,15 @@ static void vt_console_print(struct console *co, const 
char *b, unsigned count)
 {
struct vc_data *vc = vc_cons[fg_console].d;
unsigned char c;
-   static unsigned long printing;
+   static DEFINE_SPINLOCK(printing_lock);
const ushort *start;
ushort cnt = 0;
ushort myx;
 
/* console busy or not yet initialized */
-   if (!printable || test_and_set_bit(0, printing))
+   if (!printable)
+   return;
+   if (!spin_trylock(printing_lock))
return;
 
if (kmsg_redirect  vc_cons_allocated(kmsg_redirect - 1))
@@ -2481,7 +2483,7 @@ static void vt_console_print(struct console *co, const 
char *b, unsigned count)
notify_update(vc);
 
 quit:
-   clear_bit(0, printing);
+   spin_unlock(printing_lock);
 }
 
 static struct tty_driver *vt_console_device(struct console *c, int *index)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Avoid divide in IS_ALIGN

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f10db6277dfd6dffb80b2182a256d35adb3134bc
Commit: f10db6277dfd6dffb80b2182a256d35adb3134bc
Parent: b0940003f25dd3d2c54c4879809a432a35197f54
Author: Herbert Xu [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:05 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

Avoid divide in IS_ALIGN

I was happy to discover the brand new IS_ALIGN macro and quickly used it in
my code.  To my dismay I found that the generated code used division to
perform the test.

This patch fixes it by changing the % test to an .  This avoids the
division.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/kernel.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ff356b2..18222f2 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -35,7 +35,7 @@ extern const char linux_proc_banner[];
 #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
 #define __ALIGN_MASK(x,mask)   (((x)+(mask))~(mask))
 #define PTR_ALIGN(p, a)((typeof(p))ALIGN((unsigned long)(p), 
(a)))
-#define IS_ALIGNED(x,a)(((x) % ((typeof(x))(a))) == 0)
+#define IS_ALIGNED(x, a)   (((x)  ((typeof(x))(a) - 1)) == 0)
 
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


do_wait: remove one else if branch

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0a76fe8e50ee93a9d4a1badb1ec995852a6bcaf1
Commit: 0a76fe8e50ee93a9d4a1badb1ec995852a6bcaf1
Parent: f10db6277dfd6dffb80b2182a256d35adb3134bc
Author: Oleg Nesterov [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:06 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

do_wait: remove one else if branch

Minor cleanup. We can remove one else if branch.

Signed-off-by: Oleg Nesterov [EMAIL PROTECTED]
Cc: Roland McGrath [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/exit.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 9d3d0f0..eb9934a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1590,8 +1590,6 @@ repeat:
goto repeat;
if (retval != 0) /* He released the lock.  */
goto end;
-   } else if (p-exit_state == EXIT_DEAD) {
-   continue;
} else if (p-exit_state == EXIT_ZOMBIE) {
/*
 * Eligible but we cannot release it yet:
@@ -1606,7 +1604,7 @@ repeat:
/* He released the lock.  */
if (retval != 0)
goto end;
-   } else {
+   } else if (p-exit_state != EXIT_DEAD) {
 check_continued:
/*
 * It's running now, so it might later
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


proc: loadavg reading race

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=07a154b2bb9b528a39ddc777399482c1fa27fdb8
Commit: 07a154b2bb9b528a39ddc777399482c1fa27fdb8
Parent: 0a76fe8e50ee93a9d4a1badb1ec995852a6bcaf1
Author: Michal Schmidt [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:07 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

proc: loadavg reading race

The avenrun[] values are supposed to be protected by xtime_lock.
loadavg_read_proc does not use it.  Theoretically this may result in an
occasional glitch when the value read from /proc/loadavg would be as much
as 111 times higher than it should be.

Signed-off-by: Michal Schmidt [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/proc/proc_misc.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 383ff06..2686592 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -84,10 +84,15 @@ static int loadavg_read_proc(char *page, char **start, 
off_t off,
 {
int a, b, c;
int len;
+   unsigned long seq;
+
+   do {
+   seq = read_seqbegin(xtime_lock);
+   a = avenrun[0] + (FIXED_1/200);
+   b = avenrun[1] + (FIXED_1/200);
+   c = avenrun[2] + (FIXED_1/200);
+   } while (read_seqretry(xtime_lock, seq));
 
-   a = avenrun[0] + (FIXED_1/200);
-   b = avenrun[1] + (FIXED_1/200);
-   c = avenrun[2] + (FIXED_1/200);
len = sprintf(page,%d.%02d %d.%02d %d.%02d %ld/%d %d\n,
LOAD_INT(a), LOAD_FRAC(a),
LOAD_INT(b), LOAD_FRAC(b),
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs: use hlist_unhashed

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e8462caa915d4d12846db7aae2557b6db7c054d5
Commit: e8462caa915d4d12846db7aae2557b6db7c054d5
Parent: 07a154b2bb9b528a39ddc777399482c1fa27fdb8
Author: Akinobu Mita [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:07 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:04 2008 -0800

fs: use hlist_unhashed

Use hlist_unhashed() instead of opencoded equivalent.

Signed-off-by: Akinobu Mita [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/dcache.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index d9ca1e5..1c323dd 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -89,7 +89,7 @@ static void d_free(struct dentry *dentry)
if (dentry-d_op  dentry-d_op-d_release)
dentry-d_op-d_release(dentry);
/* if dentry was never inserted into hash, immediate free is OK */
-   if (dentry-d_hash.pprev == NULL)
+   if (hlist_unhashed(dentry-d_hash))
__d_free(dentry);
else
call_rcu(dentry-d_u.d_rcu, d_callback);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs: use list_for_each_entry_reverse and kill sb_entry

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=797074e44d78835adbde2ca527718b0e50226b95
Commit: 797074e44d78835adbde2ca527718b0e50226b95
Parent: e8462caa915d4d12846db7aae2557b6db7c054d5
Author: Akinobu Mita [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:08 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

fs: use list_for_each_entry_reverse and kill sb_entry

Use list_for_each_entry_reverse for super_blocks list and remove
unused sb_entry macro.

Signed-off-by: Akinobu Mita [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/fs-writeback.c  |7 ++-
 include/linux/fs.h |1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 0b30640..db80ce9 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -515,8 +515,7 @@ writeback_inodes(struct writeback_control *wbc)
might_sleep();
spin_lock(sb_lock);
 restart:
-   sb = sb_entry(super_blocks.prev);
-   for (; sb != sb_entry(super_blocks); sb = sb_entry(sb-s_list.prev)) {
+   list_for_each_entry_reverse(sb, super_blocks, s_list) {
if (sb_has_dirty_inodes(sb)) {
/* we're making our own get_super here */
sb-s_count++;
@@ -581,10 +580,8 @@ static void set_sb_syncing(int val)
 {
struct super_block *sb;
spin_lock(sb_lock);
-   sb = sb_entry(super_blocks.prev);
-   for (; sb != sb_entry(super_blocks); sb = sb_entry(sb-s_list.prev)) {
+   list_for_each_entry_reverse(sb, super_blocks, s_list)
sb-s_syncing = val;
-   }
spin_unlock(sb_lock);
 }
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e260d9a..19aab50 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown);
 extern struct list_head super_blocks;
 extern spinlock_t sb_lock;
 
-#define sb_entry(list) list_entry((list), struct super_block, s_list)
 #define S_BIAS (130)
 struct super_block {
struct list_heads_list; /* Keep this first */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NCPFS: update diagnostic strings to match routine names.

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c28cbaed6811260efc0134b984b924cd0ed46f5
Commit: 7c28cbaed6811260efc0134b984b924cd0ed46f5
Parent: 797074e44d78835adbde2ca527718b0e50226b95
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:09 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

NCPFS: update diagnostic strings to match routine names.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Cc: Petr Vandrovec [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ncpfs/inode.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index e1cb70c..eff1f18 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -987,7 +987,7 @@ static struct file_system_type ncp_fs_type = {
 static int __init init_ncp_fs(void)
 {
int err;
-   DPRINTK(ncpfs: init_module called\n);
+   DPRINTK(ncpfs: init_ncp_fs called\n);
 
err = init_inodecache();
if (err)
@@ -1004,7 +1004,7 @@ out1:
 
 static void __exit exit_ncp_fs(void)
 {
-   DPRINTK(ncpfs: cleanup_module called\n);
+   DPRINTK(ncpfs: exit_ncp_fs called\n);
unregister_filesystem(ncp_fs_type);
destroy_inodecache();
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


address hfs on-disk corruption robustness review comments

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55581d018ed3493d226e7a4d645d9c8a5af6c36b
Commit: 55581d018ed3493d226e7a4d645d9c8a5af6c36b
Parent: 7c28cbaed6811260efc0134b984b924cd0ed46f5
Author: Eric Sandeen [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:10 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

address hfs on-disk corruption robustness review comments

Address Roman's review comments for the previously sent on-disk
corruption hfs robustness patch.

- use 0 as a failure value, rather than making a new macro HFS_BAD_KEYLEN,
  and use a switch statement instead of if's.

- Add new fail: target to __hfs_brec_find to skip assignments using bad
  values when exiting with a failure.

[EMAIL PROTECTED]: coding-style fixes]
Signed-off-by: Eric Sandeen [EMAIL PROTECTED]
Cc: Roman Zippel [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/hfs/bfind.c |   11 ++-
 fs/hfs/brec.c  |4 ++--
 fs/hfs/btree.c |   26 +-
 fs/hfs/hfs.h   |2 --
 4 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/fs/hfs/bfind.c b/fs/hfs/bfind.c
index f8452a0..4129cdb 100644
--- a/fs/hfs/bfind.c
+++ b/fs/hfs/bfind.c
@@ -52,9 +52,9 @@ int __hfs_brec_find(struct hfs_bnode *bnode, struct 
hfs_find_data *fd)
rec = (e + b) / 2;
len = hfs_brec_lenoff(bnode, rec, off);
keylen = hfs_brec_keylen(bnode, rec);
-   if (keylen == HFS_BAD_KEYLEN) {
+   if (keylen == 0) {
res = -EINVAL;
-   goto done;
+   goto fail;
}
hfs_bnode_read(bnode, fd-key, off, keylen);
cmpval = bnode-tree-keycmp(fd-key, fd-search_key);
@@ -71,9 +71,9 @@ int __hfs_brec_find(struct hfs_bnode *bnode, struct 
hfs_find_data *fd)
if (rec != e  e = 0) {
len = hfs_brec_lenoff(bnode, e, off);
keylen = hfs_brec_keylen(bnode, e);
-   if (keylen == HFS_BAD_KEYLEN) {
+   if (keylen == 0) {
res = -EINVAL;
-   goto done;
+   goto fail;
}
hfs_bnode_read(bnode, fd-key, off, keylen);
}
@@ -83,6 +83,7 @@ done:
fd-keylength = keylen;
fd-entryoffset = off + keylen;
fd-entrylength = len - keylen;
+fail:
return res;
 }
 
@@ -206,7 +207,7 @@ int hfs_brec_goto(struct hfs_find_data *fd, int cnt)
 
len = hfs_brec_lenoff(bnode, fd-record, off);
keylen = hfs_brec_keylen(bnode, fd-record);
-   if (keylen == HFS_BAD_KEYLEN) {
+   if (keylen == 0) {
res = -EINVAL;
goto out;
}
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c
index 8626ee3..878bf25 100644
--- a/fs/hfs/brec.c
+++ b/fs/hfs/brec.c
@@ -49,14 +49,14 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
if (retval  node-tree-max_key_len + 2) {
printk(KERN_ERR hfs: keylen %d too large\n,
retval);
-   retval = HFS_BAD_KEYLEN;
+   retval = 0;
}
} else {
retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
if (retval  node-tree-max_key_len + 1) {
printk(KERN_ERR hfs: keylen %d too large\n,
retval);
-   retval = HFS_BAD_KEYLEN;
+   retval = 0;
}
}
}
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 110dd35..24cf6fc 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -81,15 +81,23 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, 
u32 id, btree_keycmp ke
goto fail_page;
if (!tree-node_count)
goto fail_page;
-   if ((id == HFS_EXT_CNID)  (tree-max_key_len != HFS_MAX_EXT_KEYLEN)) {
-   printk(KERN_ERR hfs: invalid extent max_key_len %d\n,
-   tree-max_key_len);
-   goto fail_page;
-   }
-   if ((id == HFS_CAT_CNID)  (tree-max_key_len != HFS_MAX_CAT_KEYLEN)) {
-   printk(KERN_ERR hfs: invalid catalog max_key_len %d\n,
-   tree-max_key_len);
-   goto fail_page;
+   switch (id) {
+   case HFS_EXT_CNID:
+   if (tree-max_key_len != HFS_MAX_EXT_KEYLEN) {
+   printk(KERN_ERR hfs: invalid extent max_key_len %d\n,
+   tree-max_key_len);
+   goto fail_page;
+   }
+   break;
+

hfs: update comment to reflect actual init and exit routines

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14b30d628446e5e4e4b313e10a90586fcf7d5638
Commit: 14b30d628446e5e4e4b313e10a90586fcf7d5638
Parent: 55581d018ed3493d226e7a4d645d9c8a5af6c36b
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:10 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

hfs: update comment to reflect actual init and exit routines

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Cc: Roman Zippel [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/hfs/super.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 16cbd90..32de44e 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -6,7 +6,7 @@
  * This file may be distributed under the terms of the GNU General Public 
License.
  *
  * This file contains hfs_read_super(), some of the super_ops and
- * init_module() and cleanup_module(). The remaining super_ops are in
+ * init_hfs_fs() and exit_hfs_fs().  The remaining super_ops are in
  * inode.c since they deal with inodes.
  *
  * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


MAINTAINERS, order AUERSWALD alphabetically

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d9851618104a21dbf5ee8260b5f2d4b5229c77e
Commit: 6d9851618104a21dbf5ee8260b5f2d4b5229c77e
Parent: 14b30d628446e5e4e4b313e10a90586fcf7d5638
Author: Jiri Slaby [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:11 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

MAINTAINERS, order AUERSWALD alphabetically

MAINTAINERS, order AUERSWALD alphabetically

Signed-off-by: Jiri Slaby [EMAIL PROTECTED]
Cc: Wolfgang Muees [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 MAINTAINERS |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index c5057d0..eacd304 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3855,6 +3855,12 @@ M:   [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 S: Maintained
 
+USB AUERSWALD DRIVER
+P: Wolfgang Muees
+M: [EMAIL PROTECTED]
+L:  [EMAIL PROTECTED]
+S: Maintained
+
 USB BLOCK DRIVER (UB ub)
 P: Pete Zaitcev
 M: [EMAIL PROTECTED]
@@ -4005,12 +4011,6 @@ S:   Maintained
 W: http://geocities.com/i0xox0i
 W: http://firstlight.net/cvs
 
-USB AUERSWALD DRIVER
-P: Wolfgang Muees
-M: [EMAIL PROTECTED]
-L:  [EMAIL PROTECTED]
-S: Maintained
-
 USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER
 P: Gary Brubaker
 M: [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


inotify: send IN_ATTRIB events when link count changes

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ece95912db94d98e202cbedb8f35206deb29d83d
Commit: ece95912db94d98e202cbedb8f35206deb29d83d
Parent: 6d9851618104a21dbf5ee8260b5f2d4b5229c77e
Author: Jan Kara [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:13 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

inotify: send IN_ATTRIB events when link count changes

Currently, no notification event has been sent when inode's link count
changed.  This is inconvenient for the application in some cases:

Suppose you have the following directory structure

foo/test
bar/

and you watch test.  If someone does mv foo/test bar/, you get event
IN_MOVE_SELF and you know something has happened with the file test.
However if someone does ln foo/test bar/test and rm foo/test you get no
inotify event for the file test (only directories foo and bar receive
events).

Furthermore it could be argued that link count belongs to file's metadata 
and
thus IN_ATTRIB should be sent when it changes.

The following patch implements sending of IN_ATTRIB inotify events when link
count of the inode changes, i.e., when a hardlink to the inode is created or
when it is removed.  This event is sent in addition to all the events sent 
so
far.  In particular, when a last link to a file is removed, IN_ATTRIB event 
is
sent in addition to IN_DELETE_SELF event.

Signed-off-by: Jan Kara [EMAIL PROTECTED]
Acked-by: Morten Welinder [EMAIL PROTECTED]
Cc: Robert Love [EMAIL PROTECTED]
Cc: John McCutchan [EMAIL PROTECTED]
Cc: Steven French [EMAIL PROTECTED]
Cc: Kamalesh Babulal [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/namei.c   |3 ++-
 include/linux/fsnotify.h |   22 ++
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 73e2e66..241cff4 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2188,6 +2188,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
 
/* We don't d_delete() NFS sillyrenamed files--they still exist. */
if (!error  !(dentry-d_flags  DCACHE_NFSFS_RENAMED)) {
+   fsnotify_link_count(dentry-d_inode);
d_delete(dentry);
}
 
@@ -2360,7 +2361,7 @@ int vfs_link(struct dentry *old_dentry, struct inode 
*dir, struct dentry *new_de
error = dir-i_op-link(old_dentry, dir, new_dentry);
mutex_unlock(old_dentry-d_inode-i_mutex);
if (!error)
-   fsnotify_create(dir, new_dentry);
+   fsnotify_link(dir, old_dentry-d_inode, new_dentry);
return error;
 }
 
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 2bd31fa..d4b7c4a 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -92,6 +92,14 @@ static inline void fsnotify_inoderemove(struct inode *inode)
 }
 
 /*
+ * fsnotify_link_count - inode's link count changed
+ */
+static inline void fsnotify_link_count(struct inode *inode)
+{
+   inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL);
+}
+
+/*
  * fsnotify_create - 'name' was linked in
  */
 static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
@@ -103,6 +111,20 @@ static inline void fsnotify_create(struct inode *inode, 
struct dentry *dentry)
 }
 
 /*
+ * fsnotify_link - new hardlink in 'inode' directory
+ * Note: We have to pass also the linked inode ptr as some filesystems leave
+ *   new_dentry-d_inode NULL and instantiate inode pointer later
+ */
+static inline void fsnotify_link(struct inode *dir, struct inode *inode, 
struct dentry *new_dentry)
+{
+   inode_dir_notify(dir, DN_CREATE);
+   inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry-d_name.name,
+ inode);
+   fsnotify_link_count(inode);
+   audit_inode_child(new_dentry-d_name.name, new_dentry, dir);
+}
+
+/*
  * fsnotify_mkdir - directory 'name' was created
  */
 static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


via-rng: enable secondary noise source on CPUs where it is present

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11025e855235144271a0e447e3650b203f8215f4
Commit: 11025e855235144271a0e447e3650b203f8215f4
Parent: ece95912db94d98e202cbedb8f35206deb29d83d
Author: Dave Jones [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:13 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

via-rng: enable secondary noise source on CPUs where it is present

In the padlock spec:

SRC Bits[9:8] Noise source select (I): These bits control the two noise
 sources on the processor that input bits to the accumulation buffers.
 On Nehemiah processors prior to stepping 8, these bits are reserved
 and undefined. The default RESET state is both bits = 0.

Signed-off-by: Dave Jones [EMAIL PROTECTED]
Tested-by: Udo van den Heuvel [EMAIL PROTECTED]
Cc: Michael Buesch [EMAIL PROTECTED]
Cc: folkert van Heusden [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/hw_random/via-rng.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c
index 868e39f..f7feae4 100644
--- a/drivers/char/hw_random/via-rng.c
+++ b/drivers/char/hw_random/via-rng.c
@@ -42,6 +42,8 @@ enum {
VIA_STRFILT_ENABLE  = (1  14),
VIA_RAWBITS_ENABLE  = (1  13),
VIA_RNG_ENABLE  = (1  6),
+   VIA_NOISESRC1   = (1  8),
+   VIA_NOISESRC2   = (1  9),
VIA_XSTORE_CNT_MASK = 0x0F,
 
VIA_RNG_CHUNK_8 = 0x00, /* 64 rand bits, 64 stored bits */
@@ -119,6 +121,7 @@ static int via_rng_data_read(struct hwrng *rng, u32 *data)
 
 static int via_rng_init(struct hwrng *rng)
 {
+   struct cpuinfo_x86 *c = cpu_data(0);
u32 lo, hi, old_lo;
 
/* Control the RNG via MSR.  Tread lightly and pay very close
@@ -134,6 +137,17 @@ static int via_rng_init(struct hwrng *rng)
lo = ~VIA_XSTORE_CNT_MASK;
lo = ~(VIA_STRFILT_ENABLE | VIA_STRFILT_FAIL | VIA_RAWBITS_ENABLE);
lo |= VIA_RNG_ENABLE;
+   lo |= VIA_NOISESRC1;
+
+   /* Enable secondary noise source on CPUs where it is present. */
+
+   /* Nehemiah stepping 8 and higher */
+   if ((c-x86_model == 9)  (c-x86_mask  7))
+   lo |= VIA_NOISESRC2;
+
+   /* Esther */
+   if (c-x86_model = 10)
+   lo |= VIA_NOISESRC2;
 
if (lo != old_lo)
wrmsr(MSR_VIA_RNG, lo, hi);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


reiserfs: complement va_start() with va_end().

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=774ed22c21ab95d582dfff38560f11cf290baeb4
Commit: 774ed22c21ab95d582dfff38560f11cf290baeb4
Parent: 11025e855235144271a0e447e3650b203f8215f4
Author: Richard Knutsson [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:15 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:05 2008 -0800

reiserfs: complement va_start() with va_end().

Complement va_start() with va_end().

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/reiserfs/prints.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 5e7388b..740bb8c 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -575,6 +575,8 @@ void print_block(struct buffer_head *bh, ...)   //int 
print_mode, int first, int l
printk
(Block %llu contains unformatted 
data\n,
 (unsigned long long)bh-b_blocknr);
+
+   va_end(args);
 }
 
 static char print_tb_buf[2048];
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


get rid of NR_OPEN and introduce a sysctl_nr_open

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9cfe015aa424b3c003baba3841a60dd9b5ad319b
Commit: 9cfe015aa424b3c003baba3841a60dd9b5ad319b
Parent: 774ed22c21ab95d582dfff38560f11cf290baeb4
Author: Eric Dumazet [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:16 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

get rid of NR_OPEN and introduce a sysctl_nr_open

NR_OPEN (historically set to 1024*1024) actually forbids processes to open
more than 1024*1024 handles.

Unfortunatly some production servers hit the not so 'ridiculously high
value' of 1024*1024 file descriptors per process.

Changing NR_OPEN is not considered safe because of vmalloc space potential
exhaust.

This patch introduces a new sysctl (/proc/sys/fs/nr_open) wich defaults to
1024*1024, so that admins can decide to change this limit if their workload
needs it.

[EMAIL PROTECTED]: export it for sparc64]
Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: Richard Henderson [EMAIL PROTECTED]
Cc: Ivan Kokshaysky [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/filesystems/proc.txt  |8 
 Documentation/sysctl/fs.txt |   10 ++
 arch/alpha/kernel/osf_sys.c |2 +-
 arch/mips/kernel/sysirix.c  |2 +-
 arch/sparc64/kernel/sparc64_ksyms.c |1 +
 arch/sparc64/solaris/fs.c   |2 +-
 arch/sparc64/solaris/timod.c|6 --
 fs/file.c   |8 +---
 include/linux/fs.h  |2 +-
 kernel/sys.c|2 +-
 kernel/sysctl.c |8 
 11 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/Documentation/filesystems/proc.txt 
b/Documentation/filesystems/proc.txt
index e2799b5..5681e2f 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1029,6 +1029,14 @@ nr_inodes
 Denotes the  number  of  inodes the system has allocated. This number will
 grow and shrink dynamically.
 
+nr_open
+---
+
+Denotes the maximum number of file-handles a process can
+allocate. Default value is 1024*1024 (1048576) which should be
+enough for most machines. Actual limit depends on RLIMIT_NOFILE
+resource limit.
+
 nr_free_inodes
 --
 
diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt
index aa986a3..f992543 100644
--- a/Documentation/sysctl/fs.txt
+++ b/Documentation/sysctl/fs.txt
@@ -23,6 +23,7 @@ Currently, these files are in /proc/sys/fs:
 - inode-max
 - inode-nr
 - inode-state
+- nr_open
 - overflowuid
 - overflowgid
 - suid_dumpable
@@ -91,6 +92,15 @@ usage of file handles and you don't need to increase the 
maximum.
 
 ==
 
+nr_open:
+
+This denotes the maximum number of file-handles a process can
+allocate. Default value is 1024*1024 (1048576) which should be
+enough for most machines. Actual limit depends on RLIMIT_NOFILE
+resource limit.
+
+==
+
 inode-max, inode-nr  inode-state:
 
 As with file handles, the kernel allocates the inode structures
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 6413c5f..72f9a61 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -430,7 +430,7 @@ sys_getpagesize(void)
 asmlinkage unsigned long
 sys_getdtablesize(void)
 {
-   return NR_OPEN;
+   return sysctl_nr_open;
 }
 
 /*
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 4c477c7..22fd41e 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -356,7 +356,7 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
retval = NGROUPS_MAX;
goto out;
case 5:
-   retval = NR_OPEN;
+   retval = sysctl_nr_open;
goto out;
case 6:
retval = 1;
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c 
b/arch/sparc64/kernel/sparc64_ksyms.c
index 60765e3..8649635 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -277,6 +277,7 @@ EXPORT_SYMBOL(sys_getpid);
 EXPORT_SYMBOL(sys_geteuid);
 EXPORT_SYMBOL(sys_getuid);
 EXPORT_SYMBOL(sys_getegid);
+EXPORT_SYMBOL(sysctl_nr_open);
 EXPORT_SYMBOL(sys_getgid);
 EXPORT_SYMBOL(svr4_getcontext);
 EXPORT_SYMBOL(svr4_setcontext);
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c
index 61be597..9311bfe 100644
--- a/arch/sparc64/solaris/fs.c
+++ b/arch/sparc64/solaris/fs.c
@@ -624,7 +624,7 @@ asmlinkage int 

synclink_gt fix missed serial input signal changes

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed8485fb340056c4d9062e9d2697c8402dd19eb0
Commit: ed8485fb340056c4d9062e9d2697c8402dd19eb0
Parent: 3dd1247f4dee214a92b42e17818703ea71233288
Author: Paul Fulghum [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:18 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

synclink_gt fix missed serial input signal changes

Fix missed serial input signal changes caused by rereading the serial
status register during interrupt processing.  Now processing is performed
on original status register value.

Signed-off-by: Paul Fulghum [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/synclink_gt.c |   68 
 1 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 5f6a5da..1f954ac 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -2039,37 +2039,41 @@ static void bh_transmit(struct slgt_info *info)
tty_wakeup(tty);
 }
 
-static void dsr_change(struct slgt_info *info)
+static void dsr_change(struct slgt_info *info, unsigned short status)
 {
-   get_signals(info);
+   if (status  BIT3) {
+   info-signals |= SerialSignal_DSR;
+   info-input_signal_events.dsr_up++;
+   } else {
+   info-signals = ~SerialSignal_DSR;
+   info-input_signal_events.dsr_down++;
+   }
DBGISR((dsr_change %s signals=%04X\n, info-device_name, 
info-signals));
if ((info-dsr_chkcount)++ == IO_PIN_SHUTDOWN_LIMIT) {
slgt_irq_off(info, IRQ_DSR);
return;
}
info-icount.dsr++;
-   if (info-signals  SerialSignal_DSR)
-   info-input_signal_events.dsr_up++;
-   else
-   info-input_signal_events.dsr_down++;
wake_up_interruptible(info-status_event_wait_q);
wake_up_interruptible(info-event_wait_q);
info-pending_bh |= BH_STATUS;
 }
 
-static void cts_change(struct slgt_info *info)
+static void cts_change(struct slgt_info *info, unsigned short status)
 {
-   get_signals(info);
+   if (status  BIT2) {
+   info-signals |= SerialSignal_CTS;
+   info-input_signal_events.cts_up++;
+   } else {
+   info-signals = ~SerialSignal_CTS;
+   info-input_signal_events.cts_down++;
+   }
DBGISR((cts_change %s signals=%04X\n, info-device_name, 
info-signals));
if ((info-cts_chkcount)++ == IO_PIN_SHUTDOWN_LIMIT) {
slgt_irq_off(info, IRQ_CTS);
return;
}
info-icount.cts++;
-   if (info-signals  SerialSignal_CTS)
-   info-input_signal_events.cts_up++;
-   else
-   info-input_signal_events.cts_down++;
wake_up_interruptible(info-status_event_wait_q);
wake_up_interruptible(info-event_wait_q);
info-pending_bh |= BH_STATUS;
@@ -2090,20 +2094,21 @@ static void cts_change(struct slgt_info *info)
}
 }
 
-static void dcd_change(struct slgt_info *info)
+static void dcd_change(struct slgt_info *info, unsigned short status)
 {
-   get_signals(info);
+   if (status  BIT1) {
+   info-signals |= SerialSignal_DCD;
+   info-input_signal_events.dcd_up++;
+   } else {
+   info-signals = ~SerialSignal_DCD;
+   info-input_signal_events.dcd_down++;
+   }
DBGISR((dcd_change %s signals=%04X\n, info-device_name, 
info-signals));
if ((info-dcd_chkcount)++ == IO_PIN_SHUTDOWN_LIMIT) {
slgt_irq_off(info, IRQ_DCD);
return;
}
info-icount.dcd++;
-   if (info-signals  SerialSignal_DCD) {
-   info-input_signal_events.dcd_up++;
-   } else {
-   info-input_signal_events.dcd_down++;
-   }
 #if SYNCLINK_GENERIC_HDLC
if (info-netcount) {
if (info-signals  SerialSignal_DCD)
@@ -2126,20 +2131,21 @@ static void dcd_change(struct slgt_info *info)
}
 }
 
-static void ri_change(struct slgt_info *info)
+static void ri_change(struct slgt_info *info, unsigned short status)
 {
-   get_signals(info);
+   if (status  BIT0) {
+   info-signals |= SerialSignal_RI;
+   info-input_signal_events.ri_up++;
+   } else {
+   info-signals = ~SerialSignal_RI;
+   info-input_signal_events.ri_down++;
+   }
DBGISR((ri_change %s signals=%04X\n, info-device_name, 
info-signals));
if ((info-ri_chkcount)++ == IO_PIN_SHUTDOWN_LIMIT) {
slgt_irq_off(info, IRQ_RI);
return;
}
-   info-icount.dcd++;
-   if (info-signals  SerialSignal_RI) {
-   

Fix __const_udelay declaration and definition mismatches

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ab24c79af5a05659f68eae3e5f232c9a15359d7
Commit: 5ab24c79af5a05659f68eae3e5f232c9a15359d7
Parent: ed8485fb340056c4d9062e9d2697c8402dd19eb0
Author: Jeff Dike [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:19 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

Fix __const_udelay declaration and definition mismatches

The declaration and implementation of __const_udelay use different
names for the parameter on a number of architectures:

include/asm-avr32/delay.h:15:extern void __const_udelay(unsigned long 
usecs);
arch/avr32/lib/delay.c:39:inline void __const_udelay(unsigned long xloops)

include/asm-sh/delay.h:15:extern void __const_udelay(unsigned long usecs);
arch/sh/lib/delay.c:22:inline void __const_udelay(unsigned long xloops)

include/asm-m32r/delay.h:15:extern void __const_udelay(unsigned long usecs);
arch/m32r/lib/delay.c:58:void __const_udelay(unsigned long xloops)

include/asm-x86/delay.h:16:extern void __const_udelay(unsigned long usecs);
arch/x86/lib/delay_32.c:82:inline void __const_udelay(unsigned long xloops)
arch/x86/lib/delay_64.c:46:inline void __const_udelay(unsigned long xloops)

The units of the parameter isn't usecs, so that name is definitely
wrong.  It's also not exactly loops, so I suppose xloops is an OK
name.

This patch changes these names from usecs to xloops.

Signed-off-by: Jeff Dike [EMAIL PROTECTED]
Cc: Haavard Skinnemoen [EMAIL PROTECTED]
Cc: Paul Mundt [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: Hirokazu Takata [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/asm-avr32/delay.h |2 +-
 include/asm-m32r/delay.h  |2 +-
 include/asm-sh/delay.h|2 +-
 include/asm-x86/delay.h   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/asm-avr32/delay.h b/include/asm-avr32/delay.h
index cc3b2e3..a0ed9a9 100644
--- a/include/asm-avr32/delay.h
+++ b/include/asm-avr32/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
 
 extern void __udelay(unsigned long usecs);
 extern void __ndelay(unsigned long nsecs);
-extern void __const_udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long xloops);
 extern void __delay(unsigned long loops);
 
 #define udelay(n) (__builtin_constant_p(n) ? \
diff --git a/include/asm-m32r/delay.h b/include/asm-m32r/delay.h
index 164448d..9dd9e99 100644
--- a/include/asm-m32r/delay.h
+++ b/include/asm-m32r/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
 
 extern void __udelay(unsigned long usecs);
 extern void __ndelay(unsigned long nsecs);
-extern void __const_udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long xloops);
 extern void __delay(unsigned long loops);
 
 #define udelay(n) (__builtin_constant_p(n) ? \
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h
index 031db84..d5d4640 100644
--- a/include/asm-sh/delay.h
+++ b/include/asm-sh/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
 
 extern void __udelay(unsigned long usecs);
 extern void __ndelay(unsigned long nsecs);
-extern void __const_udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long xloops);
 extern void __delay(unsigned long loops);
 
 #ifdef CONFIG_SUPERH32
diff --git a/include/asm-x86/delay.h b/include/asm-x86/delay.h
index d11d47f..409a649 100644
--- a/include/asm-x86/delay.h
+++ b/include/asm-x86/delay.h
@@ -13,7 +13,7 @@ extern void __bad_ndelay(void);
 
 extern void __udelay(unsigned long usecs);
 extern void __ndelay(unsigned long nsecs);
-extern void __const_udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long xloops);
 extern void __delay(unsigned long loops);
 
 /* 0x10c7 is 2**32 / 100 (rounded up) */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/char/random.c:write_pool() cond_resched() needed

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=91f3f1e304f2e9ff2c8b9c76efd4fb8ff93110f7
Commit: 91f3f1e304f2e9ff2c8b9c76efd4fb8ff93110f7
Parent: 5ab24c79af5a05659f68eae3e5f232c9a15359d7
Author: Matt Mackall [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:20 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

drivers/char/random.c:write_pool() cond_resched() needed

Reduce latency for large writes to /dev/[u]random

Signed-off-by: Matt Mackall [EMAIL PROTECTED]
Cc: Sami Farin [EMAIL PROTECTED]
Cc: Theodore Ts'o [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/random.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index c511a83..f43c89f 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1039,6 +1039,7 @@ write_pool(struct entropy_store *r, const char __user 
*buffer, size_t count)
p += bytes;
 
add_entropy_words(r, buf, (bytes + 3) / 4);
+   cond_resched();
}
 
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kill an unused PTR_ERR in bdev_cache_init()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba6f867f114760d4e43f0f93abe280ee0a0d696e
Commit: ba6f867f114760d4e43f0f93abe280ee0a0d696e
Parent: 91f3f1e304f2e9ff2c8b9c76efd4fb8ff93110f7
Author: Qi Yong [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:23 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

kill an unused PTR_ERR in bdev_cache_init()

Signed-off-by: Qi Yong [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/block_dev.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index e48a630..e63067d 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -534,7 +534,6 @@ void __init bdev_cache_init(void)
if (err)
panic(Cannot register bdev pseudo-fs);
bd_mnt = kern_mount(bd_type);
-   err = PTR_ERR(bd_mnt);
if (IS_ERR(bd_mnt))
panic(Cannot create bdev pseudo-fs);
blockdev_superblock = bd_mnt-mnt_sb;   /* For writeback */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


serial: use SGI_HAS_ZILOG for IP22_ZILOG depends

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5057c98a422d009ba644b55448601a3c4e27a50d
Commit: 5057c98a422d009ba644b55448601a3c4e27a50d
Parent: b25b7819e51f388f8c8d7ae4679a658895dc67cc
Author: Thomas Bogendoerfer [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:26 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

serial: use SGI_HAS_ZILOG for IP22_ZILOG depends

- Use SGI_HAS_ZILOG for IP22_ZILOG depends
- remove IP22 from description, because the driver works on more than
  IP22 SGI machines

Signed-off-by: Thomas Bogendoerfer [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/serial/Kconfig |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 4fa7927..43fbba4 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -877,15 +877,15 @@ config SERIAL_SUNHV
  systems.  Say Y if you want to be able to use this device.
 
 config SERIAL_IP22_ZILOG
-   tristate IP22 Zilog8530 serial support
-   depends on SGI_IP22
+   tristate SGI Zilog8530 serial support
+   depends on SGI_HAS_ZILOG
select SERIAL_CORE
help
- This driver supports the Zilog8530 serial ports found on SGI IP22
+ This driver supports the Zilog8530 serial ports found on SGI
  systems.  Say Y or M if you want to be able to these serial ports.
 
 config SERIAL_IP22_ZILOG_CONSOLE
-   bool Console on IP22 Zilog8530 serial port
+   bool Console on SGI Zilog8530 serial port
depends on SERIAL_IP22_ZILOG=y
select SERIAL_CORE_CONSOLE
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Remove rcu_assign_pointer() penalty for NULL pointers

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d99c4f6b13b3149bc83703ab1493beaeaaaf8a2d
Commit: d99c4f6b13b3149bc83703ab1493beaeaaaf8a2d
Parent: ba6f867f114760d4e43f0f93abe280ee0a0d696e
Author: Paul E. McKenney [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:25 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

Remove rcu_assign_pointer() penalty for NULL pointers

The rcu_assign_pointer() primitive currently unconditionally executes a
memory barrier, even when a NULL pointer is being assigned.  This has lead
some to avoid using rcu_assign_pointer() for NULL pointers, which loses the
self-documenting advantages of rcu_assign_pointer() This patch uses
__builtin_const_p() to omit needless memory barriers for NULL-pointer
assignments at compile time with no runtime penalty, as discussed in the
following thread:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg54852.html

Tested on x86_64 and ppc64, also compiled the four cases (NULL/non-NULL
and const/non-const) with gcc version 4.1.2, and hand-checked the
assembly output.

Signed-off-by: Paul E. McKenney [EMAIL PROTECTED]
Acked-by: Herbert Xu [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/rcupdate.h |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index d32c14d..37a642c 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -174,10 +174,13 @@ struct rcu_head {
  * code.
  */
 
-#define rcu_assign_pointer(p, v)   ({ \
-   smp_wmb(); \
-   (p) = (v); \
-   })
+#define rcu_assign_pointer(p, v) \
+   ({ \
+   if (!__builtin_constant_p(v) || \
+   ((v) != NULL)) \
+   smp_wmb(); \
+   (p) = (v); \
+   })
 
 /**
  * synchronize_sched - block until all CPUs have exited any non-preemptive
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Remove superfluous checks for CONFIG_BLK_DEV_INITRD from initramfs.c

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b25b7819e51f388f8c8d7ae4679a658895dc67cc
Commit: b25b7819e51f388f8c8d7ae4679a658895dc67cc
Parent: d99c4f6b13b3149bc83703ab1493beaeaaaf8a2d
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:25 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

Remove superfluous checks for CONFIG_BLK_DEV_INITRD from initramfs.c

Given that init/Makefile includes initramfs.c in the build only if
CONFIG_BLK_DEV_INITRD is defined, there seems to be no point checking for
it yet again.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 init/initramfs.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index 1db02a0..d53fee8 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -503,7 +503,6 @@ static int __init retain_initrd_param(char *str)
 __setup(retain_initrd, retain_initrd_param);
 
 extern char __initramfs_start[], __initramfs_end[];
-#ifdef CONFIG_BLK_DEV_INITRD
 #include linux/initrd.h
 #include linux/kexec.h
 
@@ -539,15 +538,12 @@ skip:
initrd_end = 0;
 }
 
-#endif
-
 static int __init populate_rootfs(void)
 {
char *err = unpack_to_rootfs(__initramfs_start,
 __initramfs_end - __initramfs_start, 0);
if (err)
panic(err);
-#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
 #ifdef CONFIG_BLK_DEV_RAM
int fd;
@@ -579,7 +575,6 @@ static int __init populate_rootfs(void)
free_initrd();
 #endif
}
-#endif
return 0;
 }
 rootfs_initcall(populate_rootfs);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


char: use SGI_HAS_DS1286 for SGI_DS1286 depends

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5d3f30d0a1f94b3a60c34fb2e10d7ffc936804c
Commit: f5d3f30d0a1f94b3a60c34fb2e10d7ffc936804c
Parent: 5057c98a422d009ba644b55448601a3c4e27a50d
Author: Thomas Bogendoerfer [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:26 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

char: use SGI_HAS_DS1286 for SGI_DS1286 depends

Use SGI_HAS_DS1286 for SGI_DS1286 depends

Signed-off-by: Thomas Bogendoerfer [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index eb5687b..85bf9b2 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -765,7 +765,7 @@ config JS_RTC
 
 config SGI_DS1286
tristate SGI DS1286 RTC support
-   depends on SGI_IP22
+   depends on SGI_HAS_DS1286
help
  If you say Y here and create a character special file /dev/rtc with
  major number 10 and minor number 135 using mknod (man mknod), you
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SC26XX: New serial driver for SC2681 uarts

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eea63e0e8a60d00485b47fb6e75d9aa2566b989b
Commit: eea63e0e8a60d00485b47fb6e75d9aa2566b989b
Parent: f5d3f30d0a1f94b3a60c34fb2e10d7ffc936804c
Author: Thomas Bogendoerfer [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:27 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

SC26XX: New serial driver for SC2681 uarts

New serial driver for SC2681/SC2691 uarts.  Older SNI RM400 machines are
using these chips for onboard serial ports.

Signed-off-by: Thomas Bogendoerfer [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: Torben Mathiasen [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/serial/Kconfig  |   15 +
 drivers/serial/Makefile |1 +
 drivers/serial/sc26xx.c |  755 +++
 3 files changed, 771 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 43fbba4..6a44fb1 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1318,4 +1318,19 @@ config SERIAL_QE
  This driver supports the QE serial ports on Freescale embedded
  PowerPC that contain a QUICC Engine.
 
+config SERIAL_SC26XX
+   tristate SC2681/SC2692 serial port support
+   depends on SNI_RM
+   select SERIAL_CORE
+   help
+ This is a driver for the onboard serial ports of
+ older RM400 machines.
+
+config SERIAL_SC26XX_CONSOLE
+   bool Console on SC2681/SC2692 serial port
+   depends on SERIAL_SC26XX
+   select SERIAL_CORE_CONSOLE
+   help
+ Support for Console on SC2681/SC2692 serial ports.
+
 endmenu
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 2dd41b4..640cfe4 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -55,6 +55,7 @@ obj-$(CONFIG_SERIAL_M32R_SIO) += m32r_sio.o
 obj-$(CONFIG_SERIAL_MPSC) += mpsc.o
 obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o
 obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
+obj-$(CONFIG_SERIAL_SC26XX) += sc26xx.o
 obj-$(CONFIG_SERIAL_JSM) += jsm/
 obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o
 obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o
diff --git a/drivers/serial/sc26xx.c b/drivers/serial/sc26xx.c
new file mode 100644
index 000..a350b6d
--- /dev/null
+++ b/drivers/serial/sc26xx.c
@@ -0,0 +1,755 @@
+/*
+ * SC268xx.c: Serial driver for Philiphs SC2681/SC2692 devices.
+ *
+ * Copyright (C) 2006,2007 Thomas Bogendörfer ([EMAIL PROTECTED])
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/errno.h
+#include linux/tty.h
+#include linux/tty_flip.h
+#include linux/major.h
+#include linux/circ_buf.h
+#include linux/serial.h
+#include linux/sysrq.h
+#include linux/console.h
+#include linux/spinlock.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/irq.h
+
+#if defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
+#include linux/serial_core.h
+
+#define SC26XX_MAJOR 204
+#define SC26XX_MINOR_START   205
+#define SC26XX_NR2
+
+struct uart_sc26xx_port {
+   struct uart_port  port[2];
+   u8 dsr_mask[2];
+   u8 cts_mask[2];
+   u8 dcd_mask[2];
+   u8 ri_mask[2];
+   u8 dtr_mask[2];
+   u8 rts_mask[2];
+   u8 imr;
+};
+
+/* register common to both ports */
+#define RD_ISR  0x14
+#define RD_IPR  0x34
+
+#define WR_ACR  0x10
+#define WR_IMR  0x14
+#define WR_OPCR 0x34
+#define WR_OPR_SET  0x38
+#define WR_OPR_CLR  0x3C
+
+/* access common register */
+#define READ_SC(p, r)readb((p)-membase + RD_##r)
+#define WRITE_SC(p, r, v)writeb((v), (p)-membase + WR_##r)
+
+/* register per port */
+#define RD_PORT_MRx 0x00
+#define RD_PORT_SR  0x04
+#define RD_PORT_RHR 0x0c
+
+#define WR_PORT_MRx 0x00
+#define WR_PORT_CSR 0x04
+#define WR_PORT_CR  0x08
+#define WR_PORT_THR 0x0c
+
+/* SR bits */
+#define SR_BREAK(1  7)
+#define SR_FRAME(1  6)
+#define SR_PARITY   (1  5)
+#define SR_OVERRUN  (1  4)
+#define SR_TXRDY(1  2)
+#define SR_RXRDY(1  0)
+
+#define CR_RES_MR   (1  4)
+#define CR_RES_RX   (2  4)
+#define CR_RES_TX   (3  4)
+#define CR_STRT_BRK (6  4)
+#define CR_STOP_BRK (7  4)
+#define CR_DIS_TX   (1  3)
+#define CR_ENA_TX   (1  2)
+#define CR_DIS_RX   (1  1)
+#define CR_ENA_RX   (1  0)
+
+/* ISR bits */
+#define ISR_RXRDYB  (1  5)
+#define ISR_TXRDYB  (1  4)
+#define ISR_RXRDYA  (1  1)
+#define ISR_TXRDYA  (1  0)
+
+/* IMR bits */
+#define IMR_RXRDY   (1  1)
+#define IMR_TXRDY   (1  0)
+
+/* access port register */
+static inline u8 read_sc_port(struct uart_port *p, u8 reg)
+{
+   return readb(p-membase + p-line * 0x20 + reg);
+}
+
+static inline void write_sc_port(struct uart_port *p, u8 reg, u8 

inotify: fix race

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d599e36a9ea85432587f4550acc113cd7549d12a
Commit: d599e36a9ea85432587f4550acc113cd7549d12a
Parent: eea63e0e8a60d00485b47fb6e75d9aa2566b989b
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:28 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:06 2008 -0800

inotify: fix race

There is a race between setting an inode's children's parent watched flag
when placing the first watch on a parent, and instantiating new children of
that parent: a child could miss having its flags set by
set_dentry_child_flags, but then inotify_d_instantiate might still see
!inotify_inode_watched.

The solution is to set_dentry_child_flags after adding the watch.  Locking 
is
taken care of, because both set_dentry_child_flags and inotify_d_instantiate
hold dcache_lock and child-d_locks.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Cc: Robert Love [EMAIL PROTECTED]
Cc: John McCutchan [EMAIL PROTECTED]
Cc: Jan Kara [EMAIL PROTECTED]
Cc: Yan Zheng [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/inotify.c |   13 ++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/fs/inotify.c b/fs/inotify.c
index 2c5b921..b2b109b 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -627,6 +627,7 @@ s32 inotify_add_watch(struct inotify_handle *ih, struct 
inotify_watch *watch,
  struct inode *inode, u32 mask)
 {
int ret = 0;
+   int newly_watched;
 
/* don't allow invalid bits: we don't want flags set */
mask = IN_ALL_EVENTS | IN_ONESHOT;
@@ -653,12 +654,18 @@ s32 inotify_add_watch(struct inotify_handle *ih, struct 
inotify_watch *watch,
 */
watch-inode = igrab(inode);
 
-   if (!inotify_inode_watched(inode))
-   set_dentry_child_flags(inode, 1);
-
/* Add the watch to the handle's and the inode's list */
+   newly_watched = !inotify_inode_watched(inode);
list_add(watch-h_list, ih-watches);
list_add(watch-i_list, inode-inotify_watches);
+   /*
+* Set child flags _after_ adding the watch, so there is no race
+* windows where newly instantiated children could miss their parent's
+* watched flag.
+*/
+   if (newly_watched)
+   set_dentry_child_flags(inode, 1);
+
 out:
mutex_unlock(ih-mutex);
mutex_unlock(inode-inotify_mutex);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


inotify: remove debug code

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0d71bd5993b630a989d15adc2562a9ffe41cd26d
Commit: 0d71bd5993b630a989d15adc2562a9ffe41cd26d
Parent: d599e36a9ea85432587f4550acc113cd7549d12a
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:29 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

inotify: remove debug code

The inotify debugging code is supposed to verify that the
DCACHE_INOTIFY_PARENT_WATCHED scalability optimisation does not result in
notifications getting lost nor extra needless locking generated.

Unfortunately there are also some races in the debugging code.  And it isn't
very good at finding problems anyway.  So remove it for now.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Cc: Robert Love [EMAIL PROTECTED]
Cc: John McCutchan [EMAIL PROTECTED]
Cc: Jan Kara [EMAIL PROTECTED]
Cc: Yan Zheng [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/dcache.c  |3 ---
 fs/inotify.c |   17 +
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 1c323dd..44f6cf2 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1408,9 +1408,6 @@ void d_delete(struct dentry * dentry)
if (atomic_read(dentry-d_count) == 1) {
dentry_iput(dentry);
fsnotify_nameremove(dentry, isdir);
-
-   /* remove this and other inotify debug checks after 2.6.18 */
-   dentry-d_flags = ~DCACHE_INOTIFY_PARENT_WATCHED;
return;
}
 
diff --git a/fs/inotify.c b/fs/inotify.c
index b2b109b..690e725 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -168,20 +168,14 @@ static void set_dentry_child_flags(struct inode *inode, 
int watched)
struct dentry *child;
 
list_for_each_entry(child, alias-d_subdirs, d_u.d_child) {
-   if (!child-d_inode) {
-   WARN_ON(child-d_flags  
DCACHE_INOTIFY_PARENT_WATCHED);
+   if (!child-d_inode)
continue;
-   }
+
spin_lock(child-d_lock);
-   if (watched) {
-   WARN_ON(child-d_flags 
-   DCACHE_INOTIFY_PARENT_WATCHED);
+   if (watched)
child-d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
-   } else {
-   WARN_ON(!(child-d_flags 
-   DCACHE_INOTIFY_PARENT_WATCHED));
-   child-d_flags=~DCACHE_INOTIFY_PARENT_WATCHED;
-   }
+   else
+   child-d_flags =~DCACHE_INOTIFY_PARENT_WATCHED;
spin_unlock(child-d_lock);
}
}
@@ -253,7 +247,6 @@ void inotify_d_instantiate(struct dentry *entry, struct 
inode *inode)
if (!inode)
return;
 
-   WARN_ON(entry-d_flags  DCACHE_INOTIFY_PARENT_WATCHED);
spin_lock(entry-d_lock);
parent = entry-d_parent;
if (parent-d_inode  inotify_inode_watched(parent-d_inode))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Documentation about unaligned memory access

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d156042f9fdffcb0171dc20f0d8b6df3fbf779c4
Commit: d156042f9fdffcb0171dc20f0d8b6df3fbf779c4
Parent: 0d71bd5993b630a989d15adc2562a9ffe41cd26d
Author: Daniel Drake [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:30 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

Documentation about unaligned memory access

Here's a document I wrote after figuring out what unaligned memory access
is all about.  I've tried to cover the information I was looking for when
trying to learn about this, without producing a hopelessly detailed/complex
spew.  I hope it is useful to others.

Signed-off-by: Daniel Drake [EMAIL PROTECTED]
Cc: Rob Landley [EMAIL PROTECTED]
Cc: Randy.Dunlap [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Cc: Jan Engelhardt [EMAIL PROTECTED]
Cc: Johannes Berg [EMAIL PROTECTED]
Cc: Kyle McMartin [EMAIL PROTECTED]
Cc: Kyle Moffett [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/unaligned-memory-access.txt |  226 +
 1 files changed, 226 insertions(+), 0 deletions(-)

diff --git a/Documentation/unaligned-memory-access.txt 
b/Documentation/unaligned-memory-access.txt
new file mode 100644
index 000..6223eac
--- /dev/null
+++ b/Documentation/unaligned-memory-access.txt
@@ -0,0 +1,226 @@
+UNALIGNED MEMORY ACCESSES
+=
+
+Linux runs on a wide variety of architectures which have varying behaviour
+when it comes to memory access. This document presents some details about
+unaligned accesses, why you need to write code that doesn't cause them,
+and how to write such code!
+
+
+The definition of an unaligned access
+=
+
+Unaligned memory accesses occur when you try to read N bytes of data starting
+from an address that is not evenly divisible by N (i.e. addr % N != 0).
+For example, reading 4 bytes of data from address 0x10004 is fine, but
+reading 4 bytes of data from address 0x10005 would be an unaligned memory
+access.
+
+The above may seem a little vague, as memory access can happen in different
+ways. The context here is at the machine code level: certain instructions read
+or write a number of bytes to or from memory (e.g. movb, movw, movl in x86
+assembly). As will become clear, it is relatively easy to spot C statements
+which will compile to multiple-byte memory access instructions, namely when
+dealing with types such as u16, u32 and u64.
+
+
+Natural alignment
+=
+
+The rule mentioned above forms what we refer to as natural alignment:
+When accessing N bytes of memory, the base memory address must be evenly
+divisible by N, i.e. addr % N == 0.
+
+When writing code, assume the target architecture has natural alignment
+requirements.
+
+In reality, only a few architectures require natural alignment on all sizes
+of memory access. However, we must consider ALL supported architectures;
+writing code that satisfies natural alignment requirements is the easiest way
+to achieve full portability.
+
+
+Why unaligned access is bad
+===
+
+The effects of performing an unaligned memory access vary from architecture
+to architecture. It would be easy to write a whole document on the differences
+here; a summary of the common scenarios is presented below:
+
+ - Some architectures are able to perform unaligned memory accesses
+   transparently, but there is usually a significant performance cost.
+ - Some architectures raise processor exceptions when unaligned accesses
+   happen. The exception handler is able to correct the unaligned access,
+   at significant cost to performance.
+ - Some architectures raise processor exceptions when unaligned accesses
+   happen, but the exceptions do not contain enough information for the
+   unaligned access to be corrected.
+ - Some architectures are not capable of unaligned memory access, but will
+   silently perform a different memory access to the one that was requested,
+   resulting a a subtle code bug that is hard to detect!
+
+It should be obvious from the above that if your code causes unaligned
+memory accesses to happen, your code will not work correctly on certain
+platforms and will cause performance problems on others.
+
+
+Code that does not cause unaligned access
+=
+
+At first, the concepts above may seem a little hard to relate to actual
+coding practice. After all, you don't have a great deal of control over
+memory addresses of certain variables, etc.
+
+Fortunately things are not too complex, as in most cases, the compiler
+ensures that things will work for you. For example, take the following
+structure:
+
+   struct foo {
+   u16 field1;
+   u32 field2;
+ 

drivers/char/tty_io.c: remove pty_sem

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb31005eaf3ca0705b404a78eb92f714c9449276
Commit: eb31005eaf3ca0705b404a78eb92f714c9449276
Parent: d156042f9fdffcb0171dc20f0d8b6df3fbf779c4
Author: Daniel Walker [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:31 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

drivers/char/tty_io.c: remove pty_sem

I couldn't find any users, so removing it..

Signed-off-by: Daniel Walker [EMAIL PROTECTED]
Acked-by: Alan Cox [EMAIL PROTECTED]
Cc: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/tty_io.c |1 -
 include/linux/tty.h   |1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index c927f42..b62bb67 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3721,7 +3721,6 @@ static void initialize_tty_struct(struct tty_struct *tty)
tty-buf.head = tty-buf.tail = NULL;
tty_buffer_init(tty);
INIT_DELAYED_WORK(tty-buf.work, flush_to_ldisc);
-   init_MUTEX(tty-buf.pty_sem);
mutex_init(tty-termios_mutex);
init_waitqueue_head(tty-write_wait);
init_waitqueue_head(tty-read_wait);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 402de89..5824a97 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -74,7 +74,6 @@ struct tty_buffer {
 
 struct tty_bufhead {
struct delayed_work work;
-   struct semaphore pty_sem;
spinlock_t lock;
struct tty_buffer *head;/* Queue head */
struct tty_buffer *tail;/* Active buffer */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/isdn/i4l/isdn_tty.c: remove write_sem

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4749380ed64a3bd3328b1bf32529d96aa49b
Commit: 4749380ed64a3bd3328b1bf32529d96aa49b
Parent: eb31005eaf3ca0705b404a78eb92f714c9449276
Author: Daniel Walker [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:32 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

drivers/isdn/i4l/isdn_tty.c: remove write_sem

I couldn't find any users, so removing it..

Signed-off-by: Daniel Walker [EMAIL PROTECTED]
Cc: Karsten Keil [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/isdn/i4l/isdn_tty.c |1 -
 include/linux/isdn.h|1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 9cb6e50..133eb18 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1917,7 +1917,6 @@ isdn_tty_modem_init(void)
info-owner = THIS_MODULE;
 #endif
spin_lock_init(info-readlock);
-   init_MUTEX(info-write_sem);
sprintf(info-last_cause, );
sprintf(info-last_num, none);
info-last_dir = 0;
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index d0ecc8e..9cb2855 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -507,7 +507,6 @@ typedef struct modem_info {
   struct ktermios  normal_termios;  /* For saving termios structs */
   struct ktermios  callout_termios;
   wait_queue_head_topen_wait, close_wait;
-  struct semaphore  write_sem;
   spinlock_t   readlock;
 } modem_info;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kallsyms should prefer non weak symbols

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2df3f65d0b4337cfb5b19eab3ee28b177427c49
Commit: f2df3f65d0b4337cfb5b19eab3ee28b177427c49
Parent: a6752f3f538e9dc0d0e7fdb2080532554a5eb395
Author: Paulo Marques [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:33 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

kallsyms should prefer non weak symbols

When resolving symbol names from addresses with aliased symbol names,
kallsyms_lookup always returns the first symbol, even if it is a weak
symbol.

This patch changes this by sorting the symbols with the weak symbols last
before feeding them to the kernel.  This way the kernel runtime isn't
changed at all, only the kallsyms build system is changed.

Another side effect is that the symbols get sorted by address, too.  So,
even if future binutils version have some bug in nm that makes it fail to
correctly sort symbols by address, the kernel won't be affected by this.

Mathieu says:

  I created a module in LTTng that uses kallsyms to get the symbol
  corresponding to a specific system call address.  Unfortunately, all the
  unimplemented syscalls were all referring to the (same) weak symbol
  identifying an unrelated system call rather that sys_ni (or whatever
  non-weak symbol would be expected).  Kallsyms was dumbly returning the 
first
  symbol that matched.

  This patch makes sure kallsyms returns the non-weak symbol when there is
  one, which seems to be the expected result.

[EMAIL PROTECTED]: coding-style fixes]
Signed-off-by: Mathieu Desnoyers [EMAIL PROTECTED]
Looks-great-to: Rusty Russell [EMAIL PROTECTED]
Cc: Sam Ravnborg [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 scripts/kallsyms.c |   37 ++---
 1 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 8fb8700..c912137 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -31,14 +31,13 @@
 
 #define KSYM_NAME_LEN  128
 
-
 struct sym_entry {
unsigned long long addr;
unsigned int len;
+   unsigned int start_pos;
unsigned char *sym;
 };
 
-
 static struct sym_entry *table;
 static unsigned int table_size, table_cnt;
 static unsigned long long _text, _stext, _etext, _sinittext, _einittext;
@@ -198,8 +197,10 @@ static void read_map(FILE *in)
exit (1);
}
}
-   if (read_symbol(in, table[table_cnt]) == 0)
+   if (read_symbol(in, table[table_cnt]) == 0) {
+   table[table_cnt].start_pos = table_cnt;
table_cnt++;
+   }
}
 }
 
@@ -502,6 +503,35 @@ static void optimize_token_table(void)
optimize_result();
 }
 
+static int compare_symbols(const void *a, const void *b)
+{
+   const struct sym_entry *sa;
+   const struct sym_entry *sb;
+   int wa, wb;
+
+   sa = a;
+   sb = b;
+
+   /* sort by address first */
+   if (sa-addr  sb-addr)
+   return 1;
+   if (sa-addr  sb-addr)
+   return -1;
+
+   /* sort by weakness type */
+   wa = (sa-sym[0] == 'w') || (sa-sym[0] == 'W');
+   wb = (sb-sym[0] == 'w') || (sb-sym[0] == 'W');
+   if (wa != wb)
+   return wa - wb;
+
+   /* sort by initial order, so that other symbols are left undisturbed */
+   return sa-start_pos - sb-start_pos;
+}
+
+static void sort_symbols(void)
+{
+   qsort(table, table_cnt, sizeof(struct sym_entry), compare_symbols);
+}
 
 int main(int argc, char **argv)
 {
@@ -523,6 +553,7 @@ int main(int argc, char **argv)
usage();
 
read_map(stdin);
+   sort_symbols();
optimize_token_table();
write_src();
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


relay: nopage

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a1e096129bff79ae551592539bef19bfb5c9efa1
Commit: a1e096129bff79ae551592539bef19bfb5c9efa1
Parent: f2df3f65d0b4337cfb5b19eab3ee28b177427c49
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:34 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

relay: nopage

Convert relay from nopage to fault.
Remove redundant vma range checks.
Switch from OOM to SIGBUS if the resource is not available.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Cc: Tom Zanussi [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/relay.c |   24 +---
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/kernel/relay.c b/kernel/relay.c
index 7c03733..d080b9d 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -37,37 +37,31 @@ static void relay_file_mmap_close(struct vm_area_struct 
*vma)
 }
 
 /*
- * nopage() vm_op implementation for relay file mapping.
+ * fault() vm_op implementation for relay file mapping.
  */
-static struct page *relay_buf_nopage(struct vm_area_struct *vma,
-unsigned long address,
-int *type)
+static int relay_buf_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
struct page *page;
struct rchan_buf *buf = vma-vm_private_data;
-   unsigned long offset = address - vma-vm_start;
+   pgoff_t pgoff = vmf-pgoff;
 
-   if (address  vma-vm_end)
-   return NOPAGE_SIGBUS; /* Disallow mremap */
if (!buf)
-   return NOPAGE_OOM;
+   return VM_FAULT_OOM;
 
-   page = vmalloc_to_page(buf-start + offset);
+   page = vmalloc_to_page(buf-start + (pgoff  PAGE_SHIFT));
if (!page)
-   return NOPAGE_OOM;
+   return VM_FAULT_SIGBUS;
get_page(page);
+   vmf-page = page;
 
-   if (type)
-   *type = VM_FAULT_MINOR;
-
-   return page;
+   return 0;
 }
 
 /*
  * vm_ops for relay file mappings.
  */
 static struct vm_operations_struct relay_file_mmap_ops = {
-   .nopage = relay_buf_nopage,
+   .fault = relay_buf_fault,
.close = relay_file_mmap_close,
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


uio: nopage

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a18b630d1becdf1a087de644fea080c1977bcf10
Commit: a18b630d1becdf1a087de644fea080c1977bcf10
Parent: a1e096129bff79ae551592539bef19bfb5c9efa1
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:35 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

uio: nopage

Convert uio from nopage to fault.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Acked-by: Hans J Koch [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/uio/uio.c |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index cc246fa..2a77e9d 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -417,30 +417,28 @@ static void uio_vma_close(struct vm_area_struct *vma)
idev-vma_count--;
 }
 
-static struct page *uio_vma_nopage(struct vm_area_struct *vma,
-  unsigned long address, int *type)
+static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
struct uio_device *idev = vma-vm_private_data;
-   struct page* page = NOPAGE_SIGBUS;
+   struct page *page;
 
int mi = uio_find_mem_index(vma);
if (mi  0)
-   return page;
+   return VM_FAULT_SIGBUS;
 
if (idev-info-mem[mi].memtype == UIO_MEM_LOGICAL)
page = virt_to_page(idev-info-mem[mi].addr);
else
page = vmalloc_to_page((void*)idev-info-mem[mi].addr);
get_page(page);
-   if (type)
-   *type = VM_FAULT_MINOR;
-   return page;
+   vmf-page = page;
+   return 0;
 }
 
 static struct vm_operations_struct uio_vm_ops = {
.open = uio_vma_open,
.close = uio_vma_close,
-   .nopage = uio_vma_nopage,
+   .fault = uio_vma_fault,
 };
 
 static int uio_mmap_physical(struct vm_area_struct *vma)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/char: use LIST_HEAD instead of LIST_HEAD_INIT

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bed9759b2e6bd938097389f6bd2ac8d622fa3884
Commit: bed9759b2e6bd938097389f6bd2ac8d622fa3884
Parent: a18b630d1becdf1a087de644fea080c1977bcf10
Author: Denis Cheng [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:35 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

drivers/char: use LIST_HEAD instead of LIST_HEAD_INIT

single list_head variable initialized with LIST_HEAD_INIT could almost
always can be replaced with LIST_HEAD declaration, this shrinks the code
and looks better.

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: Corey Minyard [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/hvc_console.c  |2 +-
 drivers/char/hvcs.c |2 +-
 drivers/char/ipmi/ipmi_msghandler.c |4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index 480fae2..44160d5 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -93,7 +93,7 @@ struct hvc_struct {
 };
 
 /* dynamic list of hvc_struct instances */
-static struct list_head hvc_structs = LIST_HEAD_INIT(hvc_structs);
+static LIST_HEAD(hvc_structs);
 
 /*
  * Protect the list of hvc_struct instances from inserts and removals during
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c
index 3402def..786d518 100644
--- a/drivers/char/hvcs.c
+++ b/drivers/char/hvcs.c
@@ -306,7 +306,7 @@ struct hvcs_struct {
 /* Required to back map a kref to its containing object */
 #define from_kref(k) container_of(k, struct hvcs_struct, kref)
 
-static struct list_head hvcs_structs = LIST_HEAD_INIT(hvcs_structs);
+static LIST_HEAD(hvcs_structs);
 static DEFINE_SPINLOCK(hvcs_structs_lock);
 
 static void hvcs_unthrottle(struct tty_struct *tty);
diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index 5dc1265..d01c4ff 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -365,12 +365,12 @@ static struct device_driver ipmidriver = {
 };
 static DEFINE_MUTEX(ipmidriver_mutex);
 
-static struct list_head ipmi_interfaces = LIST_HEAD_INIT(ipmi_interfaces);
+static LIST_HEAD(ipmi_interfaces);
 static DEFINE_MUTEX(ipmi_interfaces_mutex);
 
 /* List of watchers that want to know when smi's are added and
deleted. */
-static struct list_head smi_watchers = LIST_HEAD_INIT(smi_watchers);
+static LIST_HEAD(smi_watchers);
 static DEFINE_MUTEX(smi_watchers_mutex);
 
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


quota: improve inode list scanning in add_dquot_ref()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=941d2380e979dfefb6c824452e9f42be3ef948ee
Commit: 941d2380e979dfefb6c824452e9f42be3ef948ee
Parent: bed9759b2e6bd938097389f6bd2ac8d622fa3884
Author: Jan Kara [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:36 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

quota: improve inode list scanning in add_dquot_ref()

We restarted scan of sb-s_inodes list whenever we had to drop inode_lock
in add_dquot_ref().  This leads to overall quadratic running time and thus
add_dquot_ref() can take several minutes when called on a life filesystem.
We fix the problem by using the fact that inode cannot be removed from
s_inodes list while we hold a reference to it and thus we can safely
restart the scan if we don't drop the reference.  Here we use the fact that
inodes freshly added to s_inodes list are already guaranteed to have quotas
properly initialized and the ordering of inodes on s_inodes list does not
change so we cannot skip any inode.

Thanks goes to Nick [EMAIL PROTECTED] for analyzing the problem and
testing the fix.

[EMAIL PROTECTED]: iput(NULL) is legal]
Signed-off-by: Jan Kara [EMAIL PROTECTED]
Cc: Nick [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/dquot.c |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/dquot.c b/fs/dquot.c
index cee7c6f..def4e96 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -696,9 +696,8 @@ static int dqinit_needed(struct inode *inode, int type)
 /* This routine is guarded by dqonoff_mutex mutex */
 static void add_dquot_ref(struct super_block *sb, int type)
 {
-   struct inode *inode;
+   struct inode *inode, *old_inode = NULL;
 
-restart:
spin_lock(inode_lock);
list_for_each_entry(inode, sb-s_inodes, i_sb_list) {
if (!atomic_read(inode-i_writecount))
@@ -711,12 +710,18 @@ restart:
__iget(inode);
spin_unlock(inode_lock);
 
+   iput(old_inode);
sb-dq_op-initialize(inode, type);
-   iput(inode);
-   /* As we may have blocked we had better restart... */
-   goto restart;
+   /* We hold a reference to 'inode' so it couldn't have been
+* removed from s_inodes list while we dropped the inode_lock.
+* We cannot iput the inode now as we can be holding the last
+* reference and we cannot iput it under inode_lock. So we
+* keep the reference and iput it later. */
+   old_inode = inode;
+   spin_lock(inode_lock);
}
spin_unlock(inode_lock);
+   iput(old_inode);
 }
 
 /* Return 0 if dqput() won't block (note that 1 doesn't necessarily mean 
blocking) */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Add arch_ptrace_stop

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a669c2f16d478cb7f4452e5fb8d09320831f4a1
Commit: 1a669c2f16d478cb7f4452e5fb8d09320831f4a1
Parent: 941d2380e979dfefb6c824452e9f42be3ef948ee
Author: Roland McGrath [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:37 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

Add arch_ptrace_stop

This adds support to allow asm/ptrace.h to define two new macros,
arch_ptrace_stop_needed and arch_ptrace_stop.  These control special
machine-specific actions to be done before a ptrace stop.  The new code
compiles away to nothing when the new macros are not defined.  This is the
case on all machines to begin with.

On ia64, these macros will be defined to solve the long-standing issue of
ptrace vs register backing store.

Signed-off-by: Roland McGrath [EMAIL PROTECTED]
Cc: Petr Tesarik [EMAIL PROTECTED]
Cc: Tony Luck [EMAIL PROTECTED]
Cc: Matthew Wilcox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/ptrace.h |   35 +++
 kernel/signal.c|   33 -
 2 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 515bff0..6ab8071 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -204,6 +204,41 @@ static inline void user_enable_block_step(struct 
task_struct *task)
 }
 #endif /* arch_has_block_step */
 
+#ifndef arch_ptrace_stop_needed
+/**
+ * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called
+ * @code:  current-exit_code value ptrace will stop with
+ * @info:  siginfo_t pointer (or %NULL) for signal ptrace will stop with
+ *
+ * This is called with the siglock held, to decide whether or not it's
+ * necessary to release the siglock and call arch_ptrace_stop() with the
+ * same @code and @info arguments.  It can be defined to a constant if
+ * arch_ptrace_stop() is never required, or always is.  On machines where
+ * this makes sense, it should be defined to a quick test to optimize out
+ * calling arch_ptrace_stop() when it would be superfluous.  For example,
+ * if the thread has not been back to user mode since the last stop, the
+ * thread state might indicate that nothing needs to be done.
+ */
+#define arch_ptrace_stop_needed(code, info)(0)
+#endif
+
+#ifndef arch_ptrace_stop
+/**
+ * arch_ptrace_stop - Do machine-specific work before stopping for ptrace
+ * @code:  current-exit_code value ptrace will stop with
+ * @info:  siginfo_t pointer (or %NULL) for signal ptrace will stop with
+ *
+ * This is called with no locks held when arch_ptrace_stop_needed() has
+ * just returned nonzero.  It is allowed to block, e.g. for user memory
+ * access.  The arch can have machine-specific work to be done before
+ * ptrace stops.  On ia64, register backing store gets written back to user
+ * memory here.  Since this can be costly (requires dropping the siglock),
+ * we only do it when the arch requires it for this particular stop, as
+ * indicated by arch_ptrace_stop_needed().
+ */
+#define arch_ptrace_stop(code, info)   do { } while (0)
+#endif
+
 #endif
 
 #endif
diff --git a/kernel/signal.c b/kernel/signal.c
index e469715..5d30ff5 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1578,6 +1578,17 @@ static inline int may_ptrace_stop(void)
 }
 
 /*
+ * Return nonzero if there is a SIGKILL that should be waking us up.
+ * Called with the siglock held.
+ */
+static int sigkill_pending(struct task_struct *tsk)
+{
+   return ((sigismember(tsk-pending.signal, SIGKILL) ||
+sigismember(tsk-signal-shared_pending.signal, SIGKILL)) 
+   !unlikely(sigismember(tsk-blocked, SIGKILL)));
+}
+
+/*
  * This must be called with current-sighand-siglock held.
  *
  * This should be the path for all ptrace stops.
@@ -1590,6 +1601,26 @@ static inline int may_ptrace_stop(void)
  */
 static void ptrace_stop(int exit_code, int nostop_code, siginfo_t *info)
 {
+   int killed = 0;
+
+   if (arch_ptrace_stop_needed(exit_code, info)) {
+   /*
+* The arch code has something special to do before a
+* ptrace stop.  This is allowed to block, e.g. for faults
+* on user stack pages.  We can't keep the siglock while
+* calling arch_ptrace_stop, so we must release it now.
+* To preserve proper semantics, we must do this before
+* any signal bookkeeping like checking group_stop_count.
+* Meanwhile, a SIGKILL could come in before we retake the
+* siglock.  That must prevent us from sleeping in TASK_TRACED.
+* So after regaining the lock, we must check for SIGKILL.
+

tty: enable the echoing of ^C in the N_TTY discipline

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ec5b1157f8e819c72fc93aa6d2d5117c08cdc961
Commit: ec5b1157f8e819c72fc93aa6d2d5117c08cdc961
Parent: 1a669c2f16d478cb7f4452e5fb8d09320831f4a1
Author: Joe Peterson [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:38 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

tty: enable the echoing of ^C in the N_TTY discipline

Turn on INTR/QUIT/SUSP echoing in the N_TTY line discipline (e.g.  ctrl-C
will appear as ^C if stty echoctl is set and ctrl-C is set as INTR).

Linux seems to be the only unix-like OS (recently I've verified this on
Solaris, BSD, and Mac OS X) that does *not* behave this way, and I really
miss this as a good visual confirmation of the interrupt of a program in
the console or xterm.  I remember this fondly from many Unixs I've used
over the years as well.  Bringing this to Linux also seems like a good way
to make it yet more compliant with standard unix-like behavior.

[EMAIL PROTECTED]: coding-style fixes]
Cc: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/n_tty.c |   16 +++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 596c717..e0e3815 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -769,7 +769,21 @@ static inline void n_tty_receive_char(struct tty_struct 
*tty, unsigned char c)
signal = SIGTSTP;
if (c == SUSP_CHAR(tty)) {
 send_signal:
-   isig(signal, tty, 0);
+   /*
+* Echo character, and then send the signal.
+* Note that we do not use isig() here because we want
+* the order to be:
+* 1) flush, 2) echo, 3) signal
+*/
+   if (!L_NOFLSH(tty)) {
+   n_tty_flush_buffer(tty);
+   if (tty-driver-flush_buffer)
+   tty-driver-flush_buffer(tty);
+   }
+   if (L_ECHO(tty))
+   echo_char(c, tty);
+   if (tty-pgrp)
+   kill_pgrp(tty-pgrp, signal, 1);
return;
}
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


docs: kernel-locking: Convert semaphore references

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66656ebb5bf3f94aaeca1fbd369672bba980babf
Commit: 66656ebb5bf3f94aaeca1fbd369672bba980babf
Parent: ec5b1157f8e819c72fc93aa6d2d5117c08cdc961
Author: Daniel Walker [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:39 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

docs: kernel-locking: Convert semaphore references

I converted some of the document to reflect mutex usage instead of
semaphore usage.  Since we shouldin't be promoting semaphore usage when
it's on it's way out..

Signed-off-by: Daniel Walker [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 Documentation/DocBook/kernel-locking.tmpl |   32 ++--
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Documentation/DocBook/kernel-locking.tmpl 
b/Documentation/DocBook/kernel-locking.tmpl
index 01825ee..2e9d6b4 100644
--- a/Documentation/DocBook/kernel-locking.tmpl
+++ b/Documentation/DocBook/kernel-locking.tmpl
@@ -717,7 +717,7 @@ used, and when it gets full, throws out the least used one.
 para
 For our first example, we assume that all operations are in user
 context (ie. from system calls), so we can sleep.  This means we can
-use a semaphore to protect the cache and all the objects within
+use a mutex to protect the cache and all the objects within
 it.  Here's the code:
 /para
 
@@ -725,7 +725,7 @@ it.  Here's the code:
 #include lt;linux/list.hgt;
 #include lt;linux/slab.hgt;
 #include lt;linux/string.hgt;
-#include lt;asm/semaphore.hgt;
+#include lt;linux/mutex.hgt;
 #include lt;asm/errno.hgt;
 
 struct object
@@ -737,7 +737,7 @@ struct object
 };
 
 /* Protects the cache, cache_num, and the objects within it */
-static DECLARE_MUTEX(cache_lock);
+static DEFINE_MUTEX(cache_lock);
 static LIST_HEAD(cache);
 static unsigned int cache_num = 0;
 #define MAX_CACHE_SIZE 10
@@ -789,17 +789,17 @@ int cache_add(int id, const char *name)
 obj-gt;id = id;
 obj-gt;popularity = 0;
 
-down(amp;cache_lock);
+mutex_lock(amp;cache_lock);
 __cache_add(obj);
-up(amp;cache_lock);
+mutex_unlock(amp;cache_lock);
 return 0;
 }
 
 void cache_delete(int id)
 {
-down(amp;cache_lock);
+mutex_lock(amp;cache_lock);
 __cache_delete(__cache_find(id));
-up(amp;cache_lock);
+mutex_unlock(amp;cache_lock);
 }
 
 int cache_find(int id, char *name)
@@ -807,13 +807,13 @@ int cache_find(int id, char *name)
 struct object *obj;
 int ret = -ENOENT;
 
-down(amp;cache_lock);
+mutex_lock(amp;cache_lock);
 obj = __cache_find(id);
 if (obj) {
 ret = 0;
 strcpy(name, obj-gt;name);
 }
-up(amp;cache_lock);
+mutex_unlock(amp;cache_lock);
 return ret;
 }
 /programlisting
@@ -853,7 +853,7 @@ The change is shown below, in standard patch format: the
  int popularity;
  };
 
--static DECLARE_MUTEX(cache_lock);
+-static DEFINE_MUTEX(cache_lock);
 +static spinlock_t cache_lock = SPIN_LOCK_UNLOCKED;
  static LIST_HEAD(cache);
  static unsigned int cache_num = 0;
@@ -870,22 +870,22 @@ The change is shown below, in standard patch format: the
  obj-gt;id = id;
  obj-gt;popularity = 0;
 
--down(amp;cache_lock);
+-mutex_lock(amp;cache_lock);
 +spin_lock_irqsave(amp;cache_lock, flags);
  __cache_add(obj);
--up(amp;cache_lock);
+-mutex_unlock(amp;cache_lock);
 +spin_unlock_irqrestore(amp;cache_lock, flags);
  return 0;
  }
 
  void cache_delete(int id)
  {
--down(amp;cache_lock);
+-mutex_lock(amp;cache_lock);
 +unsigned long flags;
 +
 +spin_lock_irqsave(amp;cache_lock, flags);
  __cache_delete(__cache_find(id));
--up(amp;cache_lock);
+-mutex_unlock(amp;cache_lock);
 +spin_unlock_irqrestore(amp;cache_lock, flags);
  }
 
@@ -895,14 +895,14 @@ The change is shown below, in standard patch format: the
  int ret = -ENOENT;
 +unsigned long flags;
 
--down(amp;cache_lock);
+-mutex_lock(amp;cache_lock);
 +spin_lock_irqsave(amp;cache_lock, flags);
  obj = __cache_find(id);
  if (obj) {
  ret = 0;
  strcpy(name, obj-gt;name);
  }
--up(amp;cache_lock);
+-mutex_unlock(amp;cache_lock);
 +spin_unlock_irqrestore(amp;cache_lock, flags);
  return ret;
  }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/char/ipmi/ipmi_msghandler.c: use LIST_HEAD instead of LIST_HEAD_INIT

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e381d1c46037aa4191c35e7514191bb3de739cbc
Commit: e381d1c46037aa4191c35e7514191bb3de739cbc
Parent: 66656ebb5bf3f94aaeca1fbd369672bba980babf
Author: Denis Cheng [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:39 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:07 2008 -0800

drivers/char/ipmi/ipmi_msghandler.c: use LIST_HEAD instead of LIST_HEAD_INIT

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
Cc: Corey Minyard [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/ipmi/ipmi_msghandler.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index d01c4ff..32b2b22 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -441,7 +441,7 @@ struct watcher_entry {
 int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
 {
ipmi_smi_t intf;
-   struct list_head to_deliver = LIST_HEAD_INIT(to_deliver);
+   LIST_HEAD(to_deliver);
struct watcher_entry *e, *e2;
 
mutex_lock(smi_watchers_mutex);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fs/reiserfs/xattr.c: use LIST_HEAD instead of LIST_HEAD_INIT

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bcf11cbeccd7d981d68567942ba6ec184890bc29
Commit: bcf11cbeccd7d981d68567942ba6ec184890bc29
Parent: e381d1c46037aa4191c35e7514191bb3de739cbc
Author: Denis Cheng [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:40 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

fs/reiserfs/xattr.c: use LIST_HEAD instead of LIST_HEAD_INIT

Signed-off-by: Denis Cheng [EMAIL PROTECTED]
Cc: Chris Mason [EMAIL PROTECTED]
Cc: Jeff Mahoney [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/reiserfs/xattr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 1597f6b..a5bd23c 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -1084,7 +1084,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char 
*buffer, size_t size)
 }
 
 /* This is the implementation for the xattr plugin infrastructure */
-static struct list_head xattr_handlers = LIST_HEAD_INIT(xattr_handlers);
+static LIST_HEAD(xattr_handlers);
 static DEFINE_RWLOCK(handler_lock);
 
 static struct reiserfs_xattr_handler *find_xattr_handler_prefix(const char
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


stopmachine: semaphore to mutex

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c6080f74c8d83a83a1e36bce803de15c0633898
Commit: 6c6080f74c8d83a83a1e36bce803de15c0633898
Parent: bcf11cbeccd7d981d68567942ba6ec184890bc29
Author: Daniel Walker [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:41 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

stopmachine: semaphore to mutex

[EMAIL PROTECTED]: cleanup]
Signed-off-by: Daniel Walker [EMAIL PROTECTED]
Acked-by: Ingo Molnar [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/stop_machine.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 51b5ee5..6f4e0e1 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -29,7 +29,6 @@ enum stopmachine_state {
 static enum stopmachine_state stopmachine_state;
 static unsigned int stopmachine_num_threads;
 static atomic_t stopmachine_thread_ack;
-static DECLARE_MUTEX(stopmachine_mutex);
 
 static int stopmachine(void *cpu)
 {
@@ -170,6 +169,7 @@ static int do_stop(void *_smdata)
 struct task_struct *__stop_machine_run(int (*fn)(void *), void *data,
   unsigned int cpu)
 {
+   static DEFINE_MUTEX(stopmachine_mutex);
struct stop_machine_data smdata;
struct task_struct *p;
 
@@ -177,7 +177,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), 
void *data,
smdata.data = data;
init_completion(smdata.done);
 
-   down(stopmachine_mutex);
+   mutex_lock(stopmachine_mutex);
 
/* If they don't care which CPU fn runs on, bind to any online one. */
if (cpu == NR_CPUS)
@@ -193,7 +193,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), 
void *data,
wake_up_process(p);
wait_for_completion(smdata.done);
}
-   up(stopmachine_mutex);
+   mutex_unlock(stopmachine_mutex);
return p;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Amiga serial driver: port_write_mutex fixup

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cce992bcee3e1cf917956c2190d86f2e591636a9
Commit: cce992bcee3e1cf917956c2190d86f2e591636a9
Parent: 6c6080f74c8d83a83a1e36bce803de15c0633898
Author: Daniel Walker [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:41 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

Amiga serial driver: port_write_mutex fixup

The port_write_mutex was converted from a semaphore to a mutex,
but there was still this ifdef'd init_MUTEX reference remaining.

Signed-off-by: Daniel Walker [EMAIL PROTECTED]
Cc: Geert Uytterhoeven [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/ser_a2232.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 3c86914..4ba3aec 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -653,7 +653,7 @@ static void a2232_init_portstructs(void)
port-gs.closing_wait = 30 * HZ;
port-gs.rd = a2232_real_driver;
 #ifdef NEW_WRITE_LOCKING
-   init_MUTEX((port-gs.port_write_mutex));
+   mutex_init((port-gs.port_write_mutex));
 #endif
init_waitqueue_head(port-gs.open_wait);
init_waitqueue_head(port-gs.close_wait);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ext2: xip check fix

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a8e3eff4668e3a4d6dbe7985a780f91de38a3c71
Commit: a8e3eff4668e3a4d6dbe7985a780f91de38a3c71
Parent: cce992bcee3e1cf917956c2190d86f2e591636a9
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:42 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

ext2: xip check fix

ext2 should not worry about checking sb-s_blocksize for XIP before the
sb's blocksize actually gets set.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Acked-by: Carsten Otte [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/ext2/super.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 0ff8913..75af3fb 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -868,8 +868,7 @@ static int ext2_fill_super(struct super_block *sb, void 
*data, int silent)
 
blocksize = BLOCK_SIZE  le32_to_cpu(sbi-s_es-s_log_block_size);
 
-   if ((ext2_use_xip(sb))  ((blocksize != PAGE_SIZE) ||
- (sb-s_blocksize != blocksize))) {
+   if (ext2_use_xip(sb)  blocksize != PAGE_SIZE) {
if (!silent)
printk(XIP: Unsupported blocksize\n);
goto failed_mount;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


parport_serial: netmos 9855 fix

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c01106e573e2ce56a7cf4d65937ddf8f7fee1a18
Commit: c01106e573e2ce56a7cf4d65937ddf8f7fee1a18
Parent: dc999159bbc1c542f310160c56ed8b701a7d6252
Author: Christian Pellegrin [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:44 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

parport_serial: netmos 9855 fix

Fix wrong netmos 9855 serial port configuration.

On loading only one serial port was present and it wasn't working.  After
looking in the data sheet I realized that the base address was wrong.  For
further reference here is lspci and relevant dmesg output:

02:00.0 Communication controller: NetMos Technology PCI 9855 Multi-I/O
Controller (rev 01) (prog-if 02)
Subsystem: LSI Logic / Symbios Logic Unknown device 0022
Flags: medium devsel, IRQ 19
I/O ports at df00 [size=8]
I/O ports at de00 [size=8]
I/O ports at dd00 [size=8]
I/O ports at dc00 [size=8]
I/O ports at db00 [size=8]
I/O ports at da00 [size=16]

parport1: PC-style at 0xdd00 [PCSPP,TRISTATE]
parport2: PC-style at 0xdf00 [PCSPP,TRISTATE,EPP]
:02:00.0: ttyS0 at I/O 0xdb00 (irq = 19) is a 16550A
:02:00.0: ttyS1 at I/O 0xda00 (irq = 19) is a 16550A

Signed-off-by: Christian Pellegrin [EMAIL PROTECTED]
Cc: Thomas Richter [EMAIL PROTECTED]
Cc: Bjorn Helgaas [EMAIL PROTECTED]
Cc: Martin Schitter [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/parport/parport_serial.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index bd6ad8b..e2e95b3 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -77,7 +77,7 @@ static struct parport_pc_pci cards[] __devinitdata = {
/* titan_110l */{ 1, { { 3, -1 }, } },
/* titan_210l */{ 1, { { 3, -1 }, } },
/* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, 
netmos_parallel_init },
-   /* netmos_9855 */   { 1, { { 0, -1 }, }, 
netmos_parallel_init },
+   /* netmos_9855 */   { 1, { { 2, -1 }, }, 
netmos_parallel_init },
/* avlab_1s1p */{ 1, { { 1, 2}, } },
/* avlab_1s2p */{ 2, { { 1, 2}, { 3, 4 },} },
/* avlab_2s1p */{ 1, { { 2, 3}, } },
@@ -185,7 +185,7 @@ static struct pciserial_board pci_parport_serial_boards[] 
__devinitdata = {
.uart_offset= 8,
},
[netmos_9855] = {
-   .flags  = FL_BASE2 | FL_BASE_BARS,
+   .flags  = FL_BASE4 | FL_BASE_BARS,
.num_ports  = 1,
.base_baud  = 115200,
.uart_offset= 8,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ik8: add Dell UK 6400 Inspiron model (MM061)

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a9000d037d7dd08ac46168560b3a3d3bb743bfa6
Commit: a9000d037d7dd08ac46168560b3a3d3bb743bfa6
Parent: b75cb06f72a8efebc8e1a66af4b8362172a3b661
Author: Nick Warne [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:47 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

ik8: add Dell UK 6400 Inspiron model (MM061)

Add the Dell UK 6400 Inspiron model (MM061) to allow the i8k module to load
correctly without using 'force=1'

Signed-off-by: Nick Warne [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/i8k.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index 30e5645..179223a 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -439,6 +439,13 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, Latitude),
},
},
+   {   /* UK Inspiron 6400  */
+   .ident = Dell Inspiron 3,
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, Dell Inc.),
+   DMI_MATCH(DMI_PRODUCT_NAME, MM061),
+   },
+   },
{ }
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


parport_pc: detection for SuperIO IT87XX POST

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f63fd7e299ee13da071ecfce2b90b58c5e1562b1
Commit: f63fd7e299ee13da071ecfce2b90b58c5e1562b1
Parent: a9000d037d7dd08ac46168560b3a3d3bb743bfa6
Author: Petr Cvek [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:48 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

parport_pc: detection for SuperIO IT87XX POST

Add detection for IT87XX SuperIO chip and disabling its POST feature, which
made noise on parallel port's pins.

Signed-off-by: Petr Cvek [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/parport/parport_pc.c |   45 -
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index db26b40..238628d 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -1540,6 +1540,38 @@ static void __devinit detect_and_report_smsc (void)
smsc_check(0x3f0,0x44);
smsc_check(0x370,0x44);
 }
+
+static void __devinit detect_and_report_it87(void)
+{
+   u16 dev;
+   u8 r;
+   if (verbose_probing)
+   printk(KERN_DEBUG IT8705 Super-IO detection, now testing port 
2E ...\n);
+   if (!request_region(0x2e, 1, __FUNCTION__))
+   return;
+   outb(0x87, 0x2e);
+   outb(0x01, 0x2e);
+   outb(0x55, 0x2e);
+   outb(0x55, 0x2e);
+   outb(0x20, 0x2e);
+   dev = inb(0x2f)  8;
+   outb(0x21, 0x2e);
+   dev |= inb(0x2f);
+   if (dev == 0x8712 || dev == 0x8705 || dev == 0x8715 ||
+   dev == 0x8716 || dev == 0x8718 || dev == 0x8726) {
+   printk(KERN_INFO IT%04X SuperIO detected.\n, dev);
+   outb(0x07, 0x2E);   /* Parallel Port */
+   outb(0x03, 0x2F);
+   outb(0xF0, 0x2E);   /* BOOT 0x80 off */
+   r = inb(0x2f);
+   outb(0xF0, 0x2E);
+   outb(r | 8, 0x2F);
+   outb(0x02, 0x2E);   /* Lock */
+   outb(0x02, 0x2F);
+
+   release_region(0x2e, 1);
+   }
+}
 #endif /* CONFIG_PARPORT_PC_SUPERIO */
 
 static int get_superio_dma (struct parport *p)
@@ -3164,24 +3196,25 @@ static void __init parport_pc_find_ports (int autoirq, 
int autodma)
int count = 0, err;
 
 #ifdef CONFIG_PARPORT_PC_SUPERIO
-   detect_and_report_winbond ();
-   detect_and_report_smsc ();
+   detect_and_report_it87();
+   detect_and_report_winbond();
+   detect_and_report_smsc();
 #endif
 
/* Onboard SuperIO chipsets that show themselves on the PCI bus. */
-   count += parport_pc_init_superio (autoirq, autodma);
+   count += parport_pc_init_superio(autoirq, autodma);
 
/* PnP ports, skip detection if SuperIO already found them */
if (!count) {
-   err = pnp_register_driver (parport_pc_pnp_driver);
+   err = pnp_register_driver(parport_pc_pnp_driver);
if (!err)
pnp_registered_parport = 1;
}
 
/* ISA ports and whatever (see asm/parport.h). */
-   parport_pc_find_nonpci_ports (autoirq, autodma);
+   parport_pc_find_nonpci_ports(autoirq, autodma);
 
-   err = pci_register_driver (parport_pc_pci_driver);
+   err = pci_register_driver(parport_pc_pci_driver);
if (!err)
pci_registered_parport = 1;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kernel/params.c: remove sparse-warning (different signedness)

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eb38a996ebacefe4ce2274de901138505d9cc96b
Commit: eb38a996ebacefe4ce2274de901138505d9cc96b
Parent: 15ae02baf025750cd79ef3929c28f7083a088bd2
Author: Richard Knutsson [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:50 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

kernel/params.c: remove sparse-warning (different signedness)

Fixing:
  CHECK   kernel/params.c
kernel/params.c:329:41: warning: incorrect type in argument 8 (different 
signedness)
kernel/params.c:329:41:expected int *num
kernel/params.c:329:41:got unsigned int *

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 kernel/params.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 42fe5e6..e28c706 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -272,7 +272,7 @@ static int param_array(const char *name,
   unsigned int min, unsigned int max,
   void *elem, int elemsize,
   int (*set)(const char *, struct kernel_param *kp),
-  int *num)
+  unsigned int *num)
 {
int ret;
struct kernel_param kp;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


lib/extable.c: remove an expensive integer divide in search_extable()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15ae02baf025750cd79ef3929c28f7083a088bd2
Commit: 15ae02baf025750cd79ef3929c28f7083a088bd2
Parent: f63fd7e299ee13da071ecfce2b90b58c5e1562b1
Author: Eric Dumazet [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:49 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

lib/extable.c: remove an expensive integer divide in search_extable()

Actual code let compiler generates idiv instruction on x86.

Using a right shift is OK here and readable as well.

Before patch
   10:   57  push   %edi
   11:   56  push   %esi
   12:   89 d6   mov%edx,%esi
   14:   53  push   %ebx
   15:   89 c3   mov%eax,%ebx
   17:   eb 22   jmp3b search_extable+0x2b
   19:   89 f0   mov%esi,%eax
   1b:   ba 02 00 00 00  mov$0x2,%edx
   20:   29 d8   sub%ebx,%eax
   22:   89 d7   mov%edx,%edi
   24:   c1 f8 03sar$0x3,%eax
   27:   99  cltd
   28:   f7 ff   idiv   %edi
   2a:   8d 04 c3lea(%ebx,%eax,8),%eax
   2d:   39 08   cmp%ecx,(%eax)
...

After patch

0010 search_extable:
   10:   53  push   %ebx
   11:   89 c3   mov%eax,%ebx
   13:   eb 18   jmp2d search_extable+0x1d
   15:   89 d0   mov%edx,%eax
   17:   29 d8   sub%ebx,%eax
   19:   c1 f8 04sar$0x4,%eax
   1c:   8d 04 c3lea(%ebx,%eax,8),%eax
   1f:   39 08   cmp%ecx,(%eax)
...

Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 lib/extable.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/extable.c b/lib/extable.c
index 463f456..179c087 100644
--- a/lib/extable.c
+++ b/lib/extable.c
@@ -57,10 +57,10 @@ search_extable(const struct exception_table_entry *first,
while (first = last) {
const struct exception_table_entry *mid;
 
-   mid = (last - first) / 2 + first;
+   mid = ((last - first)  1) + first;
/*
-* careful, the distance between entries can be
-* larger than 2GB:
+* careful, the distance between value and insn
+* can be larger than MAX_LONG:
 */
if (mid-insn  value)
first = mid + 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


calibrate_delay() must be __cpuinit

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c81c32f9616fd6f2795dceae2f70943cb4d8609
Commit: 6c81c32f9616fd6f2795dceae2f70943cb4d8609
Parent: eb38a996ebacefe4ce2274de901138505d9cc96b
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:51 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

calibrate_delay() must be __cpuinit

calibrate_delay() must be __cpuinit, not __{dev,}init.

I've verified that this is correct for all users.

While doing the latter, I also did the following cleanups:
- remove pointless additional prototypes in C files
- ensure all users #include linux/delay.h

This fixes the following section mismatches with CONFIG_HOTPLUG=n,
CONFIG_HOTPLUG_CPU=y:

WARNING: vmlinux.o(.text+0x1128d): Section mismatch: reference to 
.init.text.1:calibrate_delay (between 'check_cx686_slop' and 'set_cx86_reorder')
WARNING: vmlinux.o(.text+0x25102): Section mismatch: reference to 
.init.text.1:calibrate_delay (between 'smp_callin' and 'cpu_coregroup_map')

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Ivan Kokshaysky [EMAIL PROTECTED]
Cc: Richard Henderson [EMAIL PROTECTED]
Cc: Luck, Tony [EMAIL PROTECTED]
Cc: Ralf Baechle [EMAIL PROTECTED]
Cc: Paul Mackerras [EMAIL PROTECTED]
Cc: Benjamin Herrenschmidt [EMAIL PROTECTED]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: Christian Zankel [EMAIL PROTECTED]
Cc: Heiko Carstens [EMAIL PROTECTED]
Cc: Martin Schwidefsky [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/alpha/kernel/smp.c  |4 
 arch/frv/kernel/setup.c  |2 +-
 arch/ia64/kernel/smpboot.c   |1 -
 arch/mips/kernel/smp.c   |1 -
 arch/powerpc/platforms/powermac/cpufreq_32.c |2 --
 arch/sparc/kernel/sun4d_smp.c|4 +---
 arch/sparc/kernel/sun4m_smp.c|5 ++---
 arch/sparc64/kernel/smp.c|2 --
 arch/x86/kernel/cpu/cyrix.c  |2 --
 arch/x86/kernel/smpboot_32.c |2 --
 arch/x86/mach-voyager/voyager_smp.c  |2 --
 arch/xtensa/kernel/time.c|2 +-
 drivers/s390/sysinfo.c   |2 +-
 init/calibrate.c |6 +++---
 14 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index f4ab233..63c2073 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -77,10 +77,6 @@ int smp_num_probed;  /* Internal processor count */
 int smp_num_cpus = 1;  /* Number that came online.  */
 EXPORT_SYMBOL(smp_num_cpus);
 
-extern void calibrate_delay(void);
-
-
-
 /*
  * Called by both boot and secondaries to move global data into
  *  per-processor storage.
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
index a74c087..b38ae1f 100644
--- a/arch/frv/kernel/setup.c
+++ b/arch/frv/kernel/setup.c
@@ -708,7 +708,7 @@ static void __init reserve_dma_coherent(void)
 /*
  * calibrate the delay loop
  */
-void __init calibrate_delay(void)
+void __cpuinit calibrate_delay(void)
 {
loops_per_jiffy = __delay_loops_MHz * (100 / HZ);
 
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 480b1a5..328fd2f 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -120,7 +120,6 @@ static volatile unsigned long go[SLAVE + 1];
 
 #define DEBUG_ITC_SYNC 0
 
-extern void __devinit calibrate_delay (void);
 extern void start_ap (void);
 extern unsigned long ia64_iobase;
 
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 1e5dfc2..9d41dab 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -52,7 +52,6 @@ int __cpu_logical_map[NR_CPUS];   /* Map logical 
to physical */
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-extern void __init calibrate_delay(void);
 extern void cpu_idle(void);
 
 /* Number of TCs (or siblings in Intel speak) per CPU core */
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c 
b/arch/powerpc/platforms/powermac/cpufreq_32.c
index c04abcc..792d3ce 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_32.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c
@@ -113,8 +113,6 @@ static inline void debug_calc_bogomips(void)
 * result. We backup/restore the value to avoid affecting the
 * core cpufreq framework's own calculation.
 */
-   extern void calibrate_delay(void);
-
unsigned long save_lpj = loops_per_jiffy;
calibrate_delay();
loops_per_jiffy = save_lpj;
diff --git a/arch/sparc/kernel/sun4d_smp.c 

idle_regs() must be __cpuinit

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b2fb3c65844452bb9e8b449d50863d1b36c5dc0
Commit: 6b2fb3c65844452bb9e8b449d50863d1b36c5dc0
Parent: 6c81c32f9616fd6f2795dceae2f70943cb4d8609
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:55 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:08 2008 -0800

idle_regs() must be __cpuinit

Fix the following section mismatch with CONFIG_HOTPLUG=n,
CONFIG_HOTPLUG_CPU=y:

WARNING: vmlinux.o(.text+0x399a6): Section mismatch: reference to 
.init.text.5:idle_regs (between 'fork_idle' and 'get_task_mm')

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: Luck, Tony [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/ia64/kernel/smpboot.c   |2 +-
 arch/x86/kernel/cpu/common.c |2 +-
 kernel/fork.c|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 328fd2f..32ee597 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -476,7 +476,7 @@ start_secondary (void *unused)
return 0;
 }
 
-struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
+struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
 {
return NULL;
 }
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index d9313d9..f86a3c4 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -637,7 +637,7 @@ void __init early_cpu_init(void)
 }
 
 /* Make sure %fs is initialized properly in idle threads */
-struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
+struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs)
 {
memset(regs, 0, sizeof(struct pt_regs));
regs-fs = __KERNEL_PERCPU;
diff --git a/kernel/fork.c b/kernel/fork.c
index 8adfe5d..3995297 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1399,7 +1399,7 @@ fork_out:
return ERR_PTR(retval);
 }
 
-noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct 
pt_regs *regs)
+noinline struct pt_regs * __cpuinit __attribute__((weak)) idle_regs(struct 
pt_regs *regs)
 {
memset(regs, 0, sizeof(struct pt_regs));
return regs;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


kernel/sys.c: get rid of expensive divides in groups_sort()

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1bf47346d75790ebd2563d909d48046961c7ffd5
Commit: 1bf47346d75790ebd2563d909d48046961c7ffd5
Parent: 6b2fb3c65844452bb9e8b449d50863d1b36c5dc0
Author: Eric Dumazet [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:56 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:09 2008 -0800

kernel/sys.c: get rid of expensive divides in groups_sort()

groups_sort() can be quite long if user loads a large gid table.

This is because GROUP_AT(group_info, some_integer) uses an integer divide.
So having to do XXX thousand divides during one syscall can lead to very
high latencies.  (NGROUPS_MAX=65536)

In the past (25 Mar 2006), an analog problem was found in groups_search()
(commit d74beb9f33a5f16d2965f11b275e401f225c949d ) and at that time I
changed some variables to unsigned int.

I believe that a more generic fix is to make sure NGROUPS_PER_BLOCK is
unsigned.

Signed-off-by: Eric Dumazet [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/sched.h |2 +-
 kernel/sys.c  |   20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9c13be3..7c8ca05 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -810,7 +810,7 @@ static inline int above_background_load(void)
 
 struct io_context; /* See blkdev.h */
 #define NGROUPS_SMALL  32
-#define NGROUPS_PER_BLOCK  ((int)(PAGE_SIZE / sizeof(gid_t)))
+#define NGROUPS_PER_BLOCK  ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
 struct group_info {
int ngroups;
atomic_t usage;
diff --git a/kernel/sys.c b/kernel/sys.c
index 2b8e2da..e3c08d4 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1145,16 +1145,16 @@ static int groups_to_user(gid_t __user *grouplist,
 struct group_info *group_info)
 {
int i;
-   int count = group_info-ngroups;
+   unsigned int count = group_info-ngroups;
 
for (i = 0; i  group_info-nblocks; i++) {
-   int cp_count = min(NGROUPS_PER_BLOCK, count);
-   int off = i * NGROUPS_PER_BLOCK;
-   int len = cp_count * sizeof(*grouplist);
+   unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
+   unsigned int len = cp_count * sizeof(*grouplist);
 
-   if (copy_to_user(grouplist+off, group_info-blocks[i], len))
+   if (copy_to_user(grouplist, group_info-blocks[i], len))
return -EFAULT;
 
+   grouplist += NGROUPS_PER_BLOCK;
count -= cp_count;
}
return 0;
@@ -1165,16 +1165,16 @@ static int groups_from_user(struct group_info 
*group_info,
 gid_t __user *grouplist)
 {
int i;
-   int count = group_info-ngroups;
+   unsigned int count = group_info-ngroups;
 
for (i = 0; i  group_info-nblocks; i++) {
-   int cp_count = min(NGROUPS_PER_BLOCK, count);
-   int off = i * NGROUPS_PER_BLOCK;
-   int len = cp_count * sizeof(*grouplist);
+   unsigned int cp_count = min(NGROUPS_PER_BLOCK, count);
+   unsigned int len = cp_count * sizeof(*grouplist);
 
-   if (copy_from_user(group_info-blocks[i], grouplist+off, len))
+   if (copy_from_user(group_info-blocks[i], grouplist, len))
return -EFAULT;
 
+   grouplist += NGROUPS_PER_BLOCK;
count -= cp_count;
}
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix IXANY and restart after signal (e.g. ctrl-C) in n_tty line discipline

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54d2a37eda3211d3b14c162238e9ccee43e023a9
Commit: 54d2a37eda3211d3b14c162238e9ccee43e023a9
Parent: 1373bed34e30b8632aaf43aa85d72329c83f7077
Author: Joe Peterson [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:59 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:09 2008 -0800

Fix IXANY and restart after signal (e.g. ctrl-C) in n_tty line discipline

Fix two N_TTY line discipline issues related to resuming a stopped TTY
(typically done with ctrl-S):

1) Fix handling of character that resumes a stopped TTY (with IXANY)

With stty ixany, the TTY line discipline would lose the first character
after the stop, so typing, for example, hi^Sthere resulted in hihere
(the 't' would cause the resume after ^S, but it would then be thrown away
rather than processed as an input character).  This was inconsistent with
the behavior of other Unix systems.

2) Fix interrupt signal (e.g. ctrl-C) behavior in stopped TTYs

With stty -ixany (often the default), interrupt signals were ignored
in a stopped TTY until the TTY was resumed with the start char (typically
ctrl-Q), which was inconsistent with the behavior of other Unix systems.

Signed-off-by: Joe Peterson [EMAIL PROTECTED]
Cc: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/char/n_tty.c |   11 +--
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index e0e3815..90c3969 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -695,17 +695,16 @@ static inline void n_tty_receive_char(struct tty_struct 
*tty, unsigned char c)
return;
}

-   if (tty-stopped  !tty-flow_stopped 
-   I_IXON(tty)  I_IXANY(tty)) {
-   start_tty(tty);
-   return;
-   }
-   
if (I_ISTRIP(tty))
c = 0x7f;
if (I_IUCLC(tty)  L_IEXTEN(tty))
c=tolower(c);
 
+   if (tty-stopped  !tty-flow_stopped  I_IXON(tty) 
+   ((I_IXANY(tty)  c != START_CHAR(tty)  c != STOP_CHAR(tty)) ||
+c == INTR_CHAR(tty) || c == QUIT_CHAR(tty)))
+   start_tty(tty);
+
if (tty-closing) {
if (I_IXON(tty)) {
if (c == START_CHAR(tty))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


make sys_poll() wait at least timeout ms

2008-02-06 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=844fcc53962d781aab7c164acbfa46505427375e
Commit: 844fcc53962d781aab7c164acbfa46505427375e
Parent: 54d2a37eda3211d3b14c162238e9ccee43e023a9
Author: Karsten Wiese [EMAIL PROTECTED]
AuthorDate: Wed Feb 6 01:37:59 2008 -0800
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Wed Feb 6 10:41:09 2008 -0800

make sys_poll() wait at least timeout ms

schedule_timeout(jiffies) waits for at least jiffies - 1.  Add 1 jiffie to
the timeout_jiffies calculated in sys_poll() to wait at least
timeout_msecs, like poll() manpage says.

Signed-off-by: Karsten Wiese [EMAIL PROTECTED]
Cc: Ingo Molnar [EMAIL PROTECTED]
Cc: Thomas Gleixner [EMAIL PROTECTED]
Cc: H. Peter Anvin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 fs/select.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/select.c b/fs/select.c
index 47f4792..5633fe9 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -739,7 +739,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, 
unsigned int nfds,
timeout_jiffies = -1;
else
 #endif
-   timeout_jiffies = msecs_to_jiffies(timeout_msecs);
+   timeout_jiffies = msecs_to_jiffies(timeout_msecs) + 1;
} else {
/* Infinite ( 0) or no (0) timeout */
timeout_jiffies = timeout_msecs;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   4   >