diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-31 07:59:42 -0400 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-31 08:16:47 -0400 |
commit | e6db06a53b1dcf4e9da4aba143e2eb4d63418abb (patch) | |
tree | 10adcecb71c95ce4393c39fa7911d091bcadfe09 /fs/btrfs/extent_io.c | |
parent | ecc2edd56c49fa31a0a9ed15a7bf810ae79d3b85 (diff) | |
parent | c56f5c0342dfee11a1a13d2f5bb7618de5b17590 (diff) |
Merge with upstream to accommodate with thermal changes
This merge is performed to take commit c56f5c0342dfee11a1 ("Thermal: Make
Thermal trip points writeable") out of Linus' tree and then fixup power
supply class. This is needed since thermal stuff added a new argument:
CC drivers/power/power_supply_core.o
drivers/power/power_supply_core.c: In function ‘psy_register_thermal’:
drivers/power/power_supply_core.c:204:6: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:154:29: note: expected ‘int’ but argument is of type ‘struct power_supply *’
drivers/power/power_supply_core.c:204:6: error: too few arguments to function ‘thermal_zone_device_register’
include/linux/thermal.h:154:29: note: declared here
make[1]: *** [drivers/power/power_supply_core.o] Error 1
make: *** [drivers/power/] Error 2
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index aaa12c1eb348..01c21b6c6d43 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -3324,6 +3324,7 @@ static int extent_write_cache_pages(struct extent_io_tree *tree, | |||
3324 | writepage_t writepage, void *data, | 3324 | writepage_t writepage, void *data, |
3325 | void (*flush_fn)(void *)) | 3325 | void (*flush_fn)(void *)) |
3326 | { | 3326 | { |
3327 | struct inode *inode = mapping->host; | ||
3327 | int ret = 0; | 3328 | int ret = 0; |
3328 | int done = 0; | 3329 | int done = 0; |
3329 | int nr_to_write_done = 0; | 3330 | int nr_to_write_done = 0; |
@@ -3334,6 +3335,18 @@ static int extent_write_cache_pages(struct extent_io_tree *tree, | |||
3334 | int scanned = 0; | 3335 | int scanned = 0; |
3335 | int tag; | 3336 | int tag; |
3336 | 3337 | ||
3338 | /* | ||
3339 | * We have to hold onto the inode so that ordered extents can do their | ||
3340 | * work when the IO finishes. The alternative to this is failing to add | ||
3341 | * an ordered extent if the igrab() fails there and that is a huge pain | ||
3342 | * to deal with, so instead just hold onto the inode throughout the | ||
3343 | * writepages operation. If it fails here we are freeing up the inode | ||
3344 | * anyway and we'd rather not waste our time writing out stuff that is | ||
3345 | * going to be truncated anyway. | ||
3346 | */ | ||
3347 | if (!igrab(inode)) | ||
3348 | return 0; | ||
3349 | |||
3337 | pagevec_init(&pvec, 0); | 3350 | pagevec_init(&pvec, 0); |
3338 | if (wbc->range_cyclic) { | 3351 | if (wbc->range_cyclic) { |
3339 | index = mapping->writeback_index; /* Start from prev offset */ | 3352 | index = mapping->writeback_index; /* Start from prev offset */ |
@@ -3428,6 +3441,7 @@ retry: | |||
3428 | index = 0; | 3441 | index = 0; |
3429 | goto retry; | 3442 | goto retry; |
3430 | } | 3443 | } |
3444 | btrfs_add_delayed_iput(inode); | ||
3431 | return ret; | 3445 | return ret; |
3432 | } | 3446 | } |
3433 | 3447 | ||