aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2012-03-01 08:56:26 -0500
committerDavid Sterba <dsterba@suse.cz>2012-03-21 20:45:34 -0400
commit143bede527b054a271053f41bfaca2b57baa9408 (patch)
tree95c71d3705c73bf98e7a1547da35e70a44703c1e /fs/btrfs/ordered-data.c
parentffd7b33944f4573a063af7a55f8a5199c8185665 (diff)
btrfs: return void in functions without error conditions
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c48
1 files changed, 17 insertions, 31 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 2857f28e20e2..bbf6d0d9aebe 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -257,9 +257,9 @@ int btrfs_add_ordered_extent_compress(struct inode *inode, u64 file_offset,
257 * when an ordered extent is finished. If the list covers more than one 257 * when an ordered extent is finished. If the list covers more than one
258 * ordered extent, it is split across multiples. 258 * ordered extent, it is split across multiples.
259 */ 259 */
260int btrfs_add_ordered_sum(struct inode *inode, 260void btrfs_add_ordered_sum(struct inode *inode,
261 struct btrfs_ordered_extent *entry, 261 struct btrfs_ordered_extent *entry,
262 struct btrfs_ordered_sum *sum) 262 struct btrfs_ordered_sum *sum)
263{ 263{
264 struct btrfs_ordered_inode_tree *tree; 264 struct btrfs_ordered_inode_tree *tree;
265 265
@@ -267,7 +267,6 @@ int btrfs_add_ordered_sum(struct inode *inode,
267 spin_lock(&tree->lock); 267 spin_lock(&tree->lock);
268 list_add_tail(&sum->list, &entry->list); 268 list_add_tail(&sum->list, &entry->list);
269 spin_unlock(&tree->lock); 269 spin_unlock(&tree->lock);
270 return 0;
271} 270}
272 271
273/* 272/*
@@ -392,7 +391,7 @@ out:
392 * used to drop a reference on an ordered extent. This will free 391 * used to drop a reference on an ordered extent. This will free
393 * the extent if the last reference is dropped 392 * the extent if the last reference is dropped
394 */ 393 */
395int btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry) 394void btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry)
396{ 395{
397 struct list_head *cur; 396 struct list_head *cur;
398 struct btrfs_ordered_sum *sum; 397 struct btrfs_ordered_sum *sum;
@@ -408,7 +407,6 @@ int btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry)
408 } 407 }
409 kfree(entry); 408 kfree(entry);
410 } 409 }
411 return 0;
412} 410}
413 411
414/* 412/*
@@ -416,8 +414,8 @@ int btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry)
416 * and you must wake_up entry->wait. You must hold the tree lock 414 * and you must wake_up entry->wait. You must hold the tree lock
417 * while you call this function. 415 * while you call this function.
418 */ 416 */
419static int __btrfs_remove_ordered_extent(struct inode *inode, 417static void __btrfs_remove_ordered_extent(struct inode *inode,
420 struct btrfs_ordered_extent *entry) 418 struct btrfs_ordered_extent *entry)
421{ 419{
422 struct btrfs_ordered_inode_tree *tree; 420 struct btrfs_ordered_inode_tree *tree;
423 struct btrfs_root *root = BTRFS_I(inode)->root; 421 struct btrfs_root *root = BTRFS_I(inode)->root;
@@ -444,35 +442,30 @@ static int __btrfs_remove_ordered_extent(struct inode *inode,
444 list_del_init(&BTRFS_I(inode)->ordered_operations); 442 list_del_init(&BTRFS_I(inode)->ordered_operations);
445 } 443 }
446 spin_unlock(&root->fs_info->ordered_extent_lock); 444 spin_unlock(&root->fs_info->ordered_extent_lock);
447
448 return 0;
449} 445}
450 446
451/* 447/*
452 * remove an ordered extent from the tree. No references are dropped 448 * remove an ordered extent from the tree. No references are dropped
453 * but any waiters are woken. 449 * but any waiters are woken.
454 */ 450 */
455int btrfs_remove_ordered_extent(struct inode *inode, 451void btrfs_remove_ordered_extent(struct inode *inode,
456 struct btrfs_ordered_extent *entry) 452 struct btrfs_ordered_extent *entry)
457{ 453{
458 struct btrfs_ordered_inode_tree *tree; 454 struct btrfs_ordered_inode_tree *tree;
459 int ret;
460 455
461 tree = &BTRFS_I(inode)->ordered_tree; 456 tree = &BTRFS_I(inode)->ordered_tree;
462 spin_lock(&tree->lock); 457 spin_lock(&tree->lock);
463 ret = __btrfs_remove_ordered_extent(inode, entry); 458 __btrfs_remove_ordered_extent(inode, entry);
464 spin_unlock(&tree->lock); 459 spin_unlock(&tree->lock);
465 wake_up(&entry->wait); 460 wake_up(&entry->wait);
466
467 return ret;
468} 461}
469 462
470/* 463/*
471 * wait for all the ordered extents in a root. This is done when balancing 464 * wait for all the ordered extents in a root. This is done when balancing
472 * space between drives. 465 * space between drives.
473 */ 466 */
474int btrfs_wait_ordered_extents(struct btrfs_root *root, 467void btrfs_wait_ordered_extents(struct btrfs_root *root,
475 int nocow_only, int delay_iput) 468 int nocow_only, int delay_iput)
476{ 469{
477 struct list_head splice; 470 struct list_head splice;
478 struct list_head *cur; 471 struct list_head *cur;
@@ -520,7 +513,6 @@ int btrfs_wait_ordered_extents(struct btrfs_root *root,
520 spin_lock(&root->fs_info->ordered_extent_lock); 513 spin_lock(&root->fs_info->ordered_extent_lock);
521 } 514 }
522 spin_unlock(&root->fs_info->ordered_extent_lock); 515 spin_unlock(&root->fs_info->ordered_extent_lock);
523 return 0;
524} 516}
525 517
526/* 518/*
@@ -533,7 +525,7 @@ int btrfs_wait_ordered_extents(struct btrfs_root *root,
533 * extra check to make sure the ordered operation list really is empty 525 * extra check to make sure the ordered operation list really is empty
534 * before we return 526 * before we return
535 */ 527 */
536int btrfs_run_ordered_operations(struct btrfs_root *root, int wait) 528void btrfs_run_ordered_operations(struct btrfs_root *root, int wait)
537{ 529{
538 struct btrfs_inode *btrfs_inode; 530 struct btrfs_inode *btrfs_inode;
539 struct inode *inode; 531 struct inode *inode;
@@ -581,8 +573,6 @@ again:
581 573
582 spin_unlock(&root->fs_info->ordered_extent_lock); 574 spin_unlock(&root->fs_info->ordered_extent_lock);
583 mutex_unlock(&root->fs_info->ordered_operations_mutex); 575 mutex_unlock(&root->fs_info->ordered_operations_mutex);
584
585 return 0;
586} 576}
587 577
588/* 578/*
@@ -617,7 +607,7 @@ void btrfs_start_ordered_extent(struct inode *inode,
617/* 607/*
618 * Used to wait on ordered extents across a large range of bytes. 608 * Used to wait on ordered extents across a large range of bytes.
619 */ 609 */
620int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len) 610void btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
621{ 611{
622 u64 end; 612 u64 end;
623 u64 orig_end; 613 u64 orig_end;
@@ -672,7 +662,6 @@ again:
672 schedule_timeout(1); 662 schedule_timeout(1);
673 goto again; 663 goto again;
674 } 664 }
675 return 0;
676} 665}
677 666
678/* 667/*
@@ -956,9 +945,8 @@ out:
956 * If trans is not null, we'll do a friendly check for a transaction that 945 * If trans is not null, we'll do a friendly check for a transaction that
957 * is already flushing things and force the IO down ourselves. 946 * is already flushing things and force the IO down ourselves.
958 */ 947 */
959int btrfs_add_ordered_operation(struct btrfs_trans_handle *trans, 948void btrfs_add_ordered_operation(struct btrfs_trans_handle *trans,
960 struct btrfs_root *root, 949 struct btrfs_root *root, struct inode *inode)
961 struct inode *inode)
962{ 950{
963 u64 last_mod; 951 u64 last_mod;
964 952
@@ -969,7 +957,7 @@ int btrfs_add_ordered_operation(struct btrfs_trans_handle *trans,
969 * commit, we can safely return without doing anything 957 * commit, we can safely return without doing anything
970 */ 958 */
971 if (last_mod < root->fs_info->last_trans_committed) 959 if (last_mod < root->fs_info->last_trans_committed)
972 return 0; 960 return;
973 961
974 /* 962 /*
975 * the transaction is already committing. Just start the IO and 963 * the transaction is already committing. Just start the IO and
@@ -977,7 +965,7 @@ int btrfs_add_ordered_operation(struct btrfs_trans_handle *trans,
977 */ 965 */
978 if (trans && root->fs_info->running_transaction->blocked) { 966 if (trans && root->fs_info->running_transaction->blocked) {
979 btrfs_wait_ordered_range(inode, 0, (u64)-1); 967 btrfs_wait_ordered_range(inode, 0, (u64)-1);
980 return 0; 968 return;
981 } 969 }
982 970
983 spin_lock(&root->fs_info->ordered_extent_lock); 971 spin_lock(&root->fs_info->ordered_extent_lock);
@@ -986,6 +974,4 @@ int btrfs_add_ordered_operation(struct btrfs_trans_handle *trans,
986 &root->fs_info->ordered_operations); 974 &root->fs_info->ordered_operations);
987 } 975 }
988 spin_unlock(&root->fs_info->ordered_extent_lock); 976 spin_unlock(&root->fs_info->ordered_extent_lock);
989
990 return 0;
991} 977}