Skip to content

Commit

Permalink
Merge branch 'error-handling' into for-linus
Browse files Browse the repository at this point in the history
Conflicts:
	fs/btrfs/ctree.c
	fs/btrfs/disk-io.c
	fs/btrfs/extent-tree.c
	fs/btrfs/extent_io.c
	fs/btrfs/extent_io.h
	fs/btrfs/inode.c
	fs/btrfs/scrub.c

Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
chrismason-xx committed Mar 29, 2012
2 parents b5d67f6 + 65139ed commit 1d4284b
Show file tree
Hide file tree
Showing 38 changed files with 2,017 additions and 1,018 deletions.
15 changes: 5 additions & 10 deletions fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ static void check_pending_worker_creates(struct btrfs_worker_thread *worker)
spin_unlock_irqrestore(&workers->lock, flags);
}

static noinline int run_ordered_completions(struct btrfs_workers *workers,
static noinline void run_ordered_completions(struct btrfs_workers *workers,
struct btrfs_work *work)
{
if (!workers->ordered)
return 0;
return;

set_bit(WORK_DONE_BIT, &work->flags);

Expand Down Expand Up @@ -213,7 +213,6 @@ static noinline int run_ordered_completions(struct btrfs_workers *workers,
}

spin_unlock(&workers->order_lock);
return 0;
}

static void put_worker(struct btrfs_worker_thread *worker)
Expand Down Expand Up @@ -399,7 +398,7 @@ static int worker_loop(void *arg)
/*
* this will wait for all the worker threads to shutdown
*/
int btrfs_stop_workers(struct btrfs_workers *workers)
void btrfs_stop_workers(struct btrfs_workers *workers)
{
struct list_head *cur;
struct btrfs_worker_thread *worker;
Expand Down Expand Up @@ -427,7 +426,6 @@ int btrfs_stop_workers(struct btrfs_workers *workers)
put_worker(worker);
}
spin_unlock_irq(&workers->lock);
return 0;
}

/*
Expand Down Expand Up @@ -615,14 +613,14 @@ static struct btrfs_worker_thread *find_worker(struct btrfs_workers *workers)
* it was taken from. It is intended for use with long running work functions
* that make some progress and want to give the cpu up for others.
*/
int btrfs_requeue_work(struct btrfs_work *work)
void btrfs_requeue_work(struct btrfs_work *work)
{
struct btrfs_worker_thread *worker = work->worker;
unsigned long flags;
int wake = 0;

if (test_and_set_bit(WORK_QUEUED_BIT, &work->flags))
goto out;
return;

spin_lock_irqsave(&worker->lock, flags);
if (test_bit(WORK_HIGH_PRIO_BIT, &work->flags))
Expand All @@ -649,9 +647,6 @@ int btrfs_requeue_work(struct btrfs_work *work)
if (wake)
wake_up_process(worker->task);
spin_unlock_irqrestore(&worker->lock, flags);
out:

return 0;
}

void btrfs_set_work_high_prio(struct btrfs_work *work)
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/async-thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ struct btrfs_workers {

void btrfs_queue_worker(struct btrfs_workers *workers, struct btrfs_work *work);
int btrfs_start_workers(struct btrfs_workers *workers);
int btrfs_stop_workers(struct btrfs_workers *workers);
void btrfs_stop_workers(struct btrfs_workers *workers);
void btrfs_init_workers(struct btrfs_workers *workers, char *name, int max,
struct btrfs_workers *async_starter);
int btrfs_requeue_work(struct btrfs_work *work);
void btrfs_requeue_work(struct btrfs_work *work);
void btrfs_set_work_high_prio(struct btrfs_work *work);
#endif
38 changes: 18 additions & 20 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ static void end_compressed_bio_read(struct bio *bio, int err)
* Clear the writeback bits on all of the file
* pages for a compressed write
*/
static noinline int end_compressed_writeback(struct inode *inode, u64 start,
unsigned long ram_size)
static noinline void end_compressed_writeback(struct inode *inode, u64 start,
unsigned long ram_size)
{
unsigned long index = start >> PAGE_CACHE_SHIFT;
unsigned long end_index = (start + ram_size - 1) >> PAGE_CACHE_SHIFT;
Expand All @@ -253,7 +253,6 @@ static noinline int end_compressed_writeback(struct inode *inode, u64 start,
index += ret;
}
/* the inode may be gone now */
return 0;
}

/*
Expand Down Expand Up @@ -392,16 +391,16 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
*/
atomic_inc(&cb->pending_bios);
ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

if (!skip_sum) {
ret = btrfs_csum_one_bio(root, inode, bio,
start, 1);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */
}

ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

bio_put(bio);

Expand All @@ -421,15 +420,15 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
bio_get(bio);

ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

if (!skip_sum) {
ret = btrfs_csum_one_bio(root, inode, bio, start, 1);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */
}

ret = btrfs_map_bio(root, WRITE, bio, 0, 1);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

bio_put(bio);
return 0;
Expand Down Expand Up @@ -497,7 +496,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
* sure they map to this compressed extent on disk.
*/
set_page_extent_mapped(page);
lock_extent(tree, last_offset, end, GFP_NOFS);
lock_extent(tree, last_offset, end);
read_lock(&em_tree->lock);
em = lookup_extent_mapping(em_tree, last_offset,
PAGE_CACHE_SIZE);
Expand All @@ -507,7 +506,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
(last_offset + PAGE_CACHE_SIZE > extent_map_end(em)) ||
(em->block_start >> 9) != cb->orig_bio->bi_sector) {
free_extent_map(em);
unlock_extent(tree, last_offset, end, GFP_NOFS);
unlock_extent(tree, last_offset, end);
unlock_page(page);
page_cache_release(page);
break;
Expand Down Expand Up @@ -535,7 +534,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
nr_pages++;
page_cache_release(page);
} else {
unlock_extent(tree, last_offset, end, GFP_NOFS);
unlock_extent(tree, last_offset, end);
unlock_page(page);
page_cache_release(page);
break;
Expand Down Expand Up @@ -662,7 +661,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
bio_get(comp_bio);

ret = btrfs_bio_wq_end_io(root->fs_info, comp_bio, 0);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

/*
* inc the count before we submit the bio so
Expand All @@ -675,14 +674,14 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) {
ret = btrfs_lookup_bio_sums(root, inode,
comp_bio, sums);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */
}
sums += (comp_bio->bi_size + root->sectorsize - 1) /
root->sectorsize;

ret = btrfs_map_bio(root, READ, comp_bio,
mirror_num, 0);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

bio_put(comp_bio);

Expand All @@ -698,15 +697,15 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
bio_get(comp_bio);

ret = btrfs_bio_wq_end_io(root->fs_info, comp_bio, 0);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

if (!(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM)) {
ret = btrfs_lookup_bio_sums(root, inode, comp_bio, sums);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */
}

ret = btrfs_map_bio(root, READ, comp_bio, mirror_num, 0);
BUG_ON(ret);
BUG_ON(ret); /* -ENOMEM */

bio_put(comp_bio);
return 0;
Expand Down Expand Up @@ -734,7 +733,7 @@ struct btrfs_compress_op *btrfs_compress_op[] = {
&btrfs_lzo_compress,
};

int __init btrfs_init_compress(void)
void __init btrfs_init_compress(void)
{
int i;

Expand All @@ -744,7 +743,6 @@ int __init btrfs_init_compress(void)
atomic_set(&comp_alloc_workspace[i], 0);
init_waitqueue_head(&comp_workspace_wait[i]);
}
return 0;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef __BTRFS_COMPRESSION_
#define __BTRFS_COMPRESSION_

int btrfs_init_compress(void);
void btrfs_init_compress(void);
void btrfs_exit_compress(void);

int btrfs_compress_pages(int type, struct address_space *mapping,
Expand Down
Loading

0 comments on commit 1d4284b

Please sign in to comment.