pandora-kernel.git
12 years agodm raid: tidy includes
Alasdair G Kergon [Tue, 2 Aug 2011 11:32:03 +0000 (12:32 +0100)]
dm raid: tidy includes

A dm target only needs to use include/linux dm headers.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm ioctl: prevent empty message
Alasdair G Kergon [Tue, 2 Aug 2011 11:32:03 +0000 (12:32 +0100)]
dm ioctl: prevent empty message

Detect invalid empty messages in core dm instead of requiring every target to
check this.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: cleanup parameter handling
Jonathan Brassow [Tue, 2 Aug 2011 11:32:03 +0000 (12:32 +0100)]
dm raid: cleanup parameter handling

Re-order the parameters so they are handled consistently in the same order
where defined, parsed and output.

Only include rebuild parameters in the STATUSTYPE_TABLE output if they were
supplied in the original table line.

Correct the parameter count when outputting rebuild: there are two words,
not one.

Use case-independent checks for keywords (as in other device-mapper targets).

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm snapshot: style cleanups
Jonathan Brassow [Tue, 2 Aug 2011 11:32:03 +0000 (12:32 +0100)]
dm snapshot: style cleanups

Coding style cleanups.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
12 years agodm snapshot: remove unused definitions
Mikulas Patocka [Tue, 2 Aug 2011 11:32:03 +0000 (12:32 +0100)]
dm snapshot: remove unused definitions

Remove a couple of unused #defines.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm kcopyd: remove nr_pages field from job structure
Mikulas Patocka [Tue, 2 Aug 2011 11:32:02 +0000 (12:32 +0100)]
dm kcopyd: remove nr_pages field from job structure

The nr_pages field in struct kcopyd_job is only used temporarily in
run_pages_job() to count the number of required pages.
We can use a local variable instead.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm kcopyd: remove offset field from job structure
Mikulas Patocka [Tue, 2 Aug 2011 11:32:02 +0000 (12:32 +0100)]
dm kcopyd: remove offset field from job structure

The offset field in struct kcopyd_job is always zero so remove it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm: use vzalloc
Joe Perches [Tue, 2 Aug 2011 11:32:02 +0000 (12:32 +0100)]
dm: use vzalloc

Use vzalloc() instead of vmalloc()+memset().

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm log: userspace use list_move
Kirill A. Shutemov [Tue, 2 Aug 2011 11:32:02 +0000 (12:32 +0100)]
dm log: userspace use list_move

Replace list_del() followed by list_add() with list_move().

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm log: clean up bit little endian bitops
Akinobu Mita [Tue, 2 Aug 2011 11:32:01 +0000 (12:32 +0100)]
dm log: clean up bit little endian bitops

Using __test_and_{set,clear}_bit_le() with ignoring its return value
can be replaced with __{set,clear}_bit_le().

This also removes unnecessary casts.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm table: fix discard support
Mike Snitzer [Tue, 2 Aug 2011 11:32:01 +0000 (12:32 +0100)]
dm table: fix discard support

Remove 'discards_supported' from the dm_table structure.  The same
information can be easily discovered from the table's target(s) in
dm_table_supports_discards().

Before this fix dm_table_supports_discards() would skip checking the
individual targets' 'discards_supported' flag if any one target in the
table didn't set num_discard_requests > 0.  Now the per-target
'discards_supported' flag is effective at insuring the final DM device
advertises discard support.  But, to be clear, targets that don't
support discards (!num_discard_requests) will not receive discard
requests.

Also DMWARN if a target sets 'discards_supported' override but forgets
to set 'num_discard_requests'.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm: suppress endian warnings
Alasdair G Kergon [Tue, 2 Aug 2011 11:32:01 +0000 (12:32 +0100)]
dm: suppress endian warnings

Suppress sparse warnings about cpu_to_le32() by using __le32 types for
on-disk data etc.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm: fix idr leak on module removal
Alasdair G Kergon [Tue, 2 Aug 2011 11:32:01 +0000 (12:32 +0100)]
dm: fix idr leak on module removal

Destroy _minor_idr when unloading the core dm module.  (Found by kmemleak.)

Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm io: flush cpu cache with vmapped io
Mikulas Patocka [Tue, 2 Aug 2011 11:32:01 +0000 (12:32 +0100)]
dm io: flush cpu cache with vmapped io

For normal kernel pages, CPU cache is synchronized by the dma layer.
However, this is not done for pages allocated with vmalloc. If we do I/O
to/from vmallocated pages, we must synchronize CPU cache explicitly.

Prior to doing I/O on vmallocated page we must call
flush_kernel_vmap_range to flush dirty cache on the virtual address.
After finished read we must call invalidate_kernel_vmap_range to
invalidate cache on the virtual address, so that accesses to the virtual
address return newly read data and not stale data from CPU cache.

This patch fixes metadata corruption on dm-snapshots on PA-RISC and
possibly other architectures with caches indexed by virtual address.

Cc: stable <stable@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm mpath: fix potential NULL pointer in feature arg processing
Mike Snitzer [Tue, 2 Aug 2011 11:32:00 +0000 (12:32 +0100)]
dm mpath: fix potential NULL pointer in feature arg processing

Avoid dereferencing a NULL pointer if the number of feature arguments
supplied is fewer than indicated.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
12 years agodm snapshot: flush disk cache when merging
Mikulas Patocka [Tue, 2 Aug 2011 11:32:00 +0000 (12:32 +0100)]
dm snapshot: flush disk cache when merging

This patch makes dm-snapshot flush disk cache when writing metadata for
merging snapshot.

