Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360407
b: refs/heads/master
c: 5b947f1
h: refs/heads/master
i:
  360405: fae093a
  360403: bcfa91f
  360399: f883a05
v: v3
  • Loading branch information
Miao Xie authored and Josef Bacik committed Feb 20, 2013
1 parent 6b14e50 commit 9cf6991
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63607cc86ab808e077a895be2d7895dcbf6f4cf3
refs/heads/master: 5b947f1ba959d4b19068f687ecd39900d1eea1aa
19 changes: 5 additions & 14 deletions trunk/fs/btrfs/ordered-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,10 @@ int btrfs_run_ordered_operations(struct btrfs_root *root, int wait)

mutex_lock(&root->fs_info->ordered_operations_mutex);
spin_lock(&root->fs_info->ordered_extent_lock);
again:
list_splice_init(&root->fs_info->ordered_operations, &splice);

while (!list_empty(&splice)) {

btrfs_inode = list_entry(splice.next, struct btrfs_inode,
ordered_operations);

inode = &btrfs_inode->vfs_inode;

list_del_init(&btrfs_inode->ordered_operations);
Expand All @@ -642,22 +638,20 @@ int btrfs_run_ordered_operations(struct btrfs_root *root, int wait)
* the inode may be getting freed (in sys_unlink path).
*/
inode = igrab(inode);

if (!wait && inode) {
list_add_tail(&BTRFS_I(inode)->ordered_operations,
&root->fs_info->ordered_operations);
}

if (!inode)
continue;

if (!wait)
list_add_tail(&BTRFS_I(inode)->ordered_operations,
&root->fs_info->ordered_operations);
spin_unlock(&root->fs_info->ordered_extent_lock);

work = btrfs_alloc_delalloc_work(inode, wait, 1);
if (!work) {
spin_lock(&root->fs_info->ordered_extent_lock);
if (list_empty(&BTRFS_I(inode)->ordered_operations))
list_add_tail(&btrfs_inode->ordered_operations,
&splice);
spin_lock(&root->fs_info->ordered_extent_lock);
list_splice_tail(&splice,
&root->fs_info->ordered_operations);
spin_unlock(&root->fs_info->ordered_extent_lock);
Expand All @@ -671,9 +665,6 @@ int btrfs_run_ordered_operations(struct btrfs_root *root, int wait)
cond_resched();
spin_lock(&root->fs_info->ordered_extent_lock);
}
if (wait && !list_empty(&root->fs_info->ordered_operations))
goto again;

spin_unlock(&root->fs_info->ordered_extent_lock);
out:
list_for_each_entry_safe(work, next, &works, list) {
Expand Down

0 comments on commit 9cf6991

Please sign in to comment.