From patchwork Tue Jan 17 22:31: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: 9522015 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 7C0FB6020B for ; Tue, 17 Jan 2017 22:38:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C60B28426 for ; Tue, 17 Jan 2017 22:38:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 613F328602; Tue, 17 Jan 2017 22:38:18 +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 A0A7C285A2 for ; Tue, 17 Jan 2017 22:38:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751023AbdAQWiL (ORCPT ); Tue, 17 Jan 2017 17:38:11 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33752 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbdAQWiK (ORCPT ); Tue, 17 Jan 2017 17:38:10 -0500 Received: by mail-wm0-f66.google.com with SMTP id r144so41958302wme.0 for ; Tue, 17 Jan 2017 14:38:10 -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=vzDcxkW1vYcJFurzA5JufuKl/slu9eA2P9iCpHArhJM=; b=JREZJWdOwVT27ME1HI0gUKcbcjZIRJzmLdvYPp0sUArra+le+vOnmU95cKBQ1E4+F9 LjNXP/ReeJWLOKC6vdwkq2eqBRxGoREc+x3v1YDyKp4VcVIpUmFQUYCA31VO4vjA/aWy Fmvu064g2dJgvpcxYI1nCv/9M7s22hj8i/kiSLUTEzZm2/hvLNvKainygsxI38okivhj CZ4CWgvflnlnypEks/1W4Sok2CmxPqVBVW0zzlher1GTojezwTop2YKohiLeUEU8zRBt aVBILOIRp+ciTu3evLqrk9nfxA31yKl82J9FKdf2acZta7oMipQOr38D/ATuPYnNYqZR OwdQ== 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=vzDcxkW1vYcJFurzA5JufuKl/slu9eA2P9iCpHArhJM=; b=mOOyPP8rMZcwPygtNWtRimyem2qcZnpEczbcT8pDTrwZj8gHaQYMCJoC2gm5/aUbzQ dDzhQVE009kO+wpFa2hgDL6c5kt+vqY4UG4P9TLELQqd7KprutIvyag64/8HlXaiX+zU v2AjKqC/8wgHFvUg6vRiZRXWR0D9ARxM7EFyPLO3twVts9M7wGzLpqqAYdntgWE4iYEX eu+TqBW0dcn5ocO74WkkmLNXYTt14TrcMsXE8qmJrqA9TKKvWLb9oqLPzV0Jd6j1Bxk+ X3EDQ4wFmXtaTZdhSxtlYKBq6Jw3BPlfSoDg6y41LgauNhMKAL2Wcw7N1lgbqAcx9pEQ HdzQ== X-Gm-Message-State: AIkVDXKM1GQ1zE+Mtf4C91o/nGrtct4aevbtW5JacWy7iwVECyi5qVyYMNLFv8KXCw9/Bw== X-Received: by 10.28.43.135 with SMTP id r129mr304363wmr.121.1484692325113; Tue, 17 Jan 2017 14:32:05 -0800 (PST) Received: from fisk.lan (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id w197sm39980489wmd.11.2017.01.17.14.32.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 14:32:04 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.cz Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCHv2 03/24] btrfs: Make btrfs_record_snapshot_destroy take btrfs_inode Date: Wed, 18 Jan 2017 00:31:29 +0200 Message-Id: <1484692310-3987-4-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484692310-3987-1-git-send-email-n.borisov.lkml@gmail.com> References: <20170117161550.GW12081@twin.jikos.cz> <1484692310-3987-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 6f9a3beb7050..581d31171683 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -5794,11 +5794,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);