diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-04-08 13:30:48 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-04-08 13:30:48 -0400 |
commit | dc2d3db8137fba0f62d7517e1bea8a47f69fcbc4 (patch) | |
tree | aee802680d09fe7c1288138cbfc0db17702e8075 /fs/btrfs/inode.c | |
parent | 8355ae69afca3b6bcb7b68712f30223455caebda (diff) | |
parent | 7f585bbfc54fec9dcf387fd2edb2d6f4908badf8 (diff) |
Merge tag 'omap-for-v3.10/timer-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/drivers
From Tony Lindgren <tony@atomide.com>:
Clean-up for omap2+ timers from Jon Hunter <jon-hunter@ti.com>:
This series consists mainly of clean-ups for clockevents and
clocksource timers on OMAP2+ devices. The most significant change
in functionality comes from the 5th patch which is changing the
selection of the clocksource timer for OMAP3 and AM335x devices
when gptimers are used for clocksource.
Note that this series depends on 7185684 (ARM: OMAP: use
consistent error checking) in RMK's tree and 960cba6 (ARM:
OMAP5: timer: Update the clocksource name as per clock data)
in omap-for-v3.10/fixes-non-critical. So this branch is based
on a merge of 7185684 and omap-for-v3.10/fixes-non-critical
to avoid non-trivial merge conflicts.
* tag 'omap-for-v3.10/timer-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP4+: Fix sparse warning in system timers
ARM: OMAP2+: Store ID of system timers in timer structure
ARM: OMAP3: Update clocksource timer selection
ARM: OMAP2+: Simplify system timers definitions
ARM: OMAP2+: Simplify system timer clock definitions
ARM: OMAP2+: Remove hard-coded test on timer ID
ARM: OMAP2+: Display correct system timer name
ARM: OMAP2+: fix typo "CONFIG_BRIDGE_DVFS"
ARM: OMAP1: remove "config MACH_OMAP_HTCWIZARD"
ARM: OMAP: dpll: enable bypass clock only when attempting dpll bypass
ARM: OMAP2+: powerdomain: avoid testing whether an unsigned char is less than 0
ARM: OMAP2+: hwmod: Remove unused _HWMOD_WAKEUP_ENABLED flag
ARM: OMAP2+: am335x: Change the wdt1 func clk src to per_32k clk
ARM: OMAP2+: AM33xx: hwmod: Add missing sysc definition to wdt1 entry
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ca1b767d51f7..09c58a35b429 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -353,6 +353,7 @@ static noinline int compress_file_range(struct inode *inode, | |||
353 | int i; | 353 | int i; |
354 | int will_compress; | 354 | int will_compress; |
355 | int compress_type = root->fs_info->compress_type; | 355 | int compress_type = root->fs_info->compress_type; |
356 | int redirty = 0; | ||
356 | 357 | ||
357 | /* if this is a small write inside eof, kick off a defrag */ | 358 | /* if this is a small write inside eof, kick off a defrag */ |
358 | if ((end - start + 1) < 16 * 1024 && | 359 | if ((end - start + 1) < 16 * 1024 && |
@@ -415,6 +416,17 @@ again: | |||
415 | if (BTRFS_I(inode)->force_compress) | 416 | if (BTRFS_I(inode)->force_compress) |
416 | compress_type = BTRFS_I(inode)->force_compress; | 417 | compress_type = BTRFS_I(inode)->force_compress; |
417 | 418 | ||
419 | /* | ||
420 | * we need to call clear_page_dirty_for_io on each | ||
421 | * page in the range. Otherwise applications with the file | ||
422 | * mmap'd can wander in and change the page contents while | ||
423 | * we are compressing them. | ||
424 | * | ||
425 | * If the compression fails for any reason, we set the pages | ||
426 | * dirty again later on. | ||
427 | */ | ||
428 | extent_range_clear_dirty_for_io(inode, start, end); | ||
429 | redirty = 1; | ||
418 | ret = btrfs_compress_pages(compress_type, | 430 | ret = btrfs_compress_pages(compress_type, |
419 | inode->i_mapping, start, | 431 | inode->i_mapping, start, |
420 | total_compressed, pages, | 432 | total_compressed, pages, |
@@ -554,6 +566,8 @@ cleanup_and_bail_uncompressed: | |||
554 | __set_page_dirty_nobuffers(locked_page); | 566 | __set_page_dirty_nobuffers(locked_page); |
555 | /* unlocked later on in the async handlers */ | 567 | /* unlocked later on in the async handlers */ |
556 | } | 568 | } |
569 | if (redirty) | ||
570 | extent_range_redirty_for_io(inode, start, end); | ||
557 | add_async_extent(async_cow, start, end - start + 1, | 571 | add_async_extent(async_cow, start, end - start + 1, |
558 | 0, NULL, 0, BTRFS_COMPRESS_NONE); | 572 | 0, NULL, 0, BTRFS_COMPRESS_NONE); |
559 | *num_added += 1; | 573 | *num_added += 1; |
@@ -1743,8 +1757,10 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans, | |||
1743 | struct btrfs_ordered_sum *sum; | 1757 | struct btrfs_ordered_sum *sum; |
1744 | 1758 | ||
1745 | list_for_each_entry(sum, list, list) { | 1759 | list_for_each_entry(sum, list, list) { |
1760 | trans->adding_csums = 1; | ||
1746 | btrfs_csum_file_blocks(trans, | 1761 | btrfs_csum_file_blocks(trans, |
1747 | BTRFS_I(inode)->root->fs_info->csum_root, sum); | 1762 | BTRFS_I(inode)->root->fs_info->csum_root, sum); |
1763 | trans->adding_csums = 0; | ||
1748 | } | 1764 | } |
1749 | return 0; | 1765 | return 0; |
1750 | } | 1766 | } |
@@ -3679,11 +3695,9 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir, | |||
3679 | * 1 for the dir item | 3695 | * 1 for the dir item |
3680 | * 1 for the dir index | 3696 | * 1 for the dir index |
3681 | * 1 for the inode ref | 3697 | * 1 for the inode ref |
3682 | * 1 for the inode ref in the tree log | ||
3683 | * 2 for the dir entries in the log | ||
3684 | * 1 for the inode | 3698 | * 1 for the inode |
3685 | */ | 3699 | */ |
3686 | trans = btrfs_start_transaction(root, 8); | 3700 | trans = btrfs_start_transaction(root, 5); |
3687 | if (!IS_ERR(trans) || PTR_ERR(trans) != -ENOSPC) | 3701 | if (!IS_ERR(trans) || PTR_ERR(trans) != -ENOSPC) |
3688 | return trans; | 3702 | return trans; |
3689 | 3703 | ||
@@ -8127,7 +8141,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
8127 | * inodes. So 5 * 2 is 10, plus 1 for the new link, so 11 total items | 8141 | * inodes. So 5 * 2 is 10, plus 1 for the new link, so 11 total items |
8128 | * should cover the worst case number of items we'll modify. | 8142 | * should cover the worst case number of items we'll modify. |
8129 | */ | 8143 | */ |
8130 | trans = btrfs_start_transaction(root, 20); | 8144 | trans = btrfs_start_transaction(root, 11); |
8131 | if (IS_ERR(trans)) { | 8145 | if (IS_ERR(trans)) { |
8132 | ret = PTR_ERR(trans); | 8146 | ret = PTR_ERR(trans); |
8133 | goto out_notrans; | 8147 | goto out_notrans; |