Rework btrfs_drop_inode to avoid scheduling

Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index e53d203..008e344 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -993,20 +993,13 @@
 
 void btrfs_drop_inode(struct inode *inode)
 {
-	struct btrfs_trans_handle *trans;
-	struct btrfs_root *root = BTRFS_I(inode)->root;
-
-	if (!BTRFS_I(inode)->ordered_trans) {
+	if (!BTRFS_I(inode)->ordered_trans || inode->i_nlink) {
 		generic_drop_inode(inode);
 		return;
 	}
-	/* nasty, but it prevents a deadlock with data=ordered by preventing
-	 * a commit until after this inode is done
-	 */
-	trans = btrfs_start_transaction(root, 1);
+	/* FIXME, make sure this delete actually ends up in the transaction */
+	btrfs_del_ordered_inode(inode);
 	generic_drop_inode(inode);
-	/* note, the inode is now untouchable */
-	btrfs_end_transaction(trans, root);
 }
 
 void btrfs_delete_inode(struct inode *inode)