From patchwork Mon Jul 16 14:58:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10527041 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 3B54660545 for ; Mon, 16 Jul 2018 14:55:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3955728DD7 for ; Mon, 16 Jul 2018 14:55:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D55428DD8; Mon, 16 Jul 2018 14:55:03 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 C2DFF28DD2 for ; Mon, 16 Jul 2018 14:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730094AbeGPPWs (ORCPT ); Mon, 16 Jul 2018 11:22:48 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:55964 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730008AbeGPPWs (ORCPT ); Mon, 16 Jul 2018 11:22:48 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6GEriNv058628 for ; Mon, 16 Jul 2018 14:55:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=FcYk1oQD9GXoyVgONNnlqiDPR6s8qRlOosjP4UIpnL8=; b=IALFkI0D4GVwuVlu7Rnx9u4GnBmgdAGKyml6Mu3XFwfaRsIl5DAD38iYrZc2xkZCKSfs Tvm7YgC0Upr4PldOaRXzF7ZAI12UzwFuOS1Ua2oBRG4xQ9Gbto8hh7tefSmYEYEkOH0r wB2vX6Biw3icPT3QZTcc4OP/ui0wXLYG0kZSp6z1yVxw352aUIPwK9y/qj+XFe5J2RY9 jOuIb5uHYj+JiPJvUTe8mNkeV6nz4lrOISgIzDTqNZOErnQ4UZZ6ZERcY0vG7+xL5qAZ Nw2Px+Kmfw8VlVtIW5gTjvKCA4V3yZYwt1fkWpP8aC8s5lA6eIqtS2rIihCalQQU/SS3 oQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2k7a3svtc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 16 Jul 2018 14:55:00 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6GEsx6l007603 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 16 Jul 2018 14:54:59 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6GEswMf025602 for ; Mon, 16 Jul 2018 14:54:58 GMT Received: from localhost.localdomain (/202.156.138.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Jul 2018 07:54:58 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 4/7] btrfs: use the assigned fs_devices instead of the dereference Date: Mon, 16 Jul 2018 22:58:09 +0800 Message-Id: <20180716145812.20836-5-anand.jain@oracle.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180716145812.20836-1-anand.jain@oracle.com> References: <20180716145812.20836-1-anand.jain@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8955 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=936 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807160173 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 We have assigned the %fs_info->fs_devices in %fs_devices as its not modified just use it for the mutex_lock(). Signed-off-by: Anand Jain --- I don't see this in the ML at all, I remember sending this. Anyway I am marking this as V1. fs/btrfs/volumes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c6f3f0dfbabe..7f4973fc2b52 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2199,7 +2199,7 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info) INIT_LIST_HEAD(&seed_devices->alloc_list); mutex_init(&seed_devices->device_list_mutex); - mutex_lock(&fs_info->fs_devices->device_list_mutex); + mutex_lock(&fs_devices->device_list_mutex); list_splice_init_rcu(&fs_devices->devices, &seed_devices->devices, synchronize_rcu); list_for_each_entry(device, &seed_devices->devices, dev_list) @@ -2219,7 +2219,7 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info) generate_random_uuid(fs_devices->fsid); memcpy(fs_info->fsid, fs_devices->fsid, BTRFS_FSID_SIZE); memcpy(disk_super->fsid, fs_devices->fsid, BTRFS_FSID_SIZE); - mutex_unlock(&fs_info->fs_devices->device_list_mutex); + mutex_unlock(&fs_devices->device_list_mutex); super_flags = btrfs_super_flags(disk_super) & ~BTRFS_SUPER_FLAG_SEEDING;