|
@@ -6021,32 +6021,6 @@ err:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc)
|
|
|
-{
|
|
|
- struct btrfs_root *root = BTRFS_I(inode)->root;
|
|
|
- struct btrfs_trans_handle *trans;
|
|
|
- int ret = 0;
|
|
|
- bool nolock = false;
|
|
|
-
|
|
|
- if (test_bit(BTRFS_INODE_DUMMY, &BTRFS_I(inode)->runtime_flags))
|
|
|
- return 0;
|
|
|
-
|
|
|
- if (btrfs_fs_closing(root->fs_info) &&
|
|
|
- btrfs_is_free_space_inode(BTRFS_I(inode)))
|
|
|
- nolock = true;
|
|
|
-
|
|
|
- if (wbc->sync_mode == WB_SYNC_ALL) {
|
|
|
- if (nolock)
|
|
|
- trans = btrfs_join_transaction_nolock(root);
|
|
|
- else
|
|
|
- trans = btrfs_join_transaction(root);
|
|
|
- if (IS_ERR(trans))
|
|
|
- return PTR_ERR(trans);
|
|
|
- ret = btrfs_commit_transaction(trans);
|
|
|
- }
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* This is somewhat expensive, updating the tree every time the
|
|
|
* inode changes. But, it is most likely to find the inode in cache.
|