/* It will return zero if all goes well, and it will return 1 if a full transaction commit is required.  */
int btrfs_log_new_name(struct btrfs_trans_handle *trans, struct inode *inode, struct inode *old_dir, struct dentry *parent)
/* It will return zero if all goes well, and it will return 1 if a full transaction commit is required.  */
int btrfs_log_new_name(struct btrfs_trans_handle *trans, struct inode *inode, struct inode *old_dir, struct dentry *parent)
{
	struct btrfs_root * root = BTRFS_I(inode)->root;
	if (S_ISREG(inode->i_mode))
		BTRFS_I(inode)->last_unlink_trans = trans->transid;
	if (BTRFS_I(inode)->logged_trans <=
	    root->fs_info->last_trans_committed &&
	    (!old_dir || BTRFS_I(old_dir)->logged_trans <=
		    root->fs_info->last_trans_committed))
		return 0;
	return btrfs_log_inode_parent(trans, root, inode, parent, 1);
}