diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2011-06-10 13:12:02 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2011-06-10 13:12:02 -0400 |
commit | 93ea927eb15b736fa4a431f789b1097318129d2a (patch) | |
tree | b141a0e06c9d1616dc7f0c616a96655afd32f8b0 /fs/btrfs/file.c | |
parent | dbcb4a1a3f16702918caa4d4ab7062965050a780 (diff) | |
parent | 59c5f46fbe01a00eedf54a23789634438bb80603 (diff) | |
download | op-kernel-dev-93ea927eb15b736fa4a431f789b1097318129d2a.zip op-kernel-dev-93ea927eb15b736fa4a431f789b1097318129d2a.tar.gz |
Merge tag 'v3.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index c6a22d7..fa4ef18 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -129,7 +129,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, if (!btrfs_test_opt(root, AUTO_DEFRAG)) return 0; - if (root->fs_info->closing) + if (btrfs_fs_closing(root->fs_info)) return 0; if (BTRFS_I(inode)->in_defrag) @@ -144,7 +144,7 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, if (!defrag) return -ENOMEM; - defrag->ino = inode->i_ino; + defrag->ino = btrfs_ino(inode); defrag->transid = transid; defrag->root = root->root_key.objectid; @@ -229,7 +229,7 @@ int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info) first_ino = defrag->ino + 1; rb_erase(&defrag->rb_node, &fs_info->defrag_inodes); - if (fs_info->closing) + if (btrfs_fs_closing(fs_info)) goto next_free; spin_unlock(&fs_info->defrag_inodes_lock); @@ -1480,14 +1480,12 @@ int btrfs_sync_file(struct file *file, int datasync) * the current transaction, we can bail out now without any * syncing */ - mutex_lock(&root->fs_info->trans_mutex); + smp_mb(); if (BTRFS_I(inode)->last_trans <= root->fs_info->last_trans_committed) { BTRFS_I(inode)->last_trans = 0; - mutex_unlock(&root->fs_info->trans_mutex); goto out; } - mutex_unlock(&root->fs_info->trans_mutex); /* * ok we haven't committed the transaction yet, lets do a commit |