diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-24 11:52:22 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-24 11:52:22 -0400 |
commit | b51338628f604d9b4ed3c776839a484a30e12fb7 (patch) | |
tree | 8e1a6402a5bf857eba371d10e6b6a69f6abb8f0b /fs/btrfs/super.c | |
parent | 5e82849e63723afe720d4b325d04a989f6247cce (diff) |
Btrfs: add dirty_inode call
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 6940a907654d..43f081593c45 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -722,17 +722,27 @@ static int btrfs_write_inode(struct inode *inode, int wait) | |||
722 | { | 722 | { |
723 | struct btrfs_root *root = BTRFS_I(inode)->root; | 723 | struct btrfs_root *root = BTRFS_I(inode)->root; |
724 | struct btrfs_trans_handle *trans; | 724 | struct btrfs_trans_handle *trans; |
725 | int ret; | 725 | int ret = 0; |
726 | |||
727 | if (wait) { | ||
728 | mutex_lock(&root->fs_info->fs_mutex); | ||
729 | trans = btrfs_start_transaction(root, 1); | ||
730 | ret = btrfs_commit_transaction(trans, root); | ||
731 | mutex_unlock(&root->fs_info->fs_mutex); | ||
732 | } | ||
733 | return ret; | ||
734 | } | ||
735 | |||
736 | static void btrfs_dirty_inode(struct inode *inode) | ||
737 | { | ||
738 | struct btrfs_root *root = BTRFS_I(inode)->root; | ||
739 | struct btrfs_trans_handle *trans; | ||
726 | 740 | ||
727 | mutex_lock(&root->fs_info->fs_mutex); | 741 | mutex_lock(&root->fs_info->fs_mutex); |
728 | trans = btrfs_start_transaction(root, 1); | 742 | trans = btrfs_start_transaction(root, 1); |
729 | ret = btrfs_update_inode(trans, root, inode); | 743 | btrfs_update_inode(trans, root, inode); |
730 | if (wait) | 744 | btrfs_end_transaction(trans, root); |
731 | btrfs_commit_transaction(trans, root); | ||
732 | else | ||
733 | btrfs_end_transaction(trans, root); | ||
734 | mutex_unlock(&root->fs_info->fs_mutex); | 745 | mutex_unlock(&root->fs_info->fs_mutex); |
735 | return ret; | ||
736 | } | 746 | } |
737 | 747 | ||
738 | static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | 748 | static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, |
@@ -2390,6 +2400,7 @@ static int btrfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
2390 | buf->f_type = BTRFS_SUPER_MAGIC; | 2400 | buf->f_type = BTRFS_SUPER_MAGIC; |
2391 | return 0; | 2401 | return 0; |
2392 | } | 2402 | } |
2403 | |||
2393 | static struct file_system_type btrfs_fs_type = { | 2404 | static struct file_system_type btrfs_fs_type = { |
2394 | .owner = THIS_MODULE, | 2405 | .owner = THIS_MODULE, |
2395 | .name = "btrfs", | 2406 | .name = "btrfs", |
@@ -2405,6 +2416,7 @@ static struct super_operations btrfs_super_ops = { | |||
2405 | .write_super = btrfs_write_super, | 2416 | .write_super = btrfs_write_super, |
2406 | .sync_fs = btrfs_sync_fs, | 2417 | .sync_fs = btrfs_sync_fs, |
2407 | .write_inode = btrfs_write_inode, | 2418 | .write_inode = btrfs_write_inode, |
2419 | .dirty_inode = btrfs_dirty_inode, | ||
2408 | .alloc_inode = btrfs_alloc_inode, | 2420 | .alloc_inode = btrfs_alloc_inode, |
2409 | .destroy_inode = btrfs_destroy_inode, | 2421 | .destroy_inode = btrfs_destroy_inode, |
2410 | .statfs = btrfs_statfs, | 2422 | .statfs = btrfs_statfs, |