Without cache flushing the disk may reorder metadata write and other
data writes and there is a possibility of data corruption in case of
power fault.

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agowatchdog: Cleanup WATCHDOG_CORE help text
Josh Boyer [Sat, 30 Jul 2011 14:18:48 +0000 (10:18 -0400)]
watchdog: Cleanup WATCHDOG_CORE help text

The newly added WATCHDOG_CORE option is a bool, but the help text suggests
it can be built as a module.  Fix it up.

Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
12 years agowatchdog: Fix POST failure on ASUS P5N32-E SLI and similar boards
Mart Gerrits [Sat, 30 Jul 2011 14:59:12 +0000 (16:59 +0200)]
watchdog: Fix POST failure on ASUS P5N32-E SLI and similar boards

At present the module does not unset the NO_REBOOT bit upon shutdown, this
causes the BIOS to fail the POST once and reset. During the next boot it
displays the following error message:

***** Warning: System BOOT Fail *****
Your system last boot fail or POST interrupted.
Please enter setup to load default and reboot again.
Press F1 to continue, DEL to enter SETUP

With this patch the NO_REBOOT flag will be unset on shutdown and thus stop
this failure from occurring.

Tested on 'ASUS P5N32-E SLI with BIOS revision 1801' and
          'ASUS P5N32-E SLI PLUS with BIOS revision 1502'.

Signed-off-by: Mart Gerrits <mart1987@gmail.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
12 years agowatchdog: shwdt: fix usage of mod_timer
David Engraf [Wed, 20 Jul 2011 13:03:39 +0000 (15:03 +0200)]
watchdog: shwdt: fix usage of mod_timer

Fix the usage of mod_timer() and make the driver usable. mod_timer() must
be called with an absolute timeout in jiffies. The old implementation
used a relative timeout thus the hardware watchdog was never triggered.

Signed-off-by: David Engraf <david.engraf@sysgo.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Wim Van sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable <stable@kernel.org>
12 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Tue, 2 Aug 2011 08:08:54 +0000 (10:08 +0200)]
Merge branch 'fix/asoc' into for-linus

12 years agoALSA: asihpi - Clarify adapter index validity check
Eliot Blennerhassett [Mon, 1 Aug 2011 21:44:24 +0000 (09:44 +1200)]
ALSA: asihpi - Clarify adapter index validity check

Avoids assigning possibly invalid address to pa, even if it
is never dereferenced.
Correct error response to reflect request object/function ids.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoACPI print OSI(Linux) warning only once
Len Brown [Tue, 2 Aug 2011 04:45:48 +0000 (00:45 -0400)]
ACPI print OSI(Linux) warning only once

This message gets repeated on some machines:
https://bugzilla.kernel.org/show_bug.cgi?id=29292

Signed-off-by: Len Brown <len.brown@intel.com>
12 years agooom: task->mm == NULL doesn't mean the memory was freed
Oleg Nesterov [Sat, 30 Jul 2011 14:35:02 +0000 (16:35 +0200)]
oom: task->mm == NULL doesn't mean the memory was freed

exit_mm() sets ->mm == NULL then it does mmput()->exit_mmap() which
frees the memory.

However select_bad_process() checks ->mm != NULL before TIF_MEMDIE,
so it continues to kill other tasks even if we have the oom-killed
task freeing its memory.

Change select_bad_process() to check ->mm after TIF_MEMDIE, but skip
the tasks which have already passed exit_notify() to ensure a zombie
with TIF_MEMDIE set can't block oom-killer. Alternatively we could
probably clear TIF_MEMDIE after exit_mmap().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
Linus Torvalds [Tue, 2 Aug 2011 00:05:46 +0000 (14:05 -1000)]
Merge branch 'for-linus' of git://git./linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (23 commits)
  regulator: Improve WM831x DVS VSEL selection algorithm
  regulator: Bootstrap wm831x DVS VSEL value from ON VSEL if not already set
  regulator: Set up GPIO for WM831x VSEL before enabling VSEL mode
  regulator: Add EPEs to the MODULE_ALIAS() for wm831x-dcdc
  regulator: Fix WM831x DCDC DVS VSEL bootstrapping
  regulator: Fix WM831x regulator ID lookups for multiple WM831xs
  regulator: Fix argument format type errors in error prints
  regulator: Fix memory leak in set_machine_constraints() error paths
  regulator: Make core more chatty about some errors
  regulator: tps65910: Fix array access out of bounds bug
  regulator: tps65910: Add missing breaks in switch/case
  regulator: tps65910: Fix a memory leak in tps65910_probe error path
  regulator: TWL: Remove entry of RES_ID for 6030 macros
  ASoC: tlv320aic3x: Add correct hw registers to Line1 cross connect muxes
  regulator: Add basic per consumer debugfs
  regulator: Add rdev_crit() macro
  regulator: Refactor supply implementation to work as regular consumers
  regulator: Include the device name in the microamps_requested_ file
  regulator: Increase the limit on sysfs file names
  regulator: Properly register dummy regulator driver
  ...

12 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Linus Torvalds [Mon, 1 Aug 2011 23:56:03 +0000 (13:56 -1000)]
Merge branch 'for_linus' of git://git./linux/kernel/git/tytso/ext4

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (60 commits)
  ext4: prevent memory leaks from ext4_mb_init_backend() on error path
  ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #
  ext4: use ext4_msg() instead of printk in mballoc
  ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
  ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()
  ext4: use the correct error exit path in ext4_init_inode_table()
  ext4: add missing kfree() on error return path in add_new_gdb()
  ext4: change umode_t in tracepoint headers to be an explicit __u16
  ext4: fix races in ext4_sync_parent()
  ext4: Fix overflow caused by missing cast in ext4_fallocate()
  ext4: add action of moving index in ext4_ext_rm_idx for Punch Hole
  ext4: simplify parameters of reserve_backup_gdb()
  ext4: simplify parameters of add_new_gdb()
  ext4: remove lock_buffer in bclean() and setup_new_group_blocks()
  ext4: simplify journal handling in setup_new_group_blocks()
  ext4: let setup_new_group_blocks() set multiple bits at a time
  ext4: fix a typo in ext4_group_extend()
  ext4: let ext4_group_add_blocks() handle 0 blocks quickly
  ext4: let ext4_group_add_blocks() return an error code
  ext4: rename ext4_add_groupblocks() to ext4_group_add_blocks()
  ...

Fix up conflict in fs/ext4/inode.c: commit aacfc19c626e ("fs: simplify
the blockdev_direct_IO prototype") had changed the ext4_ind_direct_IO()
function for the new simplified calling convention, while commit
dae1e52cb126 ("ext4: move ext4_ind_* functions from inode.c to
indirect.c") moved the function to another file.

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Mon, 1 Aug 2011 23:48:31 +0000 (13:48 -1000)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  xfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set
  VFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock
  VFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()
  VFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()
  switch posix_acl_chmod() to umode_t
  switch posix_acl_from_mode() to umode_t
  switch posix_acl_equiv_mode() to umode_t *
  switch posix_acl_create() to umode_t *
  block: initialise bd_super in bdget()
  vfs: avoid call to inode_lru_list_del() if possible
  vfs: avoid taking inode_hash_lock on pipes and sockets
  vfs: conditionally call inode_wb_list_del()
  VFS: Fix automount for negative autofs dentries
  Btrfs: load the key from the dir item in readdir into a fake dentry
  devtmpfs: missing initialialization in never-hit case
  hppfs: missing include

12 years agoMerge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Mon, 1 Aug 2011 23:46:37 +0000 (13:46 -1000)]
Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma

* 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (37 commits)
  Improve slave/cyclic DMA engine documentation
  dmaengine: pl08x: handle the rest of enums in pl08x_width
  DMA: PL08x: cleanup selection of burst size
  DMA: PL08x: avoid recalculating cctl at each prepare
  DMA: PL08x: cleanup selection of buswidth
  DMA: PL08x: constify plchan->cd and plat->slave_channels
  DMA: PL08x: separately store source/destination cctl
  DMA: PL08x: separately store source/destination slave address
  DMA: PL08x: clean up LLI debugging
  DMA: PL08x: select LLI bus only once per LLI setup
  DMA: PL08x: remove unused constants
  ARM: mxs-dma: reset after disable channel
  dma: intel_mid_dma: remove redundant pci_set_drvdata calls
  dma: mxs-dma: fix unterminated platform_device_id table
  dmaengine: pl330: make platform data optional
  dmaengine: imx-sdma: return proper error if kzalloc fails
  pch_dma: Fix CTL register access issue
  dmaengine: mxs-dma: skip request_irq for NO_IRQ
  dmaengine/coh901318: fix slave submission semantics
  dmaengine/ste_dma40: allow memory buswidth/burst to be configured
  ...

Fix trivial whitespace conflict in drivers/dma/mv_xor.c

12 years agoMerge branch 'gpiolib' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Mon, 1 Aug 2011 23:41:43 +0000 (13:41 -1000)]
Merge branch 'gpiolib' of git://git./linux/kernel/git/aegl/linux-2.6

* 'gpiolib' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Hook up gpiolib support

12 years agoMerge branch 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Mon, 1 Aug 2011 23:40:51 +0000 (13:40 -1000)]
Merge branch 'pstore-efi' of git://git./linux/kernel/git/aegl/linux-2.6

* 'pstore-efi' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  efivars: Introduce PSTORE_EFI_ATTRIBUTES
  efivars: Use string functions in pstore_write
  efivars: introduce utf16_strncmp
  efivars: String functions
  efi: Add support for using efivars as a pstore backend
  pstore: Allow the user to explicitly choose a backend
  pstore: Make "part" unsigned
  pstore: Add extra context for writes and erases
  pstore: Extend API for more flexibility in new backends

12 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
Linus Torvalds [Mon, 1 Aug 2011 23:39:40 +0000 (13:39 -1000)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  kdb,kgdb: Allow arbitrary kgdb magic knock sequences
  kdb: Remove all references to DOING_KGDB2
  kdb,kgdb: Implement switch and pass buffer from kdb -> gdb
  kdb: cleanup unused variables missed in the original kdb merge

12 years agoext4: prevent memory leaks from ext4_mb_init_backend() on error path
Yu Jian [Mon, 1 Aug 2011 21:41:46 +0000 (17:41 -0400)]
ext4: prevent memory leaks from ext4_mb_init_backend() on error path

In ext4_mb_init(), if the s_locality_group allocation fails it will
currently cause the allocations made in ext4_mb_init_backend() to
be leaked.  Moving the ext4_mb_init_backend() allocation after the
s_locality_group allocation avoids that problem.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #
Yu Jian [Mon, 1 Aug 2011 21:41:39 +0000 (17:41 -0400)]
ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode #

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: use ext4_msg() instead of printk in mballoc
Theodore Ts'o [Mon, 1 Aug 2011 21:41:35 +0000 (17:41 -0400)]
ext4: use ext4_msg() instead of printk in mballoc

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoBtrfs: don't call writepages from within write_full_page
Josef Bacik [Mon, 1 Aug 2011 18:37:36 +0000 (14:37 -0400)]
Btrfs: don't call writepages from within write_full_page

When doing a writepage we call writepages to try and write out any other dirty
pages in the area.  This could cause problems where we commit a transaction and
then have somebody else dirtying metadata in the area as we could end up writing
out a lot more than we care about, which could cause latency on anybody who is
waiting for the transaction to completely finish committing.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: Remove unused variable 'last_index' in file.c
Mitch Harder [Tue, 12 Jul 2011 19:43:45 +0000 (19:43 +0000)]
Btrfs: Remove unused variable 'last_index' in file.c

The variable 'last_index' is calculated in the __btrfs_buffered_write
function and passed as a parameter to the prepare_pages function,
but is not used anywhere in the prepare_pages function.

Remove instances of 'last_index' in these functions.

Signed-off-by: Mitch Harder <mitch.harder@sabayonlinux.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up for find_first_extent_bit()
Xiao Guangrong [Thu, 14 Jul 2011 03:19:45 +0000 (03:19 +0000)]
Btrfs: clean up for find_first_extent_bit()

find_first_extent_bit() and find_first_extent_bit_state() share
most of the code, and we can just make the former call the latter.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up for wait_extent_bit()
Xiao Guangrong [Thu, 14 Jul 2011 03:19:27 +0000 (03:19 +0000)]
Btrfs: clean up for wait_extent_bit()

We can just use cond_resched_lock().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up for insert_state()
Xiao Guangrong [Thu, 14 Jul 2011 03:19:08 +0000 (03:19 +0000)]
Btrfs: clean up for insert_state()

Don't duplicate set_state_bits().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove unused members from struct extent_state
Xiao Guangrong [Thu, 14 Jul 2011 03:18:52 +0000 (03:18 +0000)]
Btrfs: remove unused members from struct extent_state

These members are not used at all.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up code for merging extent maps
Li Zefan [Thu, 14 Jul 2011 03:18:33 +0000 (03:18 +0000)]
Btrfs: clean up code for merging extent maps

unpin_extent_cache() and add_extent_mapping() shares the same code
that merges extent maps.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up code for extent_map lookup
Li Zefan [Thu, 14 Jul 2011 03:18:15 +0000 (03:18 +0000)]
Btrfs: clean up code for extent_map lookup

lookup_extent_map() and search_extent_map() can share most of code.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: clean up search_extent_mapping()
Li Zefan [Thu, 14 Jul 2011 03:18:03 +0000 (03:18 +0000)]
Btrfs: clean up search_extent_mapping()

rb_node returned by __tree_search() can be a valid pointer or NULL,
but won't be some errno.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove redundant code for dir item lookup
Li Zefan [Thu, 14 Jul 2011 03:17:52 +0000 (03:17 +0000)]
Btrfs: remove redundant code for dir item lookup

When we search a dir item with a specific hash code, we can
just return NULL without further checking if btrfs_search_slot()
returns 1.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: make acl functions really no-op if acl is not enabled
Li Zefan [Thu, 14 Jul 2011 03:17:39 +0000 (03:17 +0000)]
Btrfs: make acl functions really no-op if acl is not enabled

So there's no overhead for something we don't use.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove remaining ref-cache code
Li Zefan [Thu, 14 Jul 2011 03:17:27 +0000 (03:17 +0000)]
Btrfs: remove remaining ref-cache code

Since commit f2a97a9dbd86eb1ef956bdf20e05c507b32beb96
("btrfs: remove all unused functions"), there's no extern functions
at all in ref-cache.c, so just remove the remaining dead code.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: remove a BUG_ON() in btrfs_commit_transaction()
Li Zefan [Thu, 14 Jul 2011 03:17:14 +0000 (03:17 +0000)]
Btrfs: remove a BUG_ON() in btrfs_commit_transaction()

wait_for_commit() always returns 0.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: use wait_event()
Li Zefan [Thu, 14 Jul 2011 03:17:00 +0000 (03:17 +0000)]
Btrfs: use wait_event()

Use wait_event() when possible to avoid code duplication.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: check the nodatasum flag when writing compressed files
Li Zefan [Thu, 14 Jul 2011 03:16:47 +0000 (03:16 +0000)]
Btrfs: check the nodatasum flag when writing compressed files

If mounting with nodatasum option, we won't csum file data for
general write or direct-io write, and this rule should also be
applied when writing compressed files.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: copy string correctly in INO_LOOKUP ioctl
Li Zefan [Thu, 14 Jul 2011 03:16:00 +0000 (03:16 +0000)]
Btrfs: copy string correctly in INO_LOOKUP ioctl

Memory areas [ptr, ptr+total_len] and [name, name+total_len]
may overlap, so it's wrong to use memcpy().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: don't print the leaf if we had an error
Josef Bacik [Wed, 13 Jul 2011 15:03:50 +0000 (15:03 +0000)]
Btrfs: don't print the leaf if we had an error

In __btrfs_free_extent we will print the leaf if we fail to find the extent we
wanted, but the problem is if we get an error we won't have a leaf so often this
leads to a NULL pointer dereference and we lose the error that actually
occurred.  So only print the leaf if ret > 0, which means we didn't find the
item we were looking for but we didn't error either.  This way the error is
preserved.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: make btrfs_set_root_node void
Mark Fasheh [Thu, 14 Jul 2011 21:23:06 +0000 (21:23 +0000)]
btrfs: make btrfs_set_root_node void

This is fairly trivial - btrfs_set_root_node() - always returns zero so we
can just make it void.  All callers ignore the return code now anyway.  I
also made sure to check that none of the functions that
btrfs_set_root_node() calls returns an error that we might have needed to
catch and pass back.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: fix oops while writing data to SSD partitions
liubo [Wed, 27 Jul 2011 09:49:18 +0000 (09:49 +0000)]
Btrfs: fix oops while writing data to SSD partitions

Here I have a two SSD-partitions btrfs, and they are defaultly set to
"data=raid0, metadata=raid1", then I try to fill my btrfs partition
till "No space left on device", via "dd if=/dev/zero of=/mnt/btrfs/tmp".

I get an oops panic from kernel BUG at fs/btrfs/extent-tree.c:5199!, which
refers to find_free_extent's
BUG_ON(index != get_block_group_index(block_group));

In SSD mode, in order to find enough space to alloc, we may check the
block_group cache which has been checked sometime before, but the index is not
updated, where it hits the BUG_ON.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Acked-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: Protect the readonly flag of block group
WuBo [Tue, 26 Jul 2011 03:30:11 +0000 (03:30 +0000)]
Btrfs: Protect the readonly flag of block group

The access for ro in btrfs_block_group_cache should be protected
because of the racy lock in relocation.

Signed-off-by: Wu Bo <wu.bo@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agobtrfs: Make extent-io callbacks that never fail return void
Jeff Mahoney [Thu, 21 Jul 2011 16:56:09 +0000 (16:56 +0000)]
btrfs: Make extent-io callbacks that never fail return void

The set/clear bit and the extent split/merge hooks only ever return 0.

 Changing them to return void simplifies the error handling cases later.

 This patch changes the hook prototypes, the single implementation of each,
 and the functions that call them to return void instead.

 Since all four of these hooks execute under a spinlock, they're necessarily
 simple.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: fix readahead in file defrag
Li Zefan [Wed, 20 Jul 2011 03:46:35 +0000 (03:46 +0000)]
Btrfs: fix readahead in file defrag

We passed the wrong value to btrfs_force_ra(). Fix this by changing
the argument of btrfs_force_ra() from last_index to nr_page.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs: return error to caller when btrfs_unlink() failes
Tsutomu Itoh [Tue, 19 Jul 2011 07:27:20 +0000 (07:27 +0000)]
Btrfs: return error to caller when btrfs_unlink() failes

When btrfs_unlink_inode() and btrfs_orphan_add() in btrfs_unlink()
are error, the error code is returned to the caller instead of
BUG_ON().

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoBtrfs:don't check the return value of __btrfs_add_inode_defrag
Wanlong Gao [Mon, 18 Jul 2011 12:19:35 +0000 (12:19 +0000)]
Btrfs:don't check the return value of __btrfs_add_inode_defrag

Don't need to check the return value of __btrfs_add_inode_defrag(),
since it will always return 0.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
12 years agoMerge branch 'alloc_path' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh...
Chris Mason [Mon, 1 Aug 2011 18:27:34 +0000 (14:27 -0400)]
Merge branch 'alloc_path' of git://git./linux/kernel/git/mfasheh/btrfs-error-handling into for-linus

12 years agokdb,kgdb: Allow arbitrary kgdb magic knock sequences
Jason Wessel [Tue, 24 May 2011 15:43:06 +0000 (10:43 -0500)]
kdb,kgdb: Allow arbitrary kgdb magic knock sequences

The first packet that gdb sends when the kernel is in kdb mode seems
to change with every release of gdb.  Instead of continuing to add
many different gdb packets, change kdb to automatically look for any
thing that looks like a gdb packet.

Example 1 cold start test:
echo g > /proc/sysrq-trigger
$D#44+

Example 2 cold start test:
echo g > /proc/sysrq-trigger
$3#33

The second one should re-enter kdb's shell right away and is purely a
test.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agokdb: Remove all references to DOING_KGDB2
Jason Wessel [Mon, 23 May 2011 18:22:54 +0000 (13:22 -0500)]
kdb: Remove all references to DOING_KGDB2

The DOING_KGDB2 was originally a state variable for one of the two
ways to automatically transition from kdb to kgdb.  Purge all these
variables and just use one single state for the transition.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agokdb,kgdb: Implement switch and pass buffer from kdb -> gdb
Jason Wessel [Mon, 23 May 2011 18:17:41 +0000 (13:17 -0500)]
kdb,kgdb: Implement switch and pass buffer from kdb -> gdb

When switching from kdb mode to kgdb mode packets were getting lost
depending on the size of the fifo queue of the serial chip.  When gdb
initially connects if it is in kdb mode it should entirely send any
character buffer over to the gdbstub when switching connections.

Previously kdb was zero'ing out the character buffer and this could
lead to gdb failing to connect at all, or a lengthy pause could occur
on the initial connect.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agokdb: cleanup unused variables missed in the original kdb merge
Jason Wessel [Thu, 30 Jun 2011 19:12:00 +0000 (14:12 -0500)]
kdb: cleanup unused variables missed in the original kdb merge

The BTARGS and BTSYMARG variables do not have any function in the
mainline version of kdb.

Reported-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12 years agoMerge branch 'for-next' into for-linus
Liam Girdwood [Mon, 1 Aug 2011 17:25:06 +0000 (18:25 +0100)]
Merge branch 'for-next' into for-linus

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Mon, 1 Aug 2011 16:14:25 +0000 (06:14 -1000)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  CIFS: Cleanup demupltiplex thread exiting code
  CIFS: Move mid search to a separate function
  CIFS: Move RFC1002 check to a separate function
  CIFS: Simplify socket reading in demultiplex thread
  CIFS: Move buffer allocation to a separate function
  cifs: remove unneeded variable initialization in cifs_reconnect_tcon
  cifs: simplify refcounting for oplock breaks
  cifs: fix compiler warning in CIFSSMBQAllEAs
  cifs: fix name parsing in CIFSSMBQAllEAs
  cifs: don't start signing too early
  cifs: trivial: goto out here is unnecessary
  cifs: advertise the right receive buffer size to the server

12 years agoMerge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6
Linus Torvalds [Mon, 1 Aug 2011 16:13:48 +0000 (06:13 -1000)]
Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6

* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6:
  gpio_msm: Move Qualcomm MSM v2 gpio driver into drivers
  gpio_msm: Move Qualcomm v6 MSM driver into drivers
  msm: gpio: Fold register defs into C file
  msm: gpiomux: Move public API to public header
  msm: gpio: Remove ifdefs on gpio chip registers
  msm: gpio: Remove chip-specific register definitions
  msm: Remove chip-ifdefs for GPIO io mappings
  msm: gpio: Remove unsupported devices
  gpio: ab8500: fix MODULE_ALIAS for ab8500
  of/gpio: export of_gpio_simple_xlate

12 years agoMerge branch 'for-3.1-rc1' of git://gitorious.org/linux-omap-dss2/linux
Linus Torvalds [Mon, 1 Aug 2011 16:13:05 +0000 (06:13 -1000)]
Merge branch 'for-3.1-rc1' of git://gitorious.org/linux-omap-dss2/linux

* 'for-3.1-rc1' of git://gitorious.org/linux-omap-dss2/linux: (31 commits)
  OMAP: DSS2: HDMI: fix hdmi clock name
  HACK: OMAP: DSS2: clk hack for OMAP2/3
  OMAP: DSS2: DSS: Fix context save/restore
  OMAP: DSS2: DISPC: Fix context save/restore
  OMAP: DSS2: Remove ctx loss count from dss.c
  OMAP: DSS2: Remove unused code from display.c
  OMAP: DSS2: DISPC: remove finegrained clk enables/disables
  OMAP: DSS2: Remove unused opt_clock_available
  OMAP: DSS2: Use PM runtime & HWMOD support
  OMAP: DSS2: Remove CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET
  OMAP: DSS2: Remove core_dump_clocks
  OMAP: DSS2: DPI: remove unneeded SYSCK enable/disable
  OMAP: DSS2: Use omap_pm_get_dev_context_loss_count to get ctx loss count
  OMAP: DSS2: rewrite use of context_loss_count
  OMAP: DSS2: Remove clk optimization at dss init
  OMAP: DSS2: Fix init and unit sequence
  OMAP: DSS2: Clean up probe for DSS & DSI
  OMAP: DSS2: Handle dpll4_m4_ck in dss_get/put_clocks
  OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4
  OMAP: DSS2: DSI: sync when disabling a display
  ...

12 years agoMerge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal...
Linus Torvalds [Mon, 1 Aug 2011 16:10:16 +0000 (06:10 -1000)]
Merge branch 'sh-latest' of git://git./linux/kernel/git/lethal/sh-3.x

* 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-3.x: (39 commits)
  SH: static should be at beginning of declaration
  sh: move CLKDEV_xxx_ID macro to sh_clk.h
  sh: clock-shx3: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7786: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7785: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7757: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7343: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7722: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7724: add CLKDEV_ICK_ID for cleanup
  sh: clock-sh7366: modify I2C clock settings
  sh: clock-sh7343: modify I2C clock settings
  sh: clock-sh7723: modify I2C clock settings
  sh: clock-sh7722: modify I2C clock settings
  sh: clock-sh7724: modify I2C clock settings
  serial: sh-sci: Fix up pretty name printing for port IRQs.
  serial: sh-sci: Kill off per-port enable/disable callbacks.
  serial: sh-sci: Add missing module description/author bits.
  serial: sh-sci: Regtype probing doesn't need to be fatal.
  sh: Tidy up pre-clkdev clk_get() error handling.
  ...

12 years agoinput: xilinx_ps2: Add missing of_address.h header
Michal Simek [Wed, 13 Jul 2011 13:46:21 +0000 (15:46 +0200)]
input: xilinx_ps2: Add missing of_address.h header

Add missing header.

Error log:
CC      drivers/input/serio/xilinx_ps2.o
drivers/input/serio/xilinx_ps2.c: In function 'xps2_of_probe':
drivers/input/serio/xilinx_ps2.c:249: error: implicit declaration of function 'of_address_to_resource'

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoMerge branch 'msm-move-gpio' of git://codeaurora.org/quic/kernel/davidb/linux-msm...
Grant Likely [Mon, 1 Aug 2011 14:16:05 +0000 (15:16 +0100)]
Merge branch 'msm-move-gpio' of git://codeaurora.org/quic/kernel/davidb/linux-msm into gpio/next

Conflicts:
drivers/gpio/Kconfig
drivers/gpio/Makefile

12 years agoCIFS: Cleanup demupltiplex thread exiting code
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:44 +0000 (13:19 +0400)]
CIFS: Cleanup demupltiplex thread exiting code

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Move mid search to a separate function
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:43 +0000 (13:19 +0400)]
CIFS: Move mid search to a separate function

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Move RFC1002 check to a separate function
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:42 +0000 (13:19 +0400)]
CIFS: Move RFC1002 check to a separate function

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoCIFS: Simplify socket reading in demultiplex thread
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:41 +0000 (13:19 +0400)]
CIFS: Simplify socket reading in demultiplex thread

Move reading to separate function and remove csocket variable.

Also change semantic in a little: goto incomplete_rcv only when
we get -EAGAIN (or a familiar error) while reading rfc1002 header.
In this case we don't check for echo timeout when we don't get whole
header at once, as it was before.

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agoext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
Theodore Ts'o [Mon, 1 Aug 2011 12:45:38 +0000 (08:45 -0400)]
ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()
Theodore Ts'o [Mon, 1 Aug 2011 12:45:02 +0000 (08:45 -0400)]
ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree()

Introduce new helper functions which try kmalloc, and then fall back
to vmalloc if necessary, and use them for allocating and deallocating
s_flex_groups.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoCIFS: Move buffer allocation to a separate function
Pavel Shilovsky [Mon, 1 Aug 2011 09:19:40 +0000 (13:19 +0400)]
CIFS: Move buffer allocation to a separate function

Reviewed-and-Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
12 years agogpio_msm: Move Qualcomm MSM v2 gpio driver into drivers
David Brown [Mon, 16 May 2011 22:53:38 +0000 (15:53 -0700)]
gpio_msm: Move Qualcomm MSM v2 gpio driver into drivers

Migrate the driver for the v7-based MSM chips into drivers/gpio.  The
driver is unchanged, only moved.

Change-Id: I810db5b50b71cdca4e869aa0d0310f7f48781a55
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agogpio_msm: Move Qualcomm v6 MSM driver into drivers
David Brown [Mon, 16 May 2011 20:57:39 +0000 (13:57 -0700)]
gpio_msm: Move Qualcomm v6 MSM driver into drivers

Migrate the driver for the v6-based MSM chips into drivers/gpio.  The
driver is unchanged, only moved.

Change-Id: I03ba597b95b4d62b42da112a8efac88d67aa40f9
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Fold register defs into C file
David Brown [Mon, 6 Jun 2011 21:09:45 +0000 (14:09 -0700)]
msm: gpio: Fold register defs into C file

No need to have a separate header file containing only register
definitions that are used by a single driver.  Fold these into the
gpio driver.

Signed-off-by: David Brown <davidb@codeaurora.org>
12 years agomsm: gpiomux: Move public API to public header
David Brown [Mon, 16 May 2011 20:32:15 +0000 (13:32 -0700)]
msm: gpiomux: Move public API to public header

The gpiomux.h header contains some SOC ifdefs.  However, the API that
is actually used by the GPIO driver only uses two functions that are
general.  Move these general definitions into a public header file.

Change-Id: Ia5df8af87dba268225598d56908e523bcfc24ef6
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Remove ifdefs on gpio chip registers
David Brown [Thu, 12 May 2011 08:28:01 +0000 (01:28 -0700)]
msm: gpio: Remove ifdefs on gpio chip registers

Select the GPIO register configuration at runtime rather than through
idefs.

Change-Id: I02ea0a3d61bc81669f32097c32420f0688552231
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Remove chip-specific register definitions
David Brown [Thu, 12 May 2011 08:16:46 +0000 (01:16 -0700)]
msm: gpio: Remove chip-specific register definitions

Put an SOC prefix on each GPIO register definition, eliminating the
need to have SOC ifdefs around the definitions.

Change-Id: I5a01fd328a89ce1be610847934d6e118f5465e42
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: Remove chip-ifdefs for GPIO io mappings
David Brown [Thu, 12 May 2011 07:54:36 +0000 (00:54 -0700)]
msm: Remove chip-ifdefs for GPIO io mappings

The two GPIO controllers are always mapped to the same virtual address
across all MSM devices.  Instead of selecting this at compile time,
determine the physical address at runtime, eliminating yet something
else preventing multiple MSM targets from being compiled into the same
kernel.

Change-Id: I1672219d978ab6243526adeda6badf49472baa27
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agomsm: gpio: Remove unsupported devices
David Brown [Thu, 12 May 2011 07:33:38 +0000 (00:33 -0700)]
msm: gpio: Remove unsupported devices

The MSM7x25 and MSM7x27 devices are not yet supported in the kernel.
Remove #ifdef-based tables supporting these chips for now.

Change-Id: I4d9f5abc4cc0942ce75a067097b072489493c1b8
Signed-off-by: David Brown <davidb@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
12 years agoOMAP: DSS2: HDMI: fix hdmi clock name
Tomi Valkeinen [Mon, 1 Aug 2011 11:54:44 +0000 (14:54 +0300)]
OMAP: DSS2: HDMI: fix hdmi clock name

The HDMI clock (hdmi_clk) is missing in the current OMAP4 HWMOD
database. Fix this in the DSS driver by using the old clock name
(dss_48mhz_clk).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
12 years agoHACK: OMAP: DSS2: clk hack for OMAP2/3
Tomi Valkeinen [Mon, 1 Aug 2011 11:32:23 +0000 (14:32 +0300)]
HACK: OMAP: DSS2: clk hack for OMAP2/3

The HWMOD data for OMAP2 and 3 are currently not up to date regarding
DSS (OMAP4 HWMOD data is fine). This patch makes the DSS driver to get
the opt clocks needed for OMAP2/3 with the old clock names, thus
allowing DSS driver to use runtime PM.

The HWMOD databases should be fixes ASAP, and this patch can be reverted
after that.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
12 years agoof: address: use resource_size helper
Felipe Balbi [Fri, 22 Jul 2011 19:47:21 +0000 (22:47 +0300)]
of: address: use resource_size helper

that should be the approved way of calculating
the size of resources. No functional changes.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
12 years agoext4: use the correct error exit path in ext4_init_inode_table()
Yongqiang Yang [Mon, 1 Aug 2011 10:32:19 +0000 (06:32 -0400)]
ext4: use the correct error exit path in ext4_init_inode_table()

This patch lets ext4_init_inode_table() handle errors right.
ext4_init_inode_table() should down_write() alloc_sem which
has been up_write()ed and stop the started journal handle.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12 years agoALSA: asihpi - Don't leak firmware if mem alloc fails
Jesper Juhl [Sun, 31 Jul 2011 21:16:43 +0000 (23:16 +0200)]
ALSA: asihpi - Don't leak firmware if mem alloc fails

We leak the memory allocated to 'firmware' when we fail to
release_firmware() after a kmalloc() failure in hpi_dsp_code_open().
This patch should take care of the leak.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoxfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set
Markus Trippelsdorf [Tue, 26 Jul 2011 09:15:20 +0000 (11:15 +0200)]
xfs: Fix build breakage in xfs_iops.c when CONFIG_FS_POSIX_ACL is not set

commit 4e34e719e45, that takes the ACL checks to common code,
accidentely broke the build when CONFIG_FS_POSIX_ACL is not set:

  CC      fs/xfs/linux-2.6/xfs_iops.o
fs/xfs/linux-2.6/xfs_iops.c:1025:14: error: ‘xfs_get_acl’ undeclared here (not in a function)

Fix this by declaring xfs_get_acl a static inline function.

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoVFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock
David Howells [Tue, 7 Jun 2011 13:09:30 +0000 (14:09 +0100)]
VFS: Reorganise shrink_dcache_for_umount_subtree() after demise of dcache_lock

Reorganise shrink_dcache_for_umount_subtree() in light of the demise of
dcache_lock.  Without that dcache_lock, there is no need for the batching of
removal of dentries from the system under it (we wanted to make intensive use
of the locked data whilst we held it, but didn't want to hold it for long at a
time).

This works, provided the preceding patch is correct in its removal of locking
on dentry->d_lock on the basis that no one should be locking these dentries any
more as the whole superblock is defunct.

With this patch, the calls to dentry_lru_del() and __d_shrink() are placed at
the point where each dentry is detached handled.

It is possible that, as an alternative, the batching should still be done -
but only for dentry_lru_del() of all a dentry's children in one go.  In such a
case, the batching would be done under dcache_lru_lock.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoVFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()
David Howells [Tue, 7 Jun 2011 13:09:20 +0000 (14:09 +0100)]
VFS: Remove dentry->d_lock locking from shrink_dcache_for_umount_subtree()

Locks of the dcache_lock were replaced by locks of dentry->d_lock in commits
such as:

2304450783dfde7b0b94ae234edd0dbffa865073
2fd6b7f50797f2e993eea59e0a0b8c6399c811dc

as part of the RCU-based pathwalk changes, despite the fact that the caller
(shrink_dcache_for_umount()) notes in the banner comment the reasons that
d_lock is not necessary in these functions:

/*
 * destroy the dentries attached to a superblock on unmounting
 * - we don't need to use dentry->d_lock because:
 *   - the superblock is detached from all mountings and open files, so the
 *     dentry trees will not be rearranged by the VFS
 *   - s_umount is write-locked, so the memory pressure shrinker will ignore
 *     any dentries belonging to this superblock that it comes across
 *   - the filesystem itself is no longer permitted to rearrange the dentries
 *     in this superblock
 */

So remove these locks.  If the locks are actually necessary, then this banner
comment should be altered instead.

The hash table chains are protected by 1-bit locks in the hash table heads, so
those shouldn't be a problem.

Note that to make this work, __d_drop() has to be split so that the RCUwalk
barrier can be avoided.  This causes problems otherwise as it has an assertion
that dentry->d_lock is locked - but there is no need for that as no one else
can be trying to access this dentry, except to step over it (and that should
be handled by d_free(), I think).

Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoVFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()
David Howells [Tue, 7 Jun 2011 13:09:10 +0000 (14:09 +0100)]
VFS: Remove detached-dentry counter from shrink_dcache_for_umount_subtree()

Remove the detached-dentry counter from shrink_dcache_for_umount_subtree() as
the value it computes is no longer used as of commit
312d3ca856d369bb04d0443846b85b4cdde6fa8a which made the nr_dentry counters
summed per-CPU rather than global atomic.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_chmod() to umode_t
Al Viro [Sat, 23 Jul 2011 23:03:11 +0000 (19:03 -0400)]
switch posix_acl_chmod() to umode_t

again, that's what all callers pass to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_from_mode() to umode_t
Al Viro [Sat, 23 Jul 2011 23:01:48 +0000 (19:01 -0400)]
switch posix_acl_from_mode() to umode_t

... seeing that this is what all callers pass to it anyway.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_equiv_mode() to umode_t *
Al Viro [Sat, 23 Jul 2011 22:56:36 +0000 (18:56 -0400)]
switch posix_acl_equiv_mode() to umode_t *

... so that &inode->i_mode could be passed to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoswitch posix_acl_create() to umode_t *
Al Viro [Sat, 23 Jul 2011 22:37:50 +0000 (18:37 -0400)]
switch posix_acl_create() to umode_t *

so we can pass &inode->i_mode to it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoblock: initialise bd_super in bdget()
Lachlan McIlroy [Thu, 30 Jun 2011 01:01:45 +0000 (11:01 +1000)]
block: initialise bd_super in bdget()

bd_super is currently reset to NULL in kill_block_super() so we rely on previous
users of the block_device object to initialise this value for the next user.
This quirk was exposed on RHEL5 when a third party filesystem did not always use
kill_block_super() and therefore bd_super wasn't being reset when a block_device
object was recycled within the cache.  This may not be a problem upstream but
makes sense to be defensive.

Signed-off-by: Lachlan McIlroy <lmcilroy@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: avoid call to inode_lru_list_del() if possible
Eric Dumazet [Thu, 28 Jul 2011 04:55:13 +0000 (06:55 +0200)]
vfs: avoid call to inode_lru_list_del() if possible

inode_lru_list_del() is expensive because of per superblock lru locking,
while some inodes are not in lru list.

Adding a check in iput_final() can speedup pipe/sockets workloads on
SMP.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: avoid taking inode_hash_lock on pipes and sockets
Eric Dumazet [Thu, 28 Jul 2011 04:41:09 +0000 (06:41 +0200)]
vfs: avoid taking inode_hash_lock on pipes and sockets

Some inodes (pipes, sockets, ...) are not hashed, no need to take
contended inode_hash_lock at dismantle time.

nice speedup on SMP machines on socket intensive workloads.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>