Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360432
b: refs/heads/master
c: 779880e
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik committed Feb 20, 2013
1 parent 649fa5c commit 59f4f70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 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: eb12db690c7eb0f6593ba5792f5861409e88bc03
refs/heads/master: 779880ef35b60ac82eed1dcaec6db5b34a170df8
33 changes: 7 additions & 26 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3565,35 +3565,16 @@ static void btrfs_destroy_ordered_operations(struct btrfs_root *root)

static void btrfs_destroy_ordered_extents(struct btrfs_root *root)
{
struct list_head splice;
struct btrfs_ordered_extent *ordered;
struct inode *inode;

INIT_LIST_HEAD(&splice);

spin_lock(&root->fs_info->ordered_extent_lock);

list_splice_init(&root->fs_info->ordered_extents, &splice);
while (!list_empty(&splice)) {
ordered = list_entry(splice.next, struct btrfs_ordered_extent,
root_extent_list);

list_del_init(&ordered->root_extent_list);
atomic_inc(&ordered->refs);

/* the inode may be getting freed (in sys_unlink path). */
inode = igrab(ordered->inode);

spin_unlock(&root->fs_info->ordered_extent_lock);
if (inode)
iput(inode);

atomic_set(&ordered->refs, 1);
btrfs_put_ordered_extent(ordered);

spin_lock(&root->fs_info->ordered_extent_lock);
}

/*
* This will just short circuit the ordered completion stuff which will
* make sure the ordered extent gets properly cleaned up.
*/
list_for_each_entry(ordered, &root->fs_info->ordered_extents,
root_extent_list)
set_bit(BTRFS_ORDERED_IOERR, &ordered->flags);
spin_unlock(&root->fs_info->ordered_extent_lock);
}

Expand Down

0 comments on commit 59f4f70

Please sign in to comment.