From patchwork Wed Apr 18 09:56:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10347725 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 60FC36053F for ; Wed, 18 Apr 2018 09:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5269A285D8 for ; Wed, 18 Apr 2018 09:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 458AB285DB; Wed, 18 Apr 2018 09:54:31 +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 D83FB285DA for ; Wed, 18 Apr 2018 09:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbeDRJy1 (ORCPT ); Wed, 18 Apr 2018 05:54:27 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48034 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751407AbeDRJy0 (ORCPT ); Wed, 18 Apr 2018 05:54:26 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3I9pujq137239 for ; Wed, 18 Apr 2018 09:54:26 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-2017-10-26; bh=Dt1Lw7JQyT8v4uDvTw6o5oZEaw1b9O35gzjeydUFrnc=; b=t0fYUkSPa382oo5sbCbwmhE6ExhQG+OZ7JbDYdTlHNBVUdywQJg83e2HEELA02Zyd3OR 1aIIetjO6EVKiAfmNxrkAlfvTmmHWy1c+Ivd1qmBZOtU1pRWt9rMvaWpQGA1tRwTcLEU I4ikuM1FZtuuyBT799P0plWSDyqTIBGajTwExJGmEWuypOynqJqlAbzqA2XDi/hzwJhA VzqutQBSm51SITKcD9n5B7ZHJxvWRGDXqlEgxdNphhnyZtSTLqomSBlpDUhBqWZRW/uQ uSZ1xi6ikER6N5w1qnnYUcJZ0jZ8ZsNflvOY8pZ5aUqOKn8WGiWtKnplhFXttdNXeaX+ NA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2hdrxp1ur2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Apr 2018 09:54:26 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3I9sOe7020115 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Apr 2018 09:54:25 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3I9sOP2020872 for ; Wed, 18 Apr 2018 09:54:24 GMT Received: from tp.sg.oracle.com (/10.186.49.52) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 18 Apr 2018 02:54:24 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs: update uuid_mutex and device_list_mutex comments Date: Wed, 18 Apr 2018 17:56:31 +0800 Message-Id: <20180418095631.9977-1-anand.jain@oracle.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180412022938.8257-1-anand.jain@oracle.com> References: <20180412022938.8257-1-anand.jain@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8866 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804180092 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 Make the uuid_mutex and device_list_mutex comments inline with the changes. Signed-off-by: Anand Jain --- Hi David, Can you kindly add this patch to the set: 'Review uuid_mutex usage' Thanks, Anand fs/btrfs/volumes.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 6d7f10729713..12617a8a7083 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -155,29 +155,26 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, * * uuid_mutex (global lock) * ------------------------ - * protects the fs_uuids list that tracks all per-fs fs_devices, resulting from + * Protects the fs_uuids list that tracks all per-fs fs_devices, resulting from * the SCAN_DEV ioctl registration or from mount either implicitly (the first - * device) or requested by the device= mount option - * - * the mutex can be very coarse and can cover long-running operations - * - * protects: updates to fs_devices counters like missing devices, rw devices, - * seeding, structure cloning, openning/closing devices at mount/umount time + * device) or requested by the device= mount option. * * global::fs_devs - add, remove, updates to the global list * - * does not protect: manipulation of the fs_devices::devices list! + * Does not protect: manipulation of the fs_devices::devices list! * * btrfs_device::name - renames (write side), read is RCU * * fs_devices::device_list_mutex (per-fs, with RCU) * ------------------------------------------------ - * protects updates to fs_devices::devices, ie. adding and deleting + * Protects updates to fs_devices::devices, ie. adding and deleting, and its + * counters like missing devices, rw devices, seeding, structure cloning, + * openning/closing devices at mount/umount time. * - * simple list traversal with read-only actions can be done with RCU protection + * Simple list traversal with read-only actions can be done with RCU protection. * - * may be used to exclude some operations from running concurrently without any - * modifications to the list (see write_all_supers) + * May be used to exclude some operations from running concurrently without any + * modifications to the list (see write_all_supers). * * balance_mutex * -------------