]> pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
17 years agoIPoIB: Fix crash when path record fails after path flush
Roland Dreier [Thu, 25 Sep 2008 22:28:08 +0000 (15:28 -0700)]
IPoIB: Fix crash when path record fails after path flush

Commit ee1e2c82 ("IPoIB: Refresh paths instead of flushing them on SM
change events") changed how paths are flushed on an SM event.  This
change introduces a problem if the path record query triggered by
fails, causing path->ah to become NULL.  A later successful path query
will then trigger WARN_ON() in path_rec_completion(), and crash
because path->ah has already been freed, so the ipoib_put_ah() inside
the lock in path_rec_completion() may actually drop the last reference
(contrary to the comment that claims this is safe).

Fix this by updating path->ah and freeing old_ah only when the path
record query is successful.  This prevents the neighbour AH and that
path AH from getting out of sync.

This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1194>

Reported-by: Rabah Salem <ravah@mellanox.com>
Debugged-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years ago[ARM] dma: Reduce to one dma_map_sg()/dma_unmap_sg() implementation
Russell King [Thu, 25 Sep 2008 20:05:02 +0000 (21:05 +0100)]
[ARM] dma: Reduce to one dma_map_sg()/dma_unmap_sg() implementation

No point having two of these; dma_map_page() can do all the work
for us.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years ago[ARM] dma: provide a better dma_map_page() implementation
Russell King [Thu, 25 Sep 2008 19:59:12 +0000 (20:59 +0100)]
[ARM] dma: provide a better dma_map_page() implementation

We can translate a struct page directly to a DMA address using
page_to_dma().  No need to use page_address() followed by
virt_to_dma().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years agoIPoIB: Fix crash when path record fails after path flush
Roland Dreier [Thu, 25 Sep 2008 22:26:15 +0000 (15:26 -0700)]
IPoIB: Fix crash when path record fails after path flush

Commit ee1e2c82 ("IPoIB: Refresh paths instead of flushing them on SM
change events") changed how paths are flushed on an SM event.  This
change introduces a problem if the path record query triggered by
fails, causing path->ah to become NULL.  A later successful path query
will then trigger WARN_ON() in path_rec_completion(), and crash
because path->ah has already been freed, so the ipoib_put_ah() inside
the lock in path_rec_completion() may actually drop the last reference
(contrary to the comment that claims this is safe).

Fix this by updating path->ah and freeing old_ah only when the path
record query is successful.  This prevents the neighbour AH and that
path AH from getting out of sync.

This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1194>

Reported-by: Rabah Salem <ravah@mellanox.com>
Debugged-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
17 years ago[ARM] Orion: Add Buffalo Linkstation Mini support
Alexey Kopytko [Thu, 25 Sep 2008 13:47:30 +0000 (22:47 +0900)]
[ARM] Orion: Add Buffalo Linkstation Mini support

This patch adds support for Buffalo Linkstation Mini board.

Signed-off-by: Alexey Kopytko <alexey@kopytko.ru>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
17 years ago[ARM] Kirkwood: add support for L2 cache WB/WT selection
Ronen Shitrit [Tue, 23 Sep 2008 12:28:10 +0000 (15:28 +0300)]
[ARM] Kirkwood: add support for L2 cache WB/WT selection

Feroceon L2 cache can work in eighther write through or write back mode
on Kirkwood. Add the option to configure this mode according to Kconfig.

Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
17 years ago[ARM] EDMINIV2: add support for LED and power button
Albert Aribaud [Fri, 19 Sep 2008 19:06:25 +0000 (21:06 +0200)]
[ARM] EDMINIV2: add support for LED and power button

This patch provides standard GPIO LED control
for the ED Mini V2, with software blinking only
(CPLD hardware blinking capability is not used).

This patch also provides status of the power
button as a standard GPIO input event.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
17 years ago[ARM] Kirkwood: allow configuring mbus window for on-chip sram
Lennert Buytenhek [Sun, 31 Aug 2008 05:39:19 +0000 (07:39 +0200)]
[ARM] Kirkwood: allow configuring mbus window for on-chip sram

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Kirkwood: remove uart1 init calls for boards that don't expose uart1
Ronen Shitrit [Sun, 14 Sep 2008 17:30:27 +0000 (20:30 +0300)]
[ARM] Kirkwood: remove uart1 init calls for boards that don't expose uart1

Remove uart1 init calls for boards that use the physical pins onto
which the UART1 signals are multiplexed for different purposes.

Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Kirkwood: add support for newer SoC models
Ronen Shitrit [Mon, 15 Sep 2008 07:40:35 +0000 (10:40 +0300)]
[ARM] Kirkwood: add support for newer SoC models

Add support to the Kirkwood port for newer device models and silicon
revisions.  Instead of looking at the DEVICE_ID register, the device
version is now determined by looking at the PCI-Express device ID and
revision registers, as it is done for orion5x, and this information
is used to determine the TCLK frequency, again, as it is done for
orion5x.

Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Kirkwood: prepare for runtime-determined timer tick rate
Ronen Shitrit [Sun, 14 Sep 2008 22:56:38 +0000 (00:56 +0200)]
[ARM] Kirkwood: prepare for runtime-determined timer tick rate

Currently, kirkwood uses a hardcoded timer tick rate of 166 MHz, but
the actual timer tick rate varies between different members of the SoC
family.

This patch prepares for runtime determination of the timer tick rate.

Signed-off-by: Ronen Shitrit <rshitrit@marvell.com>
17 years ago[ARM] Orion: add RD88F6183AP-GE support
Lennert Buytenhek [Fri, 29 Aug 2008 04:59:34 +0000 (06:59 +0200)]
[ARM] Orion: add RD88F6183AP-GE support

The RD88F6183AP-GE is an access point reference design for the
88F6183 SoC, with a 88E6161 six-port gigabit ethernet switch with
five PHYs (providing 1 WAN and 4 LAN ports and an interface to the
CPU), and a mini-PCIe slot for a wireless card.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Orion: add 88F6183 (Orion-1-90) support
Lennert Buytenhek [Fri, 29 Aug 2008 04:55:06 +0000 (06:55 +0200)]
[ARM] Orion: add 88F6183 (Orion-1-90) support

The Orion-1-90 (88F6183) is another member of the Orion SoC family,
which has a 16 bit DDR2 interface, one x1 PCIe port (configurable as
Root Complex or Endpoint), one 10/100/1000 ethernet interface, one
USB 2.0 port with PHY, one SPDIF/I2S interface, one SDIO interface,
one TWSI interface, two UARTs, one SPI interface, a NAND controller,
a crypto engine, and a 4-channel DMA engine.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Orion: add Buffalo Terastation Pro II/Live support
Sylver Bruneau [Thu, 28 Aug 2008 20:18:54 +0000 (22:18 +0200)]
[ARM] Orion: add Buffalo Terastation Pro II/Live support

This patch adds support for the Buffalo Terastation Pro II/Live.

Signed-off-by: Sylver Bruneau <sylver.bruneau@googlemail.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Orion: add LaCie Ethernet Disk mini V2 support
Christopher Moore [Thu, 17 Jul 2008 22:25:10 +0000 (00:25 +0200)]
[ARM] Orion: add LaCie Ethernet Disk mini V2 support

This patch adds support for the LaCie Ethernet Disk mini V2.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
Signed-off-by: Christopher Moore <moore@free.fr>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Orion: prepare for runtime-determined timer tick rate
Lennert Buytenhek [Fri, 29 Aug 2008 03:55:51 +0000 (05:55 +0200)]
[ARM] Orion: prepare for runtime-determined timer tick rate

Currently, orion5x uses a hardcoded timer tick rate of 166 MHz, but
the actual timer tick rate varies between different members of the SoC
family (and can vary based on strap pin settings).

This patch prepares for runtime determination of the timer tick rate.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] mv78xx0: wire up ethernet error interrupt
Lennert Buytenhek [Tue, 26 Aug 2008 14:04:05 +0000 (16:04 +0200)]
[ARM] mv78xx0: wire up ethernet error interrupt

Wire up the ethernet port's error interrupt so that the
mv643xx_eth driver can sleep for SMI event completion instead of
having to busy-wait for it.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
17 years ago[ARM] Kirkwood: wire up ethernet error interrupt
Lennert Buytenhek [Tue, 26 Aug 2008 14:04:05 +0000 (16:04 +0200)]
[ARM] Kirkwood: wire up ethernet error interrupt

Wire up the ethernet port's error interrupt so that the
mv643xx_eth driver can sleep for SMI event completion instead of
having to busy-wait for it.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years ago[ARM] Orion: wire up ethernet error interrupt
Lennert Buytenhek [Tue, 26 Aug 2008 14:01:21 +0000 (16:01 +0200)]
[ARM] Orion: wire up ethernet error interrupt

Wire up the ethernet port's error interrupt so that the
mv643xx_eth driver can sleep for SMI event completion instead of
having to busy-wait for it.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
17 years agoACPI: EC: do transaction from interrupt context
Alexey Starikovskiy [Thu, 25 Sep 2008 17:00:31 +0000 (21:00 +0400)]
ACPI: EC: do transaction from interrupt context

It is easier and faster to do transaction directly from interrupt context
rather than waking control thread.
Also, cleaner GPE storm avoidance is implemented.
References:  http://bugzilla.kernel.org/show_bug.cgi?id=9998
http://bugzilla.kernel.org/show_bug.cgi?id=10724
http://bugzilla.kernel.org/show_bug.cgi?id=10919
http://bugzilla.kernel.org/show_bug.cgi?id=11309
http://bugzilla.kernel.org/show_bug.cgi?id=11549
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Len Brown <len.brown@intel.com>
17 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 25 Sep 2008 20:16:16 +0000 (13:16 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

17 years agoRevert "ehea: fix mutex and spinlock use"
David S. Miller [Thu, 25 Sep 2008 20:06:59 +0000 (13:06 -0700)]
Revert "ehea: fix mutex and spinlock use"

This reverts commit 2eefbd63d0c85daa1317636474c226e236beba81.

On request by driver author and Jeff Garzik.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[ARM] Update dma_map_sg()/dma_unmap_sg() API
Russell King [Thu, 25 Sep 2008 15:30:57 +0000 (16:30 +0100)]
[ARM] Update dma_map_sg()/dma_unmap_sg() API

Update the ARM DMA scatter gather APIs for the scatterlist changes.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
17 years agoBtrfs: Raise thresholds for metadata writeback
Chris Mason [Wed, 24 Sep 2008 18:51:30 +0000 (14:51 -0400)]
Btrfs: Raise thresholds for metadata writeback

Btrfs metadata writeback is fairly expensive.  Once a tree block is written
it must be cowed before it can be changed again.  The btree writepages
code has a threshold based on a count of dirty btree bytes which is
updated as IO is sent out.

This changes btree_writepages to skip the writeout if there are less
than 32MB of dirty bytes from the btrees, improving performance
across many workloads.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: fix sleep with spinlock held during unmount
Chris Mason [Wed, 24 Sep 2008 16:50:10 +0000 (12:50 -0400)]
Btrfs: fix sleep with spinlock held during unmount

The code to free block groups needs to drop the space info spin lock
before calling btrfs_remove_free_space_cache (which can schedule).

This is safe because at unmount time, nobody else is going to play
with the block groups.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoRemove Btrfs compat code for older kernels
Chris Mason [Wed, 24 Sep 2008 15:48:04 +0000 (11:48 -0400)]
Remove Btrfs compat code for older kernels

Btrfs had compatibility code for kernels back to 2.6.18.  These have
been removed, and will be maintained in a separate backport
git tree from now on.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix allocation completions in tree log replay
Chris Mason [Wed, 24 Sep 2008 15:23:25 +0000 (11:23 -0400)]
Btrfs: Fix allocation completions in tree log replay

After a crash, the tree log code uses btrfs_alloc_logged_extent to
record allocations of data extents that it finds in the log tree.  These
come in basically random order, which does not fit how
btrfs_remove_free_space() expects to be called.

btrfs_remove_free_space was changed to support recording an extent
allocation in the middle of a region of free space.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoAdd Btrfs to fs/Kconfig and fs/Makefile
Chris Mason [Thu, 25 Sep 2008 16:25:16 +0000 (12:25 -0400)]
Add Btrfs to fs/Kconfig and fs/Makefile

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoUpdate Btrfs files for in-kernel usage
Chris Mason [Wed, 24 Sep 2008 15:05:53 +0000 (11:05 -0400)]
Update Btrfs files for in-kernel usage

btrfs had magic to put the chagneset id into a printk on module load.
This removes that from the Makefile and hardcodes the printk to print
"Btrfs"

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoMerge Btrfs into fs/btrfs
Chris Mason [Thu, 25 Sep 2008 19:32:36 +0000 (15:32 -0400)]
Merge Btrfs into fs/btrfs

17 years agoALSA: remove unneeded power_mutex lock in snd_pcm_drop
Takashi Iwai [Thu, 25 Sep 2008 15:51:11 +0000 (17:51 +0200)]
ALSA: remove unneeded power_mutex lock in snd_pcm_drop

The power_mutex lock in snd_pcm_drop may cause a possible deadlock
chain, and above all, it's unneeded.  Let's get rid of it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 years agoserial/mpc52xx_uart: remove code associated with !CONFIG_PPC_MERGE
Kumar Gala [Fri, 1 Aug 2008 16:09:34 +0000 (11:09 -0500)]
serial/mpc52xx_uart: remove code associated with !CONFIG_PPC_MERGE

Now that arch/ppc is gone we don't need CONFIG_PPC_MERGE anymore
remove the dead code associated with !CONFIG_PPC_MERGE.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
17 years agoBtrfs: Fix race against disk_i_size updates
Chris Mason [Wed, 24 Sep 2008 00:19:49 +0000 (20:19 -0400)]
Btrfs: Fix race against disk_i_size updates

The code to update the on disk i_size happens before the
ordered_extent record is removed.  So, it is possible for multiple
ordered_extent completion routines to run at the same time, and to
find each other in the ordered tree.

The end result is they both decide not to update disk_i_size, leaving
it too small.  This temporary fix just puts the updates inside
the extent_mutex.  A real solution would be stronger ordering of
disk_i_size updates against removing the ordered extent from the tree.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Full back reference support
Zheng Yan [Tue, 23 Sep 2008 17:14:14 +0000 (13:14 -0400)]
Btrfs: Full back reference support

This patch makes the back reference system to explicit record the
location of parent node for all types of extents. The location of
parent node is placed into the offset field of backref key. Every
time a tree block is balanced, the back references for the affected
lower level extents are updated.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoAdd check for tree-log roots in btrfs_alloc_reserved_extents
Chris Mason [Tue, 23 Sep 2008 17:14:13 +0000 (13:14 -0400)]
Add check for tree-log roots in btrfs_alloc_reserved_extents

Tree log blocks are only reserved, and should not ever get fully
allocated on disk.  This check makes sure they stay out of the
extent tree.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Checksum tree blocks in the background
Chris Mason [Tue, 23 Sep 2008 17:14:12 +0000 (13:14 -0400)]
Btrfs: Checksum tree blocks in the background

Tree blocks were using async bio submission, but the sum was still
being done directly during writepage.  This moves the checksumming
into the worker thread.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: free space accounting redo
Josef Bacik [Tue, 23 Sep 2008 17:14:11 +0000 (13:14 -0400)]
Btrfs: free space accounting redo

1) replace the per fs_info extent_io_tree that tracked free space with two
rb-trees per block group to track free space areas via offset and size.  The
reason to do this is because most allocations come with a hint byte where to
start, so we can usually find a chunk of free space at that hint byte to satisfy
the allocation and get good space packing.  If we cannot find free space at or
after the given offset we fall back on looking for a chunk of the given size as
close to that given offset as possible.  When we fall back on the size search we
also try to find a slot as close to the size we want as possible, to avoid
breaking small chunks off of huge areas if possible.

2) remove the extent_io_tree that tracked the block group cache from fs_info and
replaced it with an rb-tree thats tracks block group cache via offset.  also
added a per space_info list that tracks the block group cache for the particular
space so we can lookup related block groups easily.

3) cleaned up the allocation code to make it a little easier to read and a
little less complicated.  Basically there are 3 steps, first look from our
provided hint.  If we couldn't find from that given hint, start back at our
original search start and look for space from there.  If that fails try to
allocate space if we can and start looking again.  If not we're screwed and need
to start over again.

4) small fixes.  there were some issues in volumes.c where we wouldn't allocate
the rest of the disk.  fixed cow_file_range to actually pass the alloc_hint,
which has helped a good bit in making the fs_mark test I run have semi-normal
results as we run out of space.  Generally with data allocations we don't track
where we last allocated from, so everytime we did a data allocation we'd search
through every block group that we have looking for free space.  Now searching a
block group with no free space isn't terribly time consuming, it was causing a
slight degradation as we got more data block groups.  The alloc_hint has fixed
this slight degredation and made things semi-normal.

There is still one nagging problem I'm working on where we will get ENOSPC when
there is definitely plenty of space.  This only happens with metadata
allocations, and only when we are almost full.  So you generally hit the 85%
mark first, but sometimes you'll hit the BUG before you hit the 85% wall.  I'm
still tracking it down, but until then this seems to be pretty stable and make a
significant performance gain.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: fix cache_block_group error handling
Josef Bacik [Tue, 23 Sep 2008 17:14:11 +0000 (13:14 -0400)]
Btrfs: fix cache_block_group error handling

cache block group had a few bugs in the error handling code,
this makes sure paths get properly released and the correct return value
goes out.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoFix leaf overflow check in btrfs_insert_empty_items
Chris Mason [Fri, 12 Sep 2008 19:32:53 +0000 (15:32 -0400)]
Fix leaf overflow check in btrfs_insert_empty_items

It was incorrectly adding an extra sizeof(struct btrfs_item) and causing
false positives (oops)

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix mismerge in block header checks
Chris Mason [Fri, 12 Sep 2008 12:57:47 +0000 (08:57 -0400)]
Btrfs: Fix mismerge in block header checks

I had incorrectly disabled the check for the block number being correct
in the header block.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Disable the dir fsync optimization to skip logging the dir sometimes
Chris Mason [Thu, 11 Sep 2008 21:42:42 +0000 (17:42 -0400)]
Btrfs: Disable the dir fsync optimization to skip logging the dir sometimes

More testing has turned up a bug, disable this for now.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Record dirty pages tree-log pages in an extent_io tree
Chris Mason [Thu, 11 Sep 2008 20:17:57 +0000 (16:17 -0400)]
Btrfs: Record dirty pages tree-log pages in an extent_io tree

This is the same way the transaction code makes sure that all the
other tree blocks are safely on disk.  There's an extent_io tree
for each root, and any blocks allocated to the tree logs are
recorded in that tree.

At tree-log sync, the extent_io tree is walked to flush down the
dirty pages and wait for them.

The main benefit is less time spent walking the tree log and skipping
clean pages, and getting sequential IO down to the drive.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Copy into the log tree in big batches
Chris Mason [Thu, 11 Sep 2008 20:17:57 +0000 (16:17 -0400)]
Btrfs: Copy into the log tree in big batches

This changes the log tree copy code to use btrfs_insert_items and
to work in larger batches where possible.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Optimize tree log block allocations
Chris Mason [Thu, 11 Sep 2008 19:54:42 +0000 (15:54 -0400)]
Btrfs: Optimize tree log block allocations

Since tree log blocks get freed every transaction, they never really
need to be written to disk.  This skips the step where we update
metadata to record they were allocated.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Optimize btree walking while logging inodes
Chris Mason [Thu, 11 Sep 2008 19:53:37 +0000 (15:53 -0400)]
Btrfs: Optimize btree walking while logging inodes

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Dir fsync optimizations
Chris Mason [Thu, 11 Sep 2008 19:53:12 +0000 (15:53 -0400)]
Btrfs: Dir fsync optimizations

Drop i_mutex during the commit

Don't bother doing the fsync at all unless the dir is marked as dirtied
and needing fsync in this transaction.  For directories, this means
that someone has unlinked a file from the dir without fsyncing the
file.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix releasepage to properly keep dirty and writeback pages
Chris Mason [Thu, 11 Sep 2008 19:51:43 +0000 (15:51 -0400)]
Btrfs: Fix releasepage to properly keep dirty and writeback pages

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Update the highest objectid in a root after log replay is done
Chris Mason [Thu, 11 Sep 2008 19:51:21 +0000 (15:51 -0400)]
Btrfs: Update the highest objectid in a root after log replay is done

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Tree logging fixes
Chris Mason [Mon, 8 Sep 2008 15:18:08 +0000 (11:18 -0400)]
Btrfs: Tree logging fixes

* Pin down data blocks to prevent them from being reallocated like so:

trans 1: allocate file extent
trans 2: free file extent
trans 3: free file extent during old snapshot deletion
trans 3: allocate file extent to new file
trans 3: fsync new file

Before the tree logging code, this was legal because the fsync
would commit the transation that did the final data extent free
and the transaction that allocated the extent to the new file
at the same time.

With the tree logging code, the tree log subtransaction can commit
before the transaction that freed the extent.  If we crash,
we're left with two different files using the extent.

* Don't wait in start_transaction if log replay is going on.  This
avoids deadlocks from iput while we're cleaning up link counts in the
replay code.

* Don't deadlock in replay_one_name by trying to read an inode off
the disk while holding paths for the directory

* Hold the buffer lock while we mark a buffer as written.  This
closes a race where someone is changing a buffer while we write it.
They are supposed to mark it dirty again after they change it, but
this violates the cow rules.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: properly set blocksize when adding new device.
Zheng Yan [Fri, 5 Sep 2008 20:43:54 +0000 (16:43 -0400)]
Btrfs: properly set blocksize when adding new device.

---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Update find free objectid function for orphan cleanup code
Zheng Yan [Fri, 5 Sep 2008 20:43:53 +0000 (16:43 -0400)]
Btrfs: Update find free objectid function for orphan cleanup code

Orphan items use BTRFS_ORPHAN_OBJECTID (-5UUL) as key objectid. This
affects the find free objectid functions, inode objectid can easily
overflow after orphan file cleanup.

---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: trivial sparse fixes
Christoph Hellwig [Fri, 5 Sep 2008 20:43:31 +0000 (16:43 -0400)]
Btrfs: trivial sparse fixes

Fix a bunch of trivial sparse complaints.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoremove unused function btrfs_ilookup
Christoph Hellwig [Fri, 5 Sep 2008 20:43:29 +0000 (16:43 -0400)]
remove unused function btrfs_ilookup

btrfs_ilookup is unused, which is good because a normal filesystem
should never have to use ilookup anyway.  Remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: missing endianess conversion in insert_new_root
Christoph Hellwig [Fri, 5 Sep 2008 20:43:28 +0000 (16:43 -0400)]
Btrfs: missing endianess conversion in insert_new_root

Add two missing endianess conversions in this function, found by sparse.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: cleanup d_obtain_alias useage
Christoph Hellwig [Fri, 5 Sep 2008 20:43:20 +0000 (16:43 -0400)]
Btrfs: cleanup d_obtain_alias useage

d_obtain_alias is intended as a tailcall that can pass in errors encoded
in the inode pointer if needed, so use it that way instead of
duplicating the error handling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Rev the disk format
Chris Mason [Fri, 5 Sep 2008 20:43:06 +0000 (16:43 -0400)]
Btrfs: Rev the disk format

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Add a write ahead tree log to optimize synchronous operations
Chris Mason [Fri, 5 Sep 2008 20:13:11 +0000 (16:13 -0400)]
Btrfs: Add a write ahead tree log to optimize synchronous operations

File syncs and directory syncs are optimized by copying their
items into a special (copy-on-write) log tree.  There is one log tree per
subvolume and the btrfs super block points to a tree of log tree roots.

After a crash, items are copied out of the log tree and back into the
subvolume.  See tree-log.c for all the details.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Add debugging checks to track down corrupted metadata
Chris Mason [Fri, 5 Sep 2008 20:09:51 +0000 (16:09 -0400)]
Btrfs: Add debugging checks to track down corrupted metadata

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: optimize btrget/set/removexattr
Christoph Hellwig [Thu, 28 Aug 2008 10:21:17 +0000 (06:21 -0400)]
Btrfs: optimize btrget/set/removexattr

btrfs actually stores the whole xattr name, including the prefix ondisk,
so using the generic resolver that strips off the prefix is not very
helpful.  Instead do the real ondisk xattrs manually and only use the
generic resolver for synthetic xattrs like ACLs.

(Sorry Josef for guiding you towards the wrong direction here intially)

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agobtrfs: optmize listxattr
Christoph Hellwig [Thu, 28 Aug 2008 10:21:16 +0000 (06:21 -0400)]
btrfs: optmize listxattr

The ->list handler is really not useful at all, because we always call
btrfs_xattr_generic_list anyway.  After this is done
find_btrfs_xattr_handler becomes unused, and it becomes obvious that the
temporary name buffer allocation isn't needed but we can directly copy
into the supplied buffer.

Tested with various getfattr -d calls on varying xattr lists.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: compile when posix acl's are disabled
Josef Bacik [Thu, 28 Aug 2008 10:21:15 +0000 (06:21 -0400)]
Btrfs: compile when posix acl's are disabled

This patch makes btrfs so it will compile properly when acls are disabled.  I
tested this and it worked with CONFIG_FS_POSIX_ACL off and on.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix variable init during csum creation
Chris Mason [Thu, 28 Aug 2008 10:15:25 +0000 (06:15 -0400)]
Btrfs: Fix variable init during csum creation

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Throttle for async bio submits higher up the chain
Chris Mason [Thu, 28 Aug 2008 10:15:24 +0000 (06:15 -0400)]
Btrfs: Throttle for async bio submits higher up the chain

The current code waits for the count of async bio submits to get below
a given threshold if it is too high right after adding the latest bio
to the work queue.  This isn't optimal because the caller may have
sequential adjacent bios pending they are waiting to send down the pipe.

This changeset requires the caller to wait on the async bio count,
and changes the async checksumming submits to wait for async bios any
time they self throttle.

The end result is much higher sequential throughput.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Rev the disk format
Chris Mason [Thu, 21 Aug 2008 19:49:09 +0000 (15:49 -0400)]
Btrfs: Rev the disk format

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoClean up btrfs_get_parent() a little more, fix a free-after-free bug
David Woodhouse [Tue, 19 Aug 2008 21:33:04 +0000 (22:33 +0100)]
Clean up btrfs_get_parent() a little more, fix a free-after-free bug

Date: Tue, 19 Aug 2008 22:33:04 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix NFS exporting of subvol roots.
David Woodhouse [Tue, 19 Aug 2008 21:20:17 +0000 (22:20 +0100)]
Btrfs: Fix NFS exporting of subvol roots.

Date: Tue, 19 Aug 2008 22:20:17 +0100
btrfs_lookup_fs_root() only finds subvol roots which have already been
seen and put into the cache. For btrfs_get_dentry() we actually have to
go to the medium -- so use btrfs_read_fs_root_no_name() instead.

In btrfs_get_parent(), notice when we've hit the root of the
subvolume and return the real root instead.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoSwitch btrfs_name_hash() to crc32c
David Woodhouse [Tue, 19 Aug 2008 18:21:57 +0000 (19:21 +0100)]
Switch btrfs_name_hash() to crc32c

Date: Tue, 19 Aug 2008 19:21:57 +0100
Using a 64-bit hash as the readdir cookie is just asking for trouble.
And gets it, when we try to export the file system by NFS.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Reinstate '-osubvol=.' option to mount entire tree
David Woodhouse [Tue, 19 Aug 2008 15:49:35 +0000 (16:49 +0100)]
Btrfs: Reinstate '-osubvol=.' option to mount entire tree

Date: Tue, 19 Aug 2008 16:49:35 +0100
This disappeared when I removed the special case for '.' in btrfs_lookup()

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoSimplify btrfs_get_parent(), fix use-after-free bug
David Woodhouse [Mon, 18 Aug 2008 21:50:22 +0000 (22:50 +0100)]
Simplify btrfs_get_parent(), fix use-after-free bug

Date: Mon, 18 Aug 2008 22:50:22 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoMask root object ID into f_fsid in btrfs_statfs()
David Woodhouse [Mon, 18 Aug 2008 12:10:20 +0000 (13:10 +0100)]
Mask root object ID into f_fsid in btrfs_statfs()

Date: Mon, 18 Aug 2008 13:10:20 +0100
This means that subvolumes get a different fsid, and NFS exporting them
works properly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoFill f_fsid field in btrfs_statfs()
David Woodhouse [Mon, 18 Aug 2008 11:01:52 +0000 (12:01 +0100)]
Fill f_fsid field in btrfs_statfs()

Date: Mon, 18 Aug 2008 12:01:52 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Optimise NFS readdir hack slightly; don't call readdir() again when done
David Woodhouse [Sun, 17 Aug 2008 16:12:56 +0000 (17:12 +0100)]
Btrfs: Optimise NFS readdir hack slightly; don't call readdir() again when done

Date: Sun, 17 Aug 2008 17:12:56 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoMinor cleanup of btrfs_real_readdir()
David Woodhouse [Sun, 17 Aug 2008 16:08:36 +0000 (17:08 +0100)]
Minor cleanup of btrfs_real_readdir()

Date: Sun, 17 Aug 2008 17:08:36 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Remove special cases for "." and ".."
David Woodhouse [Sun, 17 Aug 2008 14:14:48 +0000 (15:14 +0100)]
Btrfs: Remove special cases for "." and ".."

Date: Sun, 17 Aug 2008 15:14:48 +0100
We never get asked by the VFS to lookup either of them, and we can
handle the readdir() case a lot more simply, too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Discard sector data in __free_extent()
David Woodhouse [Tue, 12 Aug 2008 13:13:26 +0000 (14:13 +0100)]
Btrfs: Discard sector data in __free_extent()

Date: Tue, 12 Aug 2008 14:13:26 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Implement our own copy of the nfsd readdir hack, for older kernels
David Woodhouse [Wed, 6 Aug 2008 18:42:33 +0000 (19:42 +0100)]
Btrfs: Implement our own copy of the nfsd readdir hack, for older kernels

Date: Wed, 6 Aug 2008 19:42:33 +0100
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoNFS support for btrfs - v3
Balaji Rao [Sun, 20 Jul 2008 20:31:56 +0000 (02:01 +0530)]
NFS support for btrfs - v3

Date: Mon, 21 Jul 2008 02:01:56 +0530
Here's an implementation of NFS support for btrfs. It relies on the
fixes which are going in to 2.6.28 for the NFS readdir/lookup deadlock.

This uses the btrfs_iget helper introduced previously.

[dwmw2: Tidy up a little, switch to d_obtain_alias() w/compat routine,
change fh_type, store parent's root object ID where needed,
fix some get_parent() and fs_to_dentry() bugs]

Signed-off-by: Balaji Rao <balajirrao@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoIntroduce btrfs_iget helper
Balaji Rao [Sun, 20 Jul 2008 20:31:04 +0000 (02:01 +0530)]
Introduce btrfs_iget helper

Date: Mon, 21 Jul 2008 02:01:04 +0530
This patch introduces a btrfs_iget helper to be used in NFS support.

Signed-off-by: Balaji Rao <balajirrao@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Wait for async bio submissions to make some progress at queue time
Chris Mason [Wed, 20 Aug 2008 17:39:41 +0000 (13:39 -0400)]
Btrfs: Wait for async bio submissions to make some progress at queue time

Before, the btrfs bdi congestion function was used to test for too many
async bios.  This keeps that check to throttle pdflush, but also
adds a check while queuing bios.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Lookup readpage checksums on bio submission again
Chris Mason [Wed, 20 Aug 2008 13:44:52 +0000 (09:44 -0400)]
Btrfs: Lookup readpage checksums on bio submission again

This optimization had been removed because I thought it was triggering
csum errors.  The real cause of the errors was elsewhere, and so
this optimization is back.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix add_extent_mapping to check for duplicates across the whole range
Chris Mason [Wed, 20 Aug 2008 12:51:50 +0000 (08:51 -0400)]
Btrfs: Fix add_extent_mapping to check for duplicates across the whole range

add_extent_mapping was allowing the insertion of overlapping extents.
This never used to happen because it only inserted the extents from disk
and those were never overlapping.

But, with the data=ordered code, the disk and memory representations of the
file are not the same.  add_extent_mapping needs to ensure a new extent
does not overlap before it inserts.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Remove broken optimisations in end_bio functions.
David Woodhouse [Wed, 20 Aug 2008 12:51:49 +0000 (08:51 -0400)]
Btrfs: Remove broken optimisations in end_bio functions.

These ended up freeing objects while they were still using them. Under
guidance from Chris, just rip out the 'clever' bits and do things the
simple way.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Lower contention on the csum mutex
Chris Mason [Fri, 15 Aug 2008 19:34:18 +0000 (15:34 -0400)]
Btrfs: Lower contention on the csum mutex

This takes the csum mutex deeper in the call chain and releases it
more often.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Wait for kernel threads to make progress during async submission
Chris Mason [Fri, 15 Aug 2008 19:34:17 +0000 (15:34 -0400)]
Btrfs: Wait for kernel threads to make progress during async submission

Before this change, btrfs would use a bdi congestion function to make
sure there weren't too many pending async checksum work items.

This change makes the process creating async work items wait instead,
leading to fewer congestion returns from the bdi.  This improves
pdflush background_writeout scanning.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Give all the worker threads descriptive names
Chris Mason [Fri, 15 Aug 2008 19:34:16 +0000 (15:34 -0400)]
Btrfs: Give all the worker threads descriptive names

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Transaction commit: don't use filemap_fdatawait
Chris Mason [Fri, 15 Aug 2008 19:34:15 +0000 (15:34 -0400)]
Btrfs: Transaction commit: don't use filemap_fdatawait

After writing out all the remaining btree blocks in the transaction,
the commit code would use filemap_fdatawait to make sure it was all
on disk.  This means it would wait for blocks written by other procs
as well.

The new code walks the list of blocks for this transaction again
and waits only for those required by this transaction.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Count async bios separately from async checksum work items
Chris Mason [Fri, 15 Aug 2008 19:34:15 +0000 (15:34 -0400)]
Btrfs: Count async bios separately from async checksum work items

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Limit the number of async bio submission kthreads to the number of devices
Chris Mason [Fri, 15 Aug 2008 19:34:14 +0000 (15:34 -0400)]
Btrfs: Limit the number of async bio submission kthreads to the number of devices

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Init address_space->writeback_index properly
Chris Mason [Fri, 15 Aug 2008 19:34:14 +0000 (15:34 -0400)]
Btrfs: Init address_space->writeback_index properly

The writeback_index field is used by write_cache_pages to pick up where
writeback on a given inode left off.  But, it is never set to a sane
value, so writeback can often start at a random offset in the file.

Kernels 2.6.28 and higher will have this fixed, but for everyone else,
we also fill in the value in btrfs.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Change TestSetPageLocked() to trylock_page()
David Woodhouse [Thu, 7 Aug 2008 15:19:43 +0000 (11:19 -0400)]
Btrfs: Change TestSetPageLocked() to trylock_page()

Add backwards compatibility in compat.h

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
---
 compat.h    |    3 +++
 extent_io.c |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: fix RHEL test for ClearPageFsMisc
Eric Sandeen [Thu, 7 Aug 2008 15:19:42 +0000 (11:19 -0400)]
Btrfs: fix RHEL test for ClearPageFsMisc

Newer RHEL5 kernels define both ClearPageFSMisc and
ClearPageChecked, so test for both before redefining.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Update version.sh to v0.16
Chris Mason [Mon, 4 Aug 2008 19:45:30 +0000 (15:45 -0400)]
Btrfs: Update version.sh to v0.16

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Avoid calling into the FS for the final iput on fake root inodes
Chris Mason [Tue, 5 Aug 2008 17:30:48 +0000 (13:30 -0400)]
Btrfs: Avoid calling into the FS for the final iput on fake root inodes

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix nodatacow for the new data=ordered mode
Yan Zheng [Tue, 5 Aug 2008 17:05:02 +0000 (13:05 -0400)]
Btrfs: Fix nodatacow for the new data=ordered mode

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoGet rid of BTRFS_I(inode)->index and use local vars instead
Chris Mason [Tue, 5 Aug 2008 15:18:09 +0000 (11:18 -0400)]
Get rid of BTRFS_I(inode)->index and use local vars instead

rename and link don't always have a lock on the source inode, and
our use of a per-inode index variable was racy.  This changes things to
store the index in a local variable instead.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Fix the multi-bio code to save the original bio for completion
Chris Mason [Tue, 5 Aug 2008 14:13:57 +0000 (10:13 -0400)]
Btrfs: Fix the multi-bio code to save the original bio for completion

The multi-bio code is responsible for duplicating blocks in raid1 and
single spindle duplication.  It has counters to make sure all of
the locations for a given extent are properly written before io completion
is returned to the higher layers.

But, it didn't always complete the same bio it was given, sometimes a
clone was completed instead.  This lead to problems with the async
work queues because they saved a pointer to the bio in a struct off
bi_private.

The fix is to remember the original bio and only complete that one.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Update clone file ioctl
Yan Zheng [Tue, 5 Aug 2008 03:23:47 +0000 (23:23 -0400)]
Btrfs: Update clone file ioctl

This patch updates the file clone ioctl for the tree locking and new
data ordered code.

---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Various small fixes.
Yan Zheng [Tue, 5 Aug 2008 03:23:47 +0000 (23:23 -0400)]
Btrfs: Various small fixes.

This trivial patch contains two locking fixes and a off by one fix.

---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agobtrfs_lookup_bio_sums seems broken, go back to the readpage_io_hook for now
Chris Mason [Tue, 5 Aug 2008 03:17:27 +0000 (23:17 -0400)]
btrfs_lookup_bio_sums seems broken, go back to the readpage_io_hook for now

Signed-off-by: Chris Mason <chris.mason@oracle.com>
17 years agoBtrfs: Maintain a list of inodes that are delalloc and a way to wait on them
Chris Mason [Tue, 5 Aug 2008 03:17:27 +0000 (23:17 -0400)]
Btrfs: Maintain a list of inodes that are delalloc and a way to wait on them

Signed-off-by: Chris Mason <chris.mason@oracle.com>