aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2009-02-04Btrfs: Change btrfs_truncate_inode_items to stop when it hits the inodeChris Mason
btrfs_truncate_inode_items is setup to stop doing btree searches when it has finished removing the items for the inode. It used to detect the end of the inode by looking for an objectid that didn't match the one we were searching for. But, this would result in an extra search through the btree, which adds extra balancing and cow costs to the operation. This commit adds a check to see if we found the inode item, which means we can stop searching early. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: Don't try to compress pages past i_sizeChris Mason
The compression code had some checks to make sure we were only compressing bytes inside of i_size, but it wasn't catching every case. To make things worse, some incorrect math about the number of bytes remaining would make it try to compress more pages than the file really had. The fix used here is to fall back to the non-compression code in this case, which does all the proper cleanup of delalloc and other accounting. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: join the transaction in __btrfs_setxattrJosef Bacik
With selinux on we end up calling __btrfs_setxattr when we create an inode, which calls btrfs_start_transaction(). The problem is we've already called that in btrfs_new_inode, and in btrfs_start_transaction we end up doing a wait_current_trans(). If btrfs-transaction has started committing it will wait for all handles to finish, while the other process is waiting for the transaction to commit. This is fixed by using btrfs_join_transaction, which won't wait for the transaction to commit. Thanks, Signed-off-by: Josef Bacik <jbacik@redhat.com>
2009-02-04Btrfs: Handle SGID bit when creating inodesChris Ball
Before this patch, new files/dirs would ignore the SGID bit on their parent directory and always be owned by the creating user's uid/gid. Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: Make btrfs_drop_snapshot work in larger and more efficient chunksChris Mason
Every transaction in btrfs creates a new snapshot, and then schedules the snapshot from the last transaction for deletion. Snapshot deletion works by walking down the btree and dropping the reference counts on each btree block during the walk. If if a given leaf or node has a reference count greater than one, the reference count is decremented and the subtree pointed to by that node is ignored. If the reference count is one, walking continues down into that node or leaf, and the references of everything it points to are decremented. The old code would try to work in small pieces, walking down the tree until it found the lowest leaf or node to free and then returning. This was very friendly to the rest of the FS because it didn't have a huge impact on other operations. But it wouldn't always keep up with the rate that new commits added new snapshots for deletion, and it wasn't very optimal for the extent allocation tree because it wasn't finding leaves that were close together on disk and processing them at the same time. This changes things to walk down to a level 1 node and then process it in bulk. All the leaf pointers are sorted and the leaves are dropped in order based on their extent number. The extent allocation tree and commit code are now fast enough for this kind of bulk processing to work without slowing the rest of the FS down. Overall it does less IO and is better able to keep up with snapshot deletions under high load. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: Change btree locking to use explicit blocking pointsChris Mason
Most of the btrfs metadata operations can be protected by a spinlock, but some operations still need to schedule. So far, btrfs has been using a mutex along with a trylock loop, most of the time it is able to avoid going for the full mutex, so the trylock loop is a big performance gain. This commit is step one for getting rid of the blocking locks entirely. btrfs_tree_lock takes a spinlock, and the code explicitly switches to a blocking lock when it starts an operation that can schedule. We'll be able get rid of the blocking locks in smaller pieces over time. Tracing allows us to find the most common cause of blocking, so we can start with the hot spots first. The basic idea is: btrfs_tree_lock() returns with the spin lock held btrfs_set_lock_blocking() sets the EXTENT_BUFFER_BLOCKING bit in the extent buffer flags, and then drops the spin lock. The buffer is still considered locked by all of the btrfs code. If btrfs_tree_lock gets the spinlock but finds the blocking bit set, it drops the spin lock and waits on a wait queue for the blocking bit to go away. Much of the code that needs to set the blocking bit finishes without actually blocking a good percentage of the time. So, an adaptive spin is still used against the blocking bit to avoid very high context switch rates. btrfs_clear_lock_blocking() clears the blocking bit and returns with the spinlock held again. btrfs_tree_unlock() can be called on either blocking or spinning locks, it does the right thing based on the blocking bit. ctree.c has a helper function to set/clear all the locked buffers in a path as blocking. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: hash_lock is no longer neededChris Mason
Before metadata is written to disk, it is updated to reflect that writeout has begun. Once this update is done, the block must be cow'd before it can be modified again. This update was originally synchronized by using a per-fs spinlock. Today the buffers for the metadata blocks are locked before writeout begins, and everyone that tests the flag has the buffer locked as well. So, the per-fs spinlock (called hash_lock for no good reason) is no longer required. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: disable leak debugging checks in extent_io.cChris Mason
extent_io.c has debugging code to report and free leaked extent_state and extent_buffer objects at rmmod time. This helps track down leaks and it saves you from rebooting just to properly remove the kmem_cache object. But, the code runs under a fairly expensive spinlock and the checks to see if it is currently enabled are not entirely consistent. Some use #ifdef and some #if. This changes everything to #if and disables the leak checking. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: sort references by byte number during btrfs_inc_refChris Mason
When a block goes through cow, we update the reference counts of everything that block points to. The internal pointers of the block can be in just about any order, and it is likely to have clusters of things that are close together and clusters of things that are not. To help reduce the seeks that come with updating all of these reference counts, sort them by byte number before actual updates are done. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: async threads should try harder to find workChris Mason
Tracing shows the delay between when an async thread goes to sleep and when more work is added is often very short. This commit adds a little bit of delay and extra checking to the code right before we schedule out. It allows more work to be added to the worker without requiring notifications from other procs. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Btrfs: selinux supportJim Owens
Add call to LSM security initialization and save resulting security xattr for new inodes. Add xattr support to symlink inode ops. Set inode->i_op for existing special files. Signed-off-by: jim owens <jowens@hp.com>
2009-02-04Btrfs: make btrfs acls selectableChristian Hesse
This patch adds a menu entry to kconfig to enable acls for btrfs. This allows you to enable FS_POSIX_ACL at kernel compile time. (updated by Jeff Mahoney to make the changes in fs/btrfs/Kconfig instead) Signed-off-by: Christian Hesse <mail@earthworm.de> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
2009-02-04Btrfs: Catch missed bios in the async bio submission threadChris Mason
The async bio submission thread was missing some bios that were added after it had decided there was no work left to do. Signed-off-by: Chris Mason <chris.mason@oracle.com>
2009-02-04Merge branch 'core/xen' into x86/urgentIngo Molnar
2009-02-04Blackfin arch: Remove outdated codeMichael Hennerich
The removed version with the loop registers saved on the stack was originally intended to workaround the missing toolchain support for LoopReg Clobbers. Since our toolchain now supports these there is no point in keeping this workaround. And since we don't touch LoopRegs anymore we're no longer subject for ANOMALY_05000312. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix udelay implementationMichael Hennerich
Avoid possible overflow during 32*32->32 multiplies. Reported-by: Marco Reppenhagen <marco.reppenhagen@auerswald.de> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Update Copyright informationMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add BF561 PPI POLS, POLC MasksMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Update CM-BF527 kernel configMichael Hennerich
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: define bfin_memmap as static since it is only used hereMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: cplb mananger: use a do...while loop rather than a for loopMike Frysinger
use a do...while loop rather than a for loop to get slightly better optimization and to avoid gcc "may be used uninitialized" warnings ... we know that the [id]cplb_nr_bounds variables will never be 0, so this is OK Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: fix bug - traps test case 19 for exception 0x2d failsBernd Schmidt
Enable null pointer checking for ICPLBs. The code was there but for some reason I had commented it out at some stage during development. Should restrict this to 1K since atomic ops start there. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: add platform device bfin_mii-bus and KSZ8893M switch driver ↵Graf Yang
platform resources to board files Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: build jtag tty driver as a module by defaultMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: fix 2 bugs related to debugJie Zhang
- unable to single step over emuexcpt instruction - gdbproxy goes into infinite loop when doing gdb does "next" over "emuexcpt" Don't decrement PC after software breakpoint. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add ANOMALY_05000380 to BF54x to kill the compile warningBryan Wu
Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix bug - 561 SMP kernel can't boot from jffs2Graf Yang
bss_l2 section is garbage when the data in this section is used by _bfin_relocate_l1_mem, so move the zero out function ahead. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: base SIC_IWR# programming on whether the MMR existsMike Frysinger
base SIC_IWR# programming on whether the MMR exists rather than having to maintain another list of processors Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: read SYSCR on newer parts that mirror the bits of SWRST in itMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: fixup board init function nameMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: drop CONFIG_I2C_BOARDINFO ifdefsMike Frysinger
Drop CONFIG_I2C_BOARDINFO ifdefs as the common i2c header handles this already by stubbing things out Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: bfin_reset->_bfin_reset redirection no longer neededMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: sync reboot handler with version in u-bootMike Frysinger
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Faster Implementation of csum_tcpudp_nofold()Michael Hennerich
Avoid conditional branch instructions during carry bit additions. Special thanks to Bernd. Simplify: Use ((len + proto) << 8) like every other __LITTLE_ENDIAN__ machine Cc: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix bug - BF518 port F, G, and H have different mux offset ↵Graf Yang
compare to BF527 [Mike Frysinger <vapier.adi@gmail.com>: keep the ifdef nest down] Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add in cflag to support mlong-calls for kgdb_testGrace Pan
Signed-off-by: Grace Pan <grace.pan@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix bug - Run "reboot" hangs bf518-ezbrdSonic Zhang
[Mike Frysinger <vapier.adi@gmail.com>: - setup P_DEFAULT_BOOT_SPI_CS for every arch based on the default bootrom behavior and convert all our boards to it - revert previous anomaly change ... bf51x is not affected by anomaly 05000353] Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04MAINTIANERS: Blackfin: remove subscribers-only markingMike Frysinger
remove subscribers-only marking as the list is automatically & silently moderated for people Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add ability to count and display number of NMI interruptsRobin Getz
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add a few more instructions that can cause the trace buffer ↵Robin Getz
to be discontiguous Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix URLRobin Getz
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: cleanup bf54x ifdef mess in gpio codeMike Frysinger
merge more of the bf54x and !bf54x gpio code together to cut down on #ifdef mess Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Add one more check on `fp' to prevent double faultJie Zhang
Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: explicit add a might sleep to gpio_freeUwe Kleine-Koenig
According to the documentation gpio_free should only be called from task context only. To make this more explicit add a might sleep to all implementations. This patch changes the gpio_free implementations for the blackfin architecture. Signed-off-by: Uwe Kleine-Koenig <ukleinek@strlen.de> Cc: David Brownell <david-b@pacbell.net> Acked-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2009-02-04Blackfin arch: don't accidently re-enable interruptsRobin Getz
Make sure we don't accidently re-enable interrupts if we are being called in atomic context Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Print out where the bootmode is coming from (for easier ↵Robin Getz
debugging). Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: reset POLAR setting when acquiring a gpio for the first timeMichael Hennerich
when requesting a GPIO for the first time, the POLAR setting is not set to a sane state. this can lead to indeterminate behavior that cannot be resolved without an explicit write to the Blackfin port POLAR register. when requesting a GPIO for the first time via gpio_request(), the POLAR setting for the GPIO in question should be set to sane state. this should occur if the GPIO has not been allocated in any other way. some examples: - when doing something like "request_irq(); gpio_request();" on the same GPIO, the POLAR setting should not be reset. - when doing "gpio_request(); gpio_request();" on the same GPIO, the POLAR setting should be reset only the first time and not the second. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix Bug - request lines with peripheral_request_list, but ↵Michael Hennerich
don't get freed with peripheral_free_list Remove erroneous check_gpio(ident) in peripheral_free() Reported-by: Michael McTernan <mmcternan@airvana.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: Fix Bug - Kernel does not boot if re-program clocksMichael Hennerich
On BF561 EBIU_SDGCTL bit 31 controls the SDRAM external data path width, typically set 0 for a 32-bit bus width. On other Blackfin derivatives this bit should be set by default. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
2009-02-04Blackfin arch: fix bug - Dmacopy failed in BF537-STAMPMike Frysinger
Dmacopy failed in BF537-STAMP when copy from SRAM to SDRAM and kernel will reboot automatically. Fixing by doing a SSYNC before mucking with DMA registers Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>