]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
14 years agomemcg: avoid use cmpxchg in swap cgroup maintainance
KAMEZAWA Hiroyuki [Mon, 15 Mar 2010 04:34:57 +0000 (00:34 -0400)]
memcg: avoid use cmpxchg in swap cgroup maintainance

swap_cgroup uses 2bytes data and uses cmpxchg in a new operation.  2byte
cmpxchg/xchg is not available on some archs.  This patch replaces
cmpxchg/xchg with operations under lock.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reported-by: Sachin Sant <sachinp@in.ibm.com> wrote:
Acked-by: Balbir Singh <balbir@in.ibm.com>
Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agogigaset: fix build failure
Tilman Schmidt [Wed, 17 Mar 2010 21:22:07 +0000 (14:22 -0700)]
gigaset: fix build failure

Update the dummy LL interface to the LL interface change
introduced by commit daab433c03c15fd642c71c94eb51bdd3f32602c8.
This fixes the build failure occurring after that commit when
enabling ISDN_DRV_GIGASET but neither ISDN_I4L nor ISDN_CAPI.

Impact: bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoahci: pp->active_link is not reliable when FBS is enabled
Shane Huang [Tue, 16 Mar 2010 10:08:55 +0000 (18:08 +0800)]
ahci: pp->active_link is not reliable when FBS is enabled

pp->active_link is not reliable when FBS is enabled.
Both PORT_SCR_ACT and PORT_CMD_ISSUE should be checked
because mixed NCQ and non-NCQ commands may be in flight.

Signed-off-by: Shane Huang <shane.huang@amd.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoahci: use BIOS date in broken_suspend list
Tejun Heo [Tue, 16 Mar 2010 00:50:26 +0000 (09:50 +0900)]
ahci: use BIOS date in broken_suspend list

HP is recycling both DMI_PRODUCT_NAME and DMI_BIOS_VERSION making
ahci_broken_suspend() trigger for later products which are not
affected by the original problems.  Match BIOS date instead of version
and add references to bko's so that full information can be found
easier later.

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=15462

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: tigerfishdaisy@gmail.com
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoahci: add missing nv IDs
Tejun Heo [Thu, 11 Mar 2010 02:37:16 +0000 (11:37 +0900)]
ahci: add missing nv IDs

bko#15481 shows that we're missing some NVIDIA ahci PCI IDs.  Peer
Chen confirms that IDs 0x580-0x58f are reserved for cases where Linux
ID option is selected in the BIOS and are only used for mcp65-73.  Add
0x0581-0x058f.

  http://bugzilla.kernel.org/show_bug.cgi?id=15481

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peer Chen <pchen@nvidia.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
14 years agoperf: Fix unexported generic perf_arch_fetch_caller_regs
Frederic Weisbecker [Tue, 16 Mar 2010 00:05:02 +0000 (01:05 +0100)]
perf: Fix unexported generic perf_arch_fetch_caller_regs

perf_arch_fetch_caller_regs() is exported for the overriden x86
version, but not for the generic weak version.

As a general rule, weak functions should not have their symbol
exported in the same file they are defined.

So let's export it on trace_event_perf.c as it is used by trace
events only.

This fixes:

ERROR: ".perf_arch_fetch_caller_regs" [fs/xfs/xfs.ko] undefined!
ERROR: ".perf_arch_fetch_caller_regs" [arch/powerpc/platforms/cell/spufs/spufs.ko] undefined!

-v2: And also only build it if trace events are enabled.
-v3: Fix changelog mistake

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1268697902-9518-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Wed, 17 Mar 2010 08:01:38 +0000 (09:01 +0100)]
Merge branch 'fix/hda' into for-linus

14 years agoMerge branch 'fix/misc' into for-linus
Takashi Iwai [Wed, 17 Mar 2010 08:01:33 +0000 (09:01 +0100)]
Merge branch 'fix/misc' into for-linus

14 years agosunxvr1000: Add missing FB=y depenency.
David S. Miller [Tue, 16 Mar 2010 21:40:42 +0000 (14:40 -0700)]
sunxvr1000: Add missing FB=y depenency.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: Make first arg to deliver_clone const.
David S. Miller [Tue, 16 Mar 2010 21:37:47 +0000 (14:37 -0700)]
bridge: Make first arg to deliver_clone const.

Otherwise we get a warning from the call in br_forward().

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge br_multicast: Don't refer to BR_INPUT_SKB_CB(skb)->mrouters_only without IGMP...
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 15 Mar 2010 21:51:18 +0000 (21:51 +0000)]
bridge br_multicast: Don't refer to BR_INPUT_SKB_CB(skb)->mrouters_only without IGMP snooping.

Without CONFIG_BRIDGE_IGMP_SNOOPING,
BR_INPUT_SKB_CB(skb)->mrouters_only is not appropriately
initialized, so we can see garbage.

A clear option to fix this is to set it even without that
config, but we cannot optimize out the branch.

Let's introduce a macro that returns value of mrouters_only
and let it return 0 without CONFIG_BRIDGE_IGMP_SNOOPING.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoroute: Fix caught BUG_ON during rt_secret_rebuild_oneshot()
Vitaliy Gusev [Tue, 16 Mar 2010 01:07:51 +0000 (01:07 +0000)]
route: Fix caught BUG_ON during rt_secret_rebuild_oneshot()

route: Fix caught BUG_ON during rt_secret_rebuild_oneshot()

Call rt_secret_rebuild can cause BUG_ON(timer_pending(&net->ipv4.rt_secret_timer)) in
add_timer as there is not any synchronization for call rt_secret_rebuild_oneshot()
for the same net namespace.

Also this issue affects to rt_secret_reschedule().

Thus use mod_timer enstead.

Signed-off-by: Vitaliy Gusev <vgusev@openvz.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge br_multicast: Fix skb leakage in error path.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 15 Mar 2010 19:26:56 +0000 (19:26 +0000)]
bridge br_multicast: Fix skb leakage in error path.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge br_multicast: Fix handling of Max Response Code in IGMPv3 message.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 15 Mar 2010 19:27:00 +0000 (19:27 +0000)]
bridge br_multicast: Fix handling of Max Response Code in IGMPv3 message.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoNET: netpoll, fix potential NULL ptr dereference
Jiri Slaby [Tue, 16 Mar 2010 05:29:54 +0000 (05:29 +0000)]
NET: netpoll, fix potential NULL ptr dereference

Stanse found that one error path in netpoll_setup dereferences npinfo
even though it is NULL. Avoid that by adding new label and go to that
instead.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Daniel Borkmann <danborkmann@googlemail.com>
Cc: David S. Miller <davem@davemloft.net>
Acked-by: chavey@google.com
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotipc: fix lockdep warning on address assignment
Neil Horman [Tue, 16 Mar 2010 08:14:33 +0000 (08:14 +0000)]
tipc: fix lockdep warning on address assignment

So in the forward porting of various tipc packages, I was constantly
getting this lockdep warning everytime I used tipc-config to set a network
address for the protocol:

[ INFO: possible circular locking dependency detected ]
2.6.33 #1
tipc-config/1326 is trying to acquire lock:
(ref_table_lock){+.-...}, at: [<ffffffffa0315148>] tipc_ref_discard+0x53/0xd4 [tipc]

but task is already holding lock:
(&(&entry->lock)->rlock#2){+.-...}, at: [<ffffffffa03150d5>] tipc_ref_lock+0x43/0x63 [tipc]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #1 (&(&entry->lock)->rlock#2){+.-...}:
[<ffffffff8107b508>] __lock_acquire+0xb67/0xd0f
[<ffffffff8107b78c>] lock_acquire+0xdc/0x102
[<ffffffff8145471e>] _raw_spin_lock_bh+0x3b/0x6e
[<ffffffffa03152b1>] tipc_ref_acquire+0xe8/0x11b [tipc]
[<ffffffffa031433f>] tipc_createport_raw+0x78/0x1b9 [tipc]
[<ffffffffa031450b>] tipc_createport+0x8b/0x125 [tipc]
[<ffffffffa030f221>] tipc_subscr_start+0xce/0x126 [tipc]
[<ffffffffa0308fb2>] process_signal_queue+0x47/0x7d [tipc]
[<ffffffff81053e0c>] tasklet_action+0x8c/0xf4
[<ffffffff81054bd8>] __do_softirq+0xf8/0x1cd
[<ffffffff8100aadc>] call_softirq+0x1c/0x30
[<ffffffff810549f4>] _local_bh_enable_ip+0xb8/0xd7
[<ffffffff81054a21>] local_bh_enable_ip+0xe/0x10
[<ffffffff81454d31>] _raw_spin_unlock_bh+0x34/0x39
[<ffffffffa0308eb8>] spin_unlock_bh.clone.0+0x15/0x17 [tipc]
[<ffffffffa0308f47>] tipc_k_signal+0x8d/0xb1 [tipc]
[<ffffffffa0308dd9>] tipc_core_start+0x8a/0xad [tipc]
[<ffffffffa01b1087>] 0xffffffffa01b1087
[<ffffffff8100207d>] do_one_initcall+0x72/0x18a
[<ffffffff810872fb>] sys_init_module+0xd8/0x23a
[<ffffffff81009b42>] system_call_fastpath+0x16/0x1b

-> #0 (ref_table_lock){+.-...}:
[<ffffffff8107b3b2>] __lock_acquire+0xa11/0xd0f
[<ffffffff8107b78c>] lock_acquire+0xdc/0x102
[<ffffffff81454836>] _raw_write_lock_bh+0x3b/0x6e
[<ffffffffa0315148>] tipc_ref_discard+0x53/0xd4 [tipc]
[<ffffffffa03141ee>] tipc_deleteport+0x40/0x119 [tipc]
[<ffffffffa0316e35>] release+0xeb/0x137 [tipc]
[<ffffffff8139dbf4>] sock_release+0x1f/0x6f
[<ffffffff8139dc6b>] sock_close+0x27/0x2b
[<ffffffff811116f6>] __fput+0x12a/0x1df
[<ffffffff811117c5>] fput+0x1a/0x1c
[<ffffffff8110e49b>] filp_close+0x68/0x72
[<ffffffff8110e552>] sys_close+0xad/0xe7
[<ffffffff81009b42>] system_call_fastpath+0x16/0x1b

Finally decided I should fix this.  Its a straightforward inversion,
tipc_ref_acquire takes two locks in this order:
ref_table_lock
entry->lock

while tipc_deleteport takes them in this order:
entry->lock (via tipc_port_lock())
ref_table_lock (via tipc_ref_discard())

when the same entry is referenced, we get the above warning.  The fix is equally
straightforward.  Theres no real relation between the entry->lock and the
ref_table_lock (they just are needed at the same time), so move the entry->lock
aquisition in tipc_ref_acquire down, after we unlock ref_table_lock (this is
safe since the ref_table_lock guards changes to the reference table, and we've
already claimed a slot there.  I've tested the below fix and confirmed that it
clears up the lockdep issue

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agol2tp: Fix UDP socket reference count bugs in the pppol2tp driver
James Chapman [Tue, 16 Mar 2010 06:29:20 +0000 (06:29 +0000)]
l2tp: Fix UDP socket reference count bugs in the pppol2tp driver

This patch fixes UDP socket refcnt bugs in the pppol2tp driver.

A bug can cause a kernel stack trace when a tunnel socket is closed.

A way to reproduce the issue is to prepare the UDP socket for L2TP (by
opening a tunnel pppol2tp socket) and then close it before any L2TP
sessions are added to it. The sequence is

Create UDP socket
Create tunnel pppol2tp socket to prepare UDP socket for L2TP
  pppol2tp_connect: session_id=0, peer_session_id=0
L2TP SCCRP control frame received (tunnel_id==0)
  pppol2tp_recv_core: sock_hold()
  pppol2tp_recv_core: sock_put
L2TP ZLB control frame received (tunnel_id=nnn)
  pppol2tp_recv_core: sock_hold()
  pppol2tp_recv_core: sock_put
Close tunnel management socket
  pppol2tp_release: session_id=0, peer_session_id=0
Close UDP socket
  udp_lib_close: BUG

The addition of sock_hold() in pppol2tp_connect() solves the problem.

For data frames, two sock_put() calls were added to plug a refcnt leak
per received data frame. The ref that is grabbed at the top of
pppol2tp_recv_core() must always be released, but this wasn't done for
accepted data frames or data frames discarded because of bad UDP
checksums. This leak meant that any UDP socket that had passed L2TP
data traffic (i.e. L2TP data frames, not just L2TP control frames)
using pppol2tp would not be released by the kernel.

WARNING: at include/net/sock.h:435 udp_lib_unhash+0x117/0x120()
Pid: 1086, comm: openl2tpd Not tainted 2.6.33-rc1 #8
Call Trace:
 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120
 [<c101b871>] ? warn_slowpath_common+0x71/0xd0
 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120
 [<c101b8e3>] ? warn_slowpath_null+0x13/0x20
 [<c119e9b7>] ? udp_lib_unhash+0x117/0x120
 [<c11598a7>] ? sk_common_release+0x17/0x90
 [<c11a5e33>] ? inet_release+0x33/0x60
 [<c11577b0>] ? sock_release+0x10/0x60
 [<c115780f>] ? sock_close+0xf/0x30
 [<c106e542>] ? __fput+0x52/0x150
 [<c106b68e>] ? filp_close+0x3e/0x70
 [<c101d2e2>] ? put_files_struct+0x62/0xb0
 [<c101eaf7>] ? do_exit+0x5e7/0x650
 [<c1081623>] ? mntput_no_expire+0x13/0x70
 [<c106b68e>] ? filp_close+0x3e/0x70
 [<c101eb8a>] ? do_group_exit+0x2a/0x70
 [<c101ebe1>] ? sys_exit_group+0x11/0x20
 [<c10029b0>] ? sysenter_do_call+0x12/0x26

Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosmsc95xx: wait for PHY to complete reset during init
Steve Glendinning [Tue, 16 Mar 2010 09:03:06 +0000 (09:03 +0000)]
smsc95xx: wait for PHY to complete reset during init

This patch ensures the PHY correctly completes its reset before
setting register values.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agol2tp: Fix oops in pppol2tp_xmit
James Chapman [Tue, 16 Mar 2010 06:46:31 +0000 (06:46 +0000)]
l2tp: Fix oops in pppol2tp_xmit

When transmitting L2TP frames, we derive the outgoing interface's UDP
checksum hardware assist capabilities from the tunnel dst dev. This
can sometimes be NULL, especially when routing protocols are used and
routing changes occur. This patch just checks for NULL dst or dev
pointers when checking for netdev hardware assist features.

BUG: unable to handle kernel NULL pointer dereference at 0000000c
IP: [<f89d074c>] pppol2tp_xmit+0x341/0x4da [pppol2tp]
*pde = 00000000
Oops: 0000 [#1] SMP
last sysfs file: /sys/class/net/lo/operstate
Modules linked in: pppol2tp pppox ppp_generic slhc ipv6 dummy loop snd_hda_codec_atihdmi snd_hda_intel snd_hda_codec snd_pcm snd_timer snd soundcore snd_page_alloc evdev psmouse serio_raw processor button i2c_piix4 i2c_core ati_agp agpgart pcspkr ext3 jbd mbcache sd_mod ide_pci_generic atiixp ide_core ahci ata_generic floppy ehci_hcd ohci_hcd libata e1000e scsi_mod usbcore nls_base thermal fan thermal_sys [last unloaded: scsi_wait_scan]

Pid: 0, comm: swapper Not tainted (2.6.32.8 #1)
EIP: 0060:[<f89d074c>] EFLAGS: 00010297 CPU: 3
EIP is at pppol2tp_xmit+0x341/0x4da [pppol2tp]
EAX: 00000000 EBX: f64d1680 ECX: 000005b9 EDX: 00000000
ESI: f6b91850 EDI: f64d16ac EBP: f6a0c4c0 ESP: f70a9cac
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process swapper (pid: 0, ti=f70a8000 task=f70a31c0 task.ti=f70a8000)
Stack:
 000005a9 000005b9 f734c400 f66652c0 f7352e00 f67dc800 00000000 f6b91800
<0> 000005a3 f70ef6c4 f67dcda9 000005a3 f89b192e 00000246 000005a3 f64d1680
<0> f63633e0 f6363320 f64d1680 f65a7320 f65a7364 f65856c0 f64d1680 f679f02f
Call Trace:
 [<f89b192e>] ? ppp_push+0x459/0x50e [ppp_generic]
 [<f89b217f>] ? ppp_xmit_process+0x3b6/0x430 [ppp_generic]
 [<f89b2306>] ? ppp_start_xmit+0x10d/0x120 [ppp_generic]
 [<c11c15cb>] ? dev_hard_start_xmit+0x21f/0x2b2
 [<c11d0947>] ? sch_direct_xmit+0x48/0x10e
 [<c11c19a0>] ? dev_queue_xmit+0x263/0x3a6
 [<c11e2a9f>] ? ip_finish_output+0x1f7/0x221
 [<c11df682>] ? ip_forward_finish+0x2e/0x30
 [<c11de645>] ? ip_rcv_finish+0x295/0x2a9
 [<c11c0b19>] ? netif_receive_skb+0x3e9/0x404
 [<f814b791>] ? e1000_clean_rx_irq+0x253/0x2fc [e1000e]
 [<f814cb7a>] ? e1000_clean+0x63/0x1fc [e1000e]
 [<c1047eff>] ? sched_clock_local+0x15/0x11b
 [<c11c1095>] ? net_rx_action+0x96/0x195
 [<c1035750>] ? __do_softirq+0xaa/0x151
 [<c1035828>] ? do_softirq+0x31/0x3c
 [<c10358fe>] ? irq_exit+0x26/0x58
 [<c1004b21>] ? do_IRQ+0x78/0x89
 [<c1003729>] ? common_interrupt+0x29/0x30
 [<c101ac28>] ? native_safe_halt+0x2/0x3
 [<c1008c54>] ? default_idle+0x55/0x75
 [<c1009045>] ? c1e_idle+0xd2/0xd5
 [<c100233c>] ? cpu_idle+0x46/0x62
Code: 8d 45 08 f0 ff 45 08 89 6b 08 c7 43 68 7e fb 9c f8 8a 45 24 83 e0 0c 3c 04 75 09 80 63 64 f3 e9 b4 00 00 00 8b 43 18 8b 4c 24 04 <8b> 40 0c 8d 79 11 f6 40 44 0e 8a 43 64 75 51 6a 00 8b 4c 24 08
EIP: [<f89d074c>] pppol2tp_xmit+0x341/0x4da [pppol2tp] SS:ESP 0068:f70a9cac
CR2: 000000000000000c

Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosmsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver
Steve Glendinning [Tue, 16 Mar 2010 08:46:46 +0000 (08:46 +0000)]
smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver

This patch adds a driver for SMSC's LAN7500 family of USB 2.0
to gigabit ethernet adapters.  It's loosely based on the smsc95xx
driver but the device registers for LAN7500 are completely different.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agone: Do not use slashes in irq name string
Atsushi Nemoto [Tue, 16 Mar 2010 05:27:40 +0000 (05:27 +0000)]
ne: Do not use slashes in irq name string

This patch fixes following warning introduced by commit
12bac0d9f4dbf3445a0319beee848d15fa32775e ("proc: warn on non-existing
proc entries"):

WARNING: at /work/mips-linux/make/linux/fs/proc/generic.c:316 __xlate_proc_name+0xe0/0xe8()
name 'RBHMA4X00/RTL8019'

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoNET: ksz884x, fix lock imbalance
Jiri Slaby [Tue, 16 Mar 2010 04:53:50 +0000 (04:53 +0000)]
NET: ksz884x, fix lock imbalance

Stanse found that one error path (when alloc_skb fails) in netdev_tx
omits to unlock hw_priv->hwlock. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Tristram Ha <Tristram.Ha@micrel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: correct range checking off by one error
Tilman Schmidt [Tue, 16 Mar 2010 07:04:01 +0000 (07:04 +0000)]
gigaset: correct range checking off by one error

Correct a potential array overrun due to an off by one error in the
range check on the CAPI CONNECT_REQ CIPValue parameter.
Found and reported by Dan Carpenter using smatch.

Impact: bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfs: don't warn about page discards on shutdown
Dave Chinner [Mon, 15 Mar 2010 02:36:35 +0000 (02:36 +0000)]
xfs: don't warn about page discards on shutdown

If we are doing a forced shutdown, we can get lots of noise about
delalloc pages being discarded. This is happens by design during a
forced shutdown, so don't spam the logs with these messages.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
14 years agoxfs: use scalable vmap API
Alex Elder [Tue, 16 Mar 2010 18:55:56 +0000 (18:55 +0000)]
xfs: use scalable vmap API

Re-apply a commit that had been reverted due to regressions
that have since been fixed.

    From 95f8e302c04c0b0c6de35ab399a5551605eeb006 Mon Sep 17 00:00:00 2001
    From: Nick Piggin <npiggin@suse.de>
    Date: Tue, 6 Jan 2009 14:43:09 +1100

    Implement XFS's large buffer support with the new vmap APIs. See the vmap
    rewrite (db64fe02) for some numbers. The biggest improvement that comes from
    using the new APIs is avoiding the global KVA allocation lock on every call.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Only modifications here were a minor reformat, plus making the patch
apply given the new use of xfs_buf_is_vmapped().

Modified-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
14 years agoxfs: remove old vmap cache
Alex Elder [Tue, 16 Mar 2010 18:55:54 +0000 (18:55 +0000)]
xfs: remove old vmap cache

Re-apply a commit that had been reverted due to regressions
that have since been fixed.

    Original commit: d2859751cd0bf586941ffa7308635a293f943c17
    Author: Nick Piggin <npiggin@suse.de>
    Date: Tue, 6 Jan 2009 14:40:44 +1100

    XFS's vmap batching simply defers a number (up to 64) of vunmaps,
    and keeps track of them in a list. To purge the batch, it just goes
    through the list and calls vunamp on each one. This is pretty poor:
    a global TLB flush is generally still performed on each vunmap, with
    the most expensive parts of the operation being the broadcast IPIs
    and locking involved in the SMP callouts, and the locking involved
    in the vmap management -- none of these are avoided by just batching
    up the calls. I'm actually surprised it ever made much difference.
    (Now that the lazy vmap allocator is upstream, this description is
    not quite right, but the vunmap batching still doesn't seem to do
    much).

    Rip all this logic out of XFS completely. I will improve vmap
    performance and scalability directly in subsequent patch.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
The only change I made was to use the "new" xfs_buf_is_vmapped()
function in a place it had been open-coded in the original.

Modified-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
14 years agoleds: Fix race between LED device uevent and actual attributes creation
Florian Fainelli [Wed, 10 Mar 2010 17:32:18 +0000 (18:32 +0100)]
leds: Fix race between LED device uevent and actual attributes creation

If we were to dynamically register/unregister leds and have udev or other
daemons handle the leds class uevents, we would be notified of the adding of a
new LED and if the daemon immediately tries to open one of the attributes of
the led device, it would fail with a "no such file or directory" error since
this the attributes are not yet created. Fix this by switching attributes to be
class-wide, such that the driver core will register these attributes with
device_add_attrs and then emit the kobject_uevent ADD signal.

Signed-off-by: Fainelli <ffainelli@freebox.fr>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: panasonic-laptop - Fix incomplete registration failure handling
Bruno Prémont [Fri, 26 Feb 2010 12:20:10 +0000 (13:20 +0100)]
backlight: panasonic-laptop - Fix incomplete registration failure handling

Properly return backlight registration error to parent.
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Harald Welte <laforge@gnumonks.org> (registration failure)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: msi-laptop, msi-wmi: fix incomplete registration failure handling
Bruno Prémont [Fri, 26 Feb 2010 12:17:16 +0000 (13:17 +0100)]
backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling

Properly return backlight registration error to parent.
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Reviewed-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: blackfin - Fix missing registration failure handling
Bruno Prémont [Fri, 26 Feb 2010 12:04:54 +0000 (13:04 +0100)]
backlight: blackfin - Fix missing registration failure handling

Check newly registered backlight_device for error and properly
return error to parent
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Mike Frysinger <vapier@gentoo.org> (constify struct backlight_ops)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: classmate-laptop - Fix missing registration failure handling
Bruno Prémont [Fri, 26 Feb 2010 11:59:39 +0000 (12:59 +0100)]
backlight: classmate-laptop - Fix missing registration failure handling

Check newly registered backlight_device for error and properly
return error to parent.
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: mbp_nvidia_bl - add five more MacBook variants
Evan McClain [Wed, 10 Mar 2010 00:20:58 +0000 (19:20 -0500)]
backlight: mbp_nvidia_bl - add five more MacBook variants

This adds the MacBook 1,1 2,1 3,1 4,1 and 4,2 to the DMI tables.

Signed-off-by: Evan McClain <evan.mcclain@gatech.edu>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds-gpio: fix default state handling on OF platforms
Anton Vorontsov [Thu, 11 Mar 2010 21:58:47 +0000 (13:58 -0800)]
leds-gpio: fix default state handling on OF platforms

The driver wrongly sets default state for LEDs that don't specify
default-state property.

Currently the driver handles default state this way:

memset(&led, 0, sizeof(led));
for_each_child_of_node(np, child) {
state = of_get_property(child, "default-state", NULL);
if (state) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
...
}
ret = create_gpio_led(&led, ...);
}

Which means that all LEDs that do not specify default-state will inherit
the last value of the default-state property, which is wrong.

This patch fixes the issue by moving LED's template initialization into
the loop body.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: Add Dell Business Class Netbook LED driver
Bob Rodgers [Wed, 17 Feb 2010 21:23:31 +0000 (15:23 -0600)]
leds: Add Dell Business Class Netbook LED driver

This patch adds an LED driver to support the Dell Activity LED on the
Dell Latitude 2100 netbook and future products to come. The Activity LED
is visible externally in the lid so classroom instructors can observe it
from a distance. The driver uses the sysfs led_class and provides a
standard LED interface.

Signed-off by: Bob Rodgers <Robert_Rodgers@dell.com>
Signed-off-by: Louis Davis <Louis_Davis@dell.com>
Signed-off-by: Jim Dailey <Jim_Dailey@dell.com>, Developers
Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: Kconfig cleanup
H Hartley Sweeten [Wed, 20 Jan 2010 23:08:30 +0000 (16:08 -0700)]
leds: Kconfig cleanup

Remove the need for "depends on LEDS_CLASS" by wrapping the affected
config options in an if/endif block. Similar for "depends on LEDS_TRIGGERS".

LEDS_COBALT_RAQ still has a "depends on LEDS_CLASS=y" since it cannot
be selected to build as a module.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: led-class.c - Quiet boot messages
H Hartley Sweeten [Wed, 6 Jan 2010 22:34:55 +0000 (15:34 -0700)]
leds: led-class.c - Quiet boot messages

As each led device gets registered a kernel message gets printed. In
an embedded system with a number of leds this can produce a lot
of output that just looks like noise.

Change the message type to KERN_DEBUG since it might be useful
in the dmesg output "after" booting.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: make PCI device id constant
Márton Németh [Sun, 10 Jan 2010 00:11:03 +0000 (01:11 +0100)]
leds: make PCI device id constant

The id_table field of the struct pci_driver is constant in <linux/pci.h>
so it is worth to make pci_device_id also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+ const
struct I2 E[] = ...;
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoleds: ALIX2: Add dependency to !GPIO_CS5335
Daniel Mack [Sun, 10 Jan 2010 12:27:54 +0000 (13:27 +0100)]
leds: ALIX2: Add dependency to !GPIO_CS5335

The ALIX2 LED driver and the CS5535 GPIO drivers share the same I/O
range which causes a conflict if they're both enabled. Fix this for now
by adding Kconfig dependencies. While at it, also drop the EXPERIMENTAL
flag, as the code has been around for awhile already.

Note that this is a hack. At some point, a real platform support for
this board should be added which handles the LEDs via the leds-gpio
driver.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: Allow properties to be passed at registration
Matthew Garrett [Wed, 17 Feb 2010 21:39:44 +0000 (16:39 -0500)]
backlight: Allow properties to be passed at registration

Values such as max_brightness should be set before backlights are
registered, but the current API doesn't allow that. Add a parameter to
backlight_device_register and update drivers to ensure that they
set this correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: Add backlight_device parameter to check_fb
Bruno Prémont [Sat, 20 Feb 2010 23:20:01 +0000 (00:20 +0100)]
backlight: Add backlight_device parameter to check_fb

check_fb from backlight_ops lacks a reference to the backlight_device
that's being referred to. Add this parameter so a backlight_device
can be mapped to a single framebuffer, especially if the same driver
handles multiple devices on a single system.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agovideo: backlight/progear, fix pci device refcounting
Jiri Slaby [Tue, 2 Feb 2010 22:44:50 +0000 (14:44 -0800)]
video: backlight/progear, fix pci device refcounting

Stanse found an ommitted pci_dev_puts on error path in progearbl_probe.
pmu_dev and sb_dev are gotten, but never put when
backlight_device_register fails.

So unify fail paths and put the devs when the failure occurs.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: l4f00242t03: Fix module licence absence.
Alberto Panizzo [Tue, 19 Jan 2010 08:30:50 +0000 (09:30 +0100)]
backlight: l4f00242t03: Fix module licence absence.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: Revert some const qualifiers
Richard Purdie [Mon, 18 Jan 2010 14:16:07 +0000 (14:16 +0000)]
backlight: Revert some const qualifiers

9905a43b2d563e6f89e4c63c4278ada03f2ebb14 went a little to far with const
qualifiers as there are legitiment cases where the function pointers
can change (machine specific setup code for example).

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agobacklight: Add Epson L4F00242T03 LCD driver
Alberto Panizzo [Fri, 18 Dec 2009 15:42:11 +0000 (16:42 +0100)]
backlight: Add Epson L4F00242T03 LCD driver

The Epson LCD L4F00242T03 is mounted on the Freescale i.MX31 PDK board.
Based upon Marek Vasut work in l4f00242t03.c, this driver provides
basic init and power on/off functionality for this device through the
sysfs lcd interface.

Unfortunately Datasheet for this device are not available and
all the control sequences sent to the display were copied from the
freescale driver that in the i.MX31 Linux BSP.

As in the i.MX31PDK board the core and io suppliers are voltage
regulators, that functionality is embedded here, but not strict.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
14 years agoBtrfs: buffer results in the space_info ioctl
Chris Mason [Tue, 16 Mar 2010 19:40:10 +0000 (15:40 -0400)]
Btrfs: buffer results in the space_info ioctl

The space_info ioctl was using copy_to_user inside rcu_read_lock.  This
commit changes things to copy into a buffer first and then dump the
result down to userland.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: use __u64 types in ioctl.h
Sage Weil [Tue, 16 Mar 2010 00:02:26 +0000 (00:02 +0000)]
Btrfs: use __u64 types in ioctl.h

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: fix search_ioctl key advance
Sage Weil [Tue, 16 Mar 2010 00:02:25 +0000 (00:02 +0000)]
Btrfs: fix search_ioctl key advance

key->type is u8, not u64.

fs/btrfs/ioctl.c: In function 'copy_to_sk':
fs/btrfs/ioctl.c:1024: warning: comparison is always true due to limited range of data type

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoPCMCIA: resource, fix lock imbalance
Jiri Slaby [Tue, 16 Mar 2010 14:57:44 +0000 (15:57 +0100)]
PCMCIA: resource, fix lock imbalance

Stanse found that one error path (when alloc_skb fails) in netdev_tx
omits to unlock hw_priv->hwlock. Fix that by moving away from unlock in
each fail path. Unlock at one place instead.

Introduced in 94a819f80297e1f635a7cde4ed5317612e512ba7
(pcmcia: assert locking to struct pcmcia_device)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
14 years agoHID: avoid '\0' in hid debugfs events file
Bruno Prémont [Mon, 15 Mar 2010 18:00:27 +0000 (19:00 +0100)]
HID: avoid '\0' in hid debugfs events file

When dumping /sys/kernel/debug/hid/$device/events '\0' characters show up
(invisible if cat to console but shown by less or while looking at a dump
 file).  These are due to hid_debug_event() adding strlen()+1 bytes to the ring
buffer (e.g. including the trailing '\0').  Any roll-over causes a '\0' as well
as hid_debug_event() handles the ring buffers with HID_DEBUG_BUFSIZE-1 size
while hid_debug_events_read() handles it with full HID_DEBUG_BUFSIZE size.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
14 years agoMAINTAINERS: Add entry for sparc serial drivers.
David S. Miller [Tue, 16 Mar 2010 08:00:17 +0000 (01:00 -0700)]
MAINTAINERS: Add entry for sparc serial drivers.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/serial/sunsab.c: adjust the constant used to initialize the interrupt_mask0...
Julia Lawall [Tue, 16 Mar 2010 07:33:37 +0000 (00:33 -0700)]
drivers/serial/sunsab.c: adjust the constant used to initialize the interrupt_mask0 fields

From: Julia Lawall <julia@diku.dk>

SAB82532_ISR0_TCD is declared in drivers/serial/subsab.h as relating to a
status register, while SAB82532_IMR0_TCD is declared in the same file as
relating to a mask register.  The latter seems more appropriate for the
interrupt_mask0 field, and follows the strategy for initializing this field
elsewhere in the same file.

Both SAB82532_ISR0_TCD and SAB82532_IMR0_TCD have the same value.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: Fix br_forward crash in promiscuous mode
Michael Braun [Tue, 16 Mar 2010 07:26:22 +0000 (00:26 -0700)]
bridge: Fix br_forward crash in promiscuous mode

From: Michael Braun <michael-dev@fami-braun.de>

bridge: Fix br_forward crash in promiscuous mode

It's a linux-next kernel from 2010-03-12 on an x86 system and it
OOPs in the bridge module in br_pass_frame_up (called by
br_handle_frame_finish) because brdev cannot be dereferenced (its set to
a non-null value).

Adding some BUG_ON statements revealed that
 BR_INPUT_SKB_CB(skb)->brdev == br-dev
(as set in br_handle_frame_finish first)
only holds until br_forward is called.
The next call to br_pass_frame_up then fails.

Digging deeper it seems that br_forward either frees the skb or passes
it to NF_HOOK which will in turn take care of freeing the skb. The
same is holds for br_pass_frame_ip. So it seems as if two independent
skb allocations are required. As far as I can see, commit
b33084be192ee1e347d98bb5c9e38a53d98d35e2 ("bridge: Avoid unnecessary
clone on forward path") removed skb duplication and so likely causes
this crash. This crash does not happen on 2.6.33.

I've therefore modified br_forward the same way br_flood has been
modified so that the skb is not freed if skb0 is going to be used
and I can confirm that the attached patch resolves the issue for me.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosound: sequencer: clean up remove bogus check
Dan Carpenter [Tue, 16 Mar 2010 06:46:23 +0000 (09:46 +0300)]
sound: sequencer: clean up remove bogus check

A few lines earlier bend is limited to 2399.  So semitones is always
less than 24 here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoMerge branch 'topic/misc' into fix/misc
Takashi Iwai [Tue, 16 Mar 2010 06:50:49 +0000 (07:50 +0100)]
Merge branch 'topic/misc' into fix/misc

14 years agoALSA: hda: Use LPIB and 6stack-dig for eMachines T5212
Daniel T Chen [Mon, 15 Mar 2010 03:44:03 +0000 (23:44 -0400)]
ALSA: hda: Use LPIB and 6stack-dig for eMachines T5212

BugLink: https://bugs.launchpad.net/bugs/538895
The OR has verified that both position_fix=1 and model=6stack-dig are
necessary to have capture function properly. (The existing 3stack-6ch
model quirk seems to be incorrect.)

Reported-by: Reuben Bailey <reuben.e.bailey@gmail.com>
Tested-by: Reuben Bailey <reuben.e.bailey@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agomd: deal with merge_bvec_fn in component devices better.
NeilBrown [Mon, 8 Mar 2010 05:44:38 +0000 (16:44 +1100)]
md: deal with merge_bvec_fn in component devices better.

If a component device has a merge_bvec_fn then as we never call it
we must ensure we never need to.  Currently this is done by setting
max_sector to 1 PAGE, however this does not stop a bio being created
with several sub-page iovecs that would violate the merge_bvec_fn.

So instead set max_segments to 1 and set the segment boundary to the
same as a page boundary to ensure there is only ever one single-page
segment of IO requested at a time.

This can particularly be an issue when 'xen' is used as it is
known to submit multiple small buffers in a single bio.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
14 years agobridge: Move NULL mdb check into br_mdb_ip_get
Herbert Xu [Tue, 16 Mar 2010 03:38:25 +0000 (20:38 -0700)]
bridge: Move NULL mdb check into br_mdb_ip_get

Since all callers of br_mdb_ip_get need to check whether the
hash table is NULL, this patch moves the check into the function.

This fixes the two callers (query/leave handler) that didn't
check it.

Reported-by: Michael Braun <michael-dev@fami-braun.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoISDN: Add PCI ID for HFC-2S/4S Beronet Card PCIe
Lars Ellenberg [Tue, 16 Mar 2010 02:09:28 +0000 (19:09 -0700)]
ISDN: Add PCI ID for HFC-2S/4S Beronet Card PCIe

A few subdevice IDs seem to have been dropped when hfc_multi was
included upstream, just compare the list at
http://www.openvox.cn/viewvc/misdn/trunk/hfc_multi.c?revision=75&view=annotate#l175
with the IDs in drivers/isdn/hardware/mISDN/hfcmulti.c

Added PCIe 2 Port card and LED settings (same as PCI)
Do not use <linux/pci_ids.h> /KKe

Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of /home/davem/src/GIT/linux-2.6/
David S. Miller [Mon, 15 Mar 2010 23:23:54 +0000 (16:23 -0700)]
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/

14 years agoARM: SAMSUNG: Fixup commit 4e6d488af37980d224cbf298224db6173673f362
Ben Dooks [Mon, 15 Mar 2010 23:08:03 +0000 (23:08 +0000)]
ARM: SAMSUNG: Fixup commit 4e6d488af37980d224cbf298224db6173673f362

Commit 4e6d488af37980d224cbf298224db6173673f362 either missed out the
following machine files or somehow managed to clash between merges.

Fixup the three files missing the second parameter to addruart macro
to allow them to build.

Fixes the following warnings in arch/arm/kernel/debug.c:
arch/arm/kernel/debug.S: Assembler messages:
arch/arm/kernel/debug.S:167: Error: too many positional arguments
arch/arm/kernel/debug.S:183: Error: too many positional arguments

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agonet-2.6 [Bug-Fix][dccp]: fix oops caused after failed initialisation
Gerrit Renker [Sun, 14 Mar 2010 20:13:19 +0000 (20:13 +0000)]
net-2.6 [Bug-Fix][dccp]: fix oops caused after failed initialisation

dccp: fix panic caused by failed initialisation

This fixes a kernel panic reported thanks to Andre Noll:

if DCCP is compiled into the kernel and any out of the initialisation
steps in net/dccp/proto.c:dccp_init() fail, a subsequent attempt to create
a SOCK_DCCP socket will panic, since inet{,6}_create() are not prevented
from creating DCCP sockets.

This patch fixes the problem by propagating a failure in dccp_init() to
dccp_v{4,6}_init_net(), and from there to dccp_v{4,6}_init(), so that the
DCCP protocol is not made available if its initialisation fails.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomyri: remove dead code
Dan Carpenter [Sun, 14 Mar 2010 22:24:08 +0000 (22:24 +0000)]
myri: remove dead code

We can never reach the return statement.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: prune use of tty_buffer_request_room
Tilman Schmidt [Sun, 14 Mar 2010 12:58:05 +0000 (12:58 +0000)]
gigaset: prune use of tty_buffer_request_room

Calling tty_buffer_request_room() before tty_insert_flip_string()
is unnecessary, costs CPU and for big buffers can mess up the
multi-page allocation avoidance.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <keil@b1-systems.de>
CC: Alan Cox <alan@lxorguk.ukuu.org.uk>, stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: correct clearing of at_state strings on RING
Tilman Schmidt [Sun, 14 Mar 2010 12:58:05 +0000 (12:58 +0000)]
gigaset: correct clearing of at_state strings on RING

In RING handling, clear the table of received parameter strings in
a loop like everywhere else, instead of by enumeration which had
already gotten out of sync.

Impact: minor bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <keil@b1-systems.de>
CC: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogigaset: avoid registering CAPI driver more than once
Tilman Schmidt [Sun, 14 Mar 2010 12:58:05 +0000 (12:58 +0000)]
gigaset: avoid registering CAPI driver more than once

Registering/unregistering the Gigaset CAPI driver when a device is
connected/disconnected causes an Oops when disconnecting two Gigaset
devices in a row, because the same capi_driver structure gets
unregistered twice. Fix by making driver registration/unregistration
a separate operation (empty in the ISDN4Linux case) called when the
main module is loaded/unloaded.

Impact: bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <keil@b1-systems.de>
CC: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoobsolete config in kernel source: HSO_AUTOPM
Christoph Egger [Thu, 11 Mar 2010 12:07:54 +0000 (12:07 +0000)]
obsolete config in kernel source: HSO_AUTOPM

CONFIG_HSO_AUTOPM is set by KConfig / set in the Kernel source, makefiles
and won't be ever set this way, therefor simply removing the protected
code.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoobsolete config in kernel source: USE_INTERNAL_TIMER
Christoph Egger [Thu, 11 Mar 2010 12:07:52 +0000 (12:07 +0000)]
obsolete config in kernel source: USE_INTERNAL_TIMER

CONFIG_USE_INTERNAL_TIMER seems to be the remainings of some experiment.
It is explicitely #undef-ed as not working, only referenced from one
source file and rather aged.

Hereby cleaning it from the kernel tree.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Acked-by: Roel Kluin <roel.kluin@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatm: use for_each_set_bit()
Akinobu Mita [Thu, 11 Mar 2010 12:07:50 +0000 (12:07 +0000)]
atm: use for_each_set_bit()

Replace open-coded loop with for_each_set_bit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agophonet: use for_each_set_bit()
Akinobu Mita [Thu, 11 Mar 2010 12:07:49 +0000 (12:07 +0000)]
phonet: use for_each_set_bit()

Replace open-coded loop with for_each_set_bit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotimestamping: fix example build
Randy Dunlap [Fri, 12 Mar 2010 19:23:27 +0000 (19:23 +0000)]
timestamping: fix example build

Fix Makefiles so that Documentation/networking/timestamping/timestamping.c
will build when using the CONFIG_BUILD_DOCSRC kconfig option.
(timestamping.c does not build currently with its simple Makefile.)

Also fix printf format warnings.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoARM: SAMSUNG: Fix build error from stale define in <plat/uncompress.h>
Ben Dooks [Mon, 15 Mar 2010 22:57:18 +0000 (22:57 +0000)]
ARM: SAMSUNG: Fix build error from stale define in <plat/uncompress.h>

The decleration of error() as static in the platform specific uncompress
code in  arch/arm/plat-samsung/include/plat/uncomopress.h causes the build
of the uncompressor to break. Remove it, as it is no longer needed.

arch/arm/boot/compressed/decompress.o: In function `gunzip':
/var/tmp/kernel-orig/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:67: undefined reference to `error'
/var/tmp/kernel-orig/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:73: undefined reference to `error'
/var/tmp/kernel-orig/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:80: undefined reference to `error'
/var/tmp/kernel-orig/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:95: undefined reference to `error'
/var/tmp/kernel-orig/arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:152: undefined reference to `error'

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agodrivers/net: drop redundant memset
Julia Lawall [Tue, 9 Mar 2010 11:14:11 +0000 (11:14 +0000)]
drivers/net: drop redundant memset

The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoi4l: change magic numbers in Eicon DIVA ISDN driver to symbolic names
Ian Munsie [Thu, 11 Mar 2010 12:07:25 +0000 (12:07 +0000)]
i4l: change magic numbers in Eicon DIVA ISDN driver to symbolic names

Replace references to the '20' magic number found throughout the Eicon
ISDN driver for the length of the station_id field in the T30_INFO struct
with the T30_MAX_STATION_ID_LENGTH symbolic constant.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoi4l: silence compiler warnings for array access in Eicon DIVA ISDN driver
Ian Munsie [Thu, 11 Mar 2010 12:07:24 +0000 (12:07 +0000)]
i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver

When compiling this driver, the compiler throws the following warnings:

drivers/isdn/hardware/eicon/message.c:8426: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8427: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8434: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8435: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8436: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8447: warning: array subscript is above array bounds

This arises from the particular semantics the driver is using to write to
the nlc array (static byte[256]).  The array has a length in byte 0
followed by a T30_INFO struct starting at byte 1.

The T30_INFO struct has a number of variable length strings after the
station_id entry, which cannot be explicitly defined in the struct and the
driver accesses them with an array index to station_id beyond the length
of station_id.

This patch merely changes the semantics that the driver uses to access the
entries after the station_id entry to use the original 256 byte nlc array
taking the offset and length of the station_id entry to calculate where to
write in the array, thereby silencing the warning.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: misplaced parenthesis in pof_handle_data()
Roel Kluin [Thu, 11 Mar 2010 12:07:22 +0000 (12:07 +0000)]
isdn: misplaced parenthesis in pof_handle_data()

The parenthesis was misplaced.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: change smp_mb() comment to conform the true
Stanislaw Gruszka [Tue, 9 Mar 2010 06:55:02 +0000 (06:55 +0000)]
bnx2x: change smp_mb() comment to conform the true

Access to fp->tx_bp_prod is protected by __netif_tx_lock,
smp_mb() is not needed for that.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: remove not necessary compiler barrier
Stanislaw Gruszka [Tue, 9 Mar 2010 06:55:01 +0000 (06:55 +0000)]
bnx2x: remove not necessary compiler barrier

Access to fp->tx_bd_prod is protected by __netif_tx_lock, so we do not
need any barrier for that.

Update of fp->tx_bd_cons in bnx2x_tx_int() is not protected by lock, but
barrier() nor smb_mb() in bnx2x_tx_avail() not guarantee we will see
values that is written on other cpu. Ordering issues between
netif_tx_stop_queue(), netif_tx_queue_stopped(), fp->tx_bd_cons = bd_cons
and bnx2x_tx_avail() are already handled by smp_mb() in bnx2x_tx_int()
and bnx2x_start_xmit().

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: use smp_mb() to keep ordering of read write operations
Stanislaw Gruszka [Tue, 9 Mar 2010 06:55:00 +0000 (06:55 +0000)]
bnx2x: use smp_mb() to keep ordering of read write operations

Since we want to keep ordering of write to fp->bd_tx_cons and
netif_tx_queue_stopped(txq), what is read of txq->state, we have to use
general memory barrier.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix mccq create for big endian architectures
Ajit Khaparde [Thu, 11 Mar 2010 01:35:59 +0000 (01:35 +0000)]
be2net: fix mccq create for big endian architectures

The request to create an mccq was being dispatched without
doing a byte swap of num_pages. This byte swap is necessary
for Big Endian systems like PPC. Not having this fix leads
mccq create to fail on BE ASICs running newer version of
firmware, thereby causing driver initialization failure.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoTI DaVinci EMAC: Convert to dev_pm_ops
chaithrika@ti.com [Wed, 10 Mar 2010 22:37:56 +0000 (22:37 +0000)]
TI DaVinci EMAC: Convert to dev_pm_ops

Migrate from the legacy PM hooks to use dev_pm_ops structure.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: davinci emac: use dma_{map, unmap}_single API for cache coherency
Sekhar Nori [Tue, 9 Mar 2010 01:20:37 +0000 (01:20 +0000)]
net: davinci emac: use dma_{map, unmap}_single API for cache coherency

The davinci emac driver uses some ARM specific DMA APIs
for cache coherency which have been removed from kernel
with the 2.6.34 merge.

Modify the driver to use the dma_{map, unmap}_single() APIs
defined in dma-mapping.h

Without this fix, the driver fails to compile on Linus's
tree.

Tested on DM365 and OMAP-L138 EVMs.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoARM: SAMSUNG: Add suspend/resume support for S3C PWM driver
Vasily Khoruzhick [Mon, 15 Mar 2010 14:27:08 +0000 (16:27 +0200)]
ARM: SAMSUNG: Add suspend/resume support for S3C PWM driver

Reset period_ns and duty_ns values in suspend handler to avoid skip of
configuration if same values passed to pwm_config;
Restore invertion bit in resume handler.

Without this patch PWM works incorrectly after resume from suspend.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoARM: S3C2440: Fix s3c2440 cpufreq compilation post move.
Vasily Khoruzhick [Sun, 14 Mar 2010 14:32:28 +0000 (16:32 +0200)]
ARM: S3C2440: Fix s3c2440 cpufreq compilation post move.

Fix compilation issue by moving s3c2440-cpufreq.c into mach-s3c2440 directory

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoe100: Fix ring parameter change handling regression.
David S. Miller [Mon, 15 Mar 2010 22:23:30 +0000 (15:23 -0700)]
e100: Fix ring parameter change handling regression.

When the PCI pool changes were added to fix resume failures:

commit 98468efddb101f8a29af974101c17ba513b07be1
e100: Use pci pool to work around GFP_ATOMIC order 5 memory allocation failu

and

commit 70abc8cb90e679d8519721e2761d8366a18212a6
e100: Fix broken cbs accounting due to missing memset.

This introduced a problem that can happen if the TX ring size
is increased.  We need to size the PCI pool using cbs->max
instead of the default cbs->count value.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoARM: Fix RiscPC decompressor build errors
Russell King [Mon, 15 Mar 2010 22:04:24 +0000 (22:04 +0000)]
ARM: Fix RiscPC decompressor build errors

arch/arm/boot/compressed/decompress.o: In function `do_decompress':
decompress.c:(.text+0x26e8): undefined reference to `error'
decompress.c:(.text+0x2760): undefined reference to `error'
decompress.c:(.text+0x27d8): undefined reference to `error'
decompress.c:(.text+0x2824): undefined reference to `error'
decompress.c:(.text+0x28f0): undefined reference to `error'

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoNFS: ensure bdi_unregister is called on mount failure.
NeilBrown [Thu, 11 Mar 2010 00:20:17 +0000 (11:20 +1100)]
NFS: ensure bdi_unregister is called on mount failure.

bdi_unregister is called by nfs_put_super which is only called by
generic_shutdown_super if ->s_root is not NULL.  So if we error out
in a circumstance where we called nfs_bdi_register (i.e. server !=
NULL) but have not set s_root, then we need to call bdi_unregister
explicitly in nfs_get_sb and various other *_get_sb() functions.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 years agoARM: Fix sorting of platform group config options and includes
Russell King [Mon, 15 Mar 2010 19:03:06 +0000 (19:03 +0000)]
ARM: Fix sorting of platform group config options and includes

... and document the sorting criteria to help future additions.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: 5991/1: Fix regression in restore_user_regs macro
Anders Grafström [Mon, 15 Mar 2010 15:04:14 +0000 (16:04 +0100)]
ARM: 5991/1: Fix regression in restore_user_regs macro

ARMv5T and earlier require that a ldm {}^ instruction is not followed
by an instruction that accesses banked registers. This patch restores
the nop that was lost in commit b86040a59feb255a8193173caa4d5199464433d5.

Signed-off-by: Anders Grafström <grfstrm@users.sourceforge.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agocifs: trivial white space
Dan Carpenter [Mon, 15 Mar 2010 08:22:26 +0000 (11:22 +0300)]
cifs: trivial white space

I fixed the indent level.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
14 years agoBtrfs: fix gfp flags masking in the compression code
Nick Piggin [Mon, 15 Mar 2010 15:05:29 +0000 (11:05 -0400)]
Btrfs: fix gfp flags masking in the compression code

GFP_FS must be masked out, NOFS can't be or'd in.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: don't look at bio flags after submit_bio
Chris Mason [Mon, 15 Mar 2010 14:21:30 +0000 (10:21 -0400)]
Btrfs: don't look at bio flags after submit_bio

After callling submit_bio, the bio can be freed at any time.  The
btrfs submission thread helper was checking the bio flags too late,
which might not give the correct answer.

When CONFIG_DEBUG_PAGE_ALLOC is turned on, it can lead to oopsen.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agobtrfs: using btrfs_stack_device_id() get devid
Xiao Guangrong [Wed, 6 Jan 2010 11:48:18 +0000 (11:48 +0000)]
btrfs: using btrfs_stack_device_id() get devid

We can use btrfs_stack_device_id() to get dev_item->devid

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agobtrfs: use memparse
Akinobu Mita [Sun, 28 Feb 2010 10:59:11 +0000 (10:59 +0000)]
btrfs: use memparse

Use memparse() instead of its own private implementation.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: add a "df" ioctl for btrfs
Josef Bacik [Wed, 13 Jan 2010 18:19:06 +0000 (18:19 +0000)]
Btrfs: add a "df" ioctl for btrfs

df is a very loaded question in btrfs.  This gives us a way to get the per-space
usage information so we can tell exactly what is in use where.  This will help
us figure out ENOSPC problems, and help users better understand where their disk
space is going.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: cache the extent state everywhere we possibly can V2
Josef Bacik [Wed, 3 Feb 2010 19:33:23 +0000 (19:33 +0000)]
Btrfs: cache the extent state everywhere we possibly can V2

This patch just goes through and fixes everybody that does

lock_extent()
blah
unlock_extent()

to use

lock_extent_bits()
blah
unlock_extent_cached()

and pass around a extent_state so we only have to do the searches once per
function.  This gives me about a 3 mb/s boots on my random write test.  I have
not converted some things, like the relocation and ioctl's, since they aren't
heavily used and the relocation stuff is in the middle of being re-written.  I
also changed the clear_extent_bit() to only unset the cached state if we are
clearing EXTENT_LOCKED and related stuff, so we can do things like this

lock_extent_bits()
clear delalloc bits
unlock_extent_cached()

without losing our cached state.  I tested this thoroughly and turned on
LEAK_DEBUG to make sure we weren't leaking extent states, everything worked out
fine.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: cache ordered extent when completing io
Josef Bacik [Tue, 2 Feb 2010 20:51:14 +0000 (20:51 +0000)]
Btrfs: cache ordered extent when completing io

When finishing io we run btrfs_dec_test_ordered_pending, and then immediately
run btrfs_lookup_ordered_extent, but btrfs_dec_test_ordered_pending does that
already, so we're searching twice when we don't have to.  This patch lets us
pass a btrfs_ordered_extent in to btrfs_dec_test_ordered_pending so if we do
complete io on that ordered extent we can just use the one we found then instead
of having to do another btrfs_lookup_ordered_extent.  This made my fio job with
the other patch go from 24 mb/s to 29 mb/s.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: cache extent state in find_delalloc_range
Josef Bacik [Tue, 2 Feb 2010 21:19:11 +0000 (21:19 +0000)]
Btrfs: cache extent state in find_delalloc_range

This patch makes us cache the extent state we find in find_delalloc_range since
we'll have to lock the extent later on in the function.  This will keep us from
re-searching for the rang when we try to lock the extent.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: change the ordered tree to use a spinlock instead of a mutex
Josef Bacik [Tue, 2 Feb 2010 21:48:28 +0000 (21:48 +0000)]
Btrfs: change the ordered tree to use a spinlock instead of a mutex

The ordered tree used to need a mutex, but currently all we use it for is to
protect the rb_tree, and a spin_lock is just fine for that.  Using a spin_lock
instead makes dbench run a little faster, 58 mb/s instead of 51 mb/s, and have
less latency, 3445.138 ms instead of 3820.633 ms.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agoBtrfs: finish read pages in the order they are submitted
Chris Mason [Wed, 3 Feb 2010 18:18:45 +0000 (18:18 +0000)]
Btrfs: finish read pages in the order they are submitted

The endio is done at reverse order of bio vectors.

That means for a sequential read, the page first submitted will finish
last in a bio. Considering we will do checksum (making cache hot) for
every page, this does introduce delay (and chance to squeeze cache used
soon) for pages submitted at the begining.

I don't observe obvious performance difference with below patch at my
simple test, but seems more natural to finish read in the order they are
submitted.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
14 years agobtrfs: fix btrfs_mkdir goto for no free objectids
Miao Xie [Thu, 11 Feb 2010 08:06:58 +0000 (08:06 +0000)]
btrfs: fix btrfs_mkdir goto for no free objectids

btrfs_mkdir() must jump to the place of ending transaction after
btrfs_find_free_objectid() failed. Or this transaction can't end.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>