From patchwork Thu Jan 12 14:00:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9513249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5EE460710 for ; Thu, 12 Jan 2017 14:01:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C601C2868C for ; Thu, 12 Jan 2017 14:01:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8F3B286D9; Thu, 12 Jan 2017 14:01:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F55D286B9 for ; Thu, 12 Jan 2017 14:01:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750860AbdALOBA (ORCPT ); Thu, 12 Jan 2017 09:01:00 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36118 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750825AbdALOA7 (ORCPT ); Thu, 12 Jan 2017 09:00:59 -0500 Received: by mail-wm0-f65.google.com with SMTP id r126so3893877wmr.3 for ; Thu, 12 Jan 2017 06:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mSCxV3UAExq4UazeS5si9zA/fOkB+Ld4qXXbRjfwHNM=; b=kQux5lC8hmtBJMwWdzxhdteuB3uNl6rOUIOQ2sFv+bceeWKvDVyI/F8dx04XbifHho ktZJq8CFTP+MqnibXnfxrTeCyeiHpXP7TQZ/fgCT3XNH5YYIw8FvbMLvr+tuvdYQF/pi vDZKclethhgFpJKnFCXxXHLvc0lVGv0/mxlaZROOw56TV7ACOGUMBLkmvni4UcCY6/4r oKYFyzYhfaarsnu5fLgp0A6J8liQlS70gg9CgmScCtzEIEs8SBZk1zz7x8dlcTv53626 6M7UVYjxy73lpORUnnCtrAuFLQ3pgXLiARb7yTOqfBB5740mlrSWfT4byLSiQtuWP8xt aUnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mSCxV3UAExq4UazeS5si9zA/fOkB+Ld4qXXbRjfwHNM=; b=qamYyMCCaB/XMQxUFupSR72iM3CvuLgm/ZIVxRz54OKCEeW/A9imPJMw2+6xw0KZY3 ot5aODj8SEaA+n3OPKr4TH8r/27ZzfworiOrfQU1w+JVqpffyUj3YB+okuh3v2ovcZN3 7VXG6tzKaCDYBmUdx38nwBnJ+BNJVI27r/PDUpktwHPEhdnIIwGvlqctqvn+RoSHJCsx GO8v+vO/tpJk5Sen/tz5Gfx50m3qEtz40+C+fcxsMW6mi2rTE43USeyCiBpIqJzUXhXf K3tMKd4NtghcyiYHVpq58O+Ic+jbFAnFGz1qIy1+Y3/7uvZMVfpvW8urzv/aCoVuuv6W Gcog== X-Gm-Message-State: AIkVDXIS/RWg6uori8O5zpN9+1n/t2tuYD4rvMzh+dI4O9yiJyFabKVz8kzpKqlR8OYq7Q== X-Received: by 10.223.132.197 with SMTP id 63mr7439829wrg.20.1484229658328; Thu, 12 Jan 2017 06:00:58 -0800 (PST) Received: from fisk.lan (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id y145sm725670wmc.17.2017.01.12.06.00.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 06:00:57 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 03/24] btrfs: Make btrfs_record_snapshot_destroy take btrfs_inode Date: Thu, 12 Jan 2017 16:00:29 +0200 Message-Id: <1484229650-24554-4-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484229650-24554-1-git-send-email-n.borisov.lkml@gmail.com> References: <1484229650-24554-1-git-send-email-n.borisov.lkml@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nikolay Borisov --- fs/btrfs/ioctl.c | 2 +- fs/btrfs/tree-log.c | 8 ++++---- fs/btrfs/tree-log.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e8e1f5f5f93a..7d1b5378de49 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2497,7 +2497,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, trans->block_rsv = &block_rsv; trans->bytes_reserved = block_rsv.size; - btrfs_record_snapshot_destroy(trans, dir); + btrfs_record_snapshot_destroy(trans, BTRFS_I(dir)); ret = btrfs_unlink_subvol(trans, root, dir, dest->root_key.objectid, diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 0b1e2629ea48..db787d957b74 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5787,11 +5787,11 @@ void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans, * parent root and tree of tree roots trees, etc) are done. */ void btrfs_record_snapshot_destroy(struct btrfs_trans_handle *trans, - struct inode *dir) + struct btrfs_inode *dir) { - mutex_lock(&BTRFS_I(dir)->log_mutex); - BTRFS_I(dir)->last_unlink_trans = trans->transid; - mutex_unlock(&BTRFS_I(dir)->log_mutex); + mutex_lock(&dir->log_mutex); + dir->last_unlink_trans = trans->transid; + mutex_unlock(&dir->log_mutex); } /* diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h index 69702eef9603..e08ce78b2ad4 100644 --- a/fs/btrfs/tree-log.h +++ b/fs/btrfs/tree-log.h @@ -83,7 +83,7 @@ void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans, struct btrfs_inode *dir, struct btrfs_inode *inode, int for_rename); void btrfs_record_snapshot_destroy(struct btrfs_trans_handle *trans, - struct inode *dir); + struct btrfs_inode *dir); int btrfs_log_new_name(struct btrfs_trans_handle *trans, struct inode *inode, struct inode *old_dir, struct dentry *parent);