Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21D0BC433E1 for ; Tue, 18 Aug 2020 07:03:43 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BDDD20658 for ; Tue, 18 Aug 2020 07:03:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="hJSSLYLv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BDDD20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1k7vdv-0001lx-8I; Tue, 18 Aug 2020 03:02:47 -0400 Received: from mout.gmx.net ([212.227.17.22]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1k7vdp-0001lo-4L for kernelnewbies@kernelnewbies.org; Tue, 18 Aug 2020 03:02:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1597734158; bh=33nwU/D1MsgFPE/RLIXyjwgXa6ePX0qDOw+QX8mcIfo=; h=X-UI-Sender-Class:Date:From:To:Subject; b=hJSSLYLvKYI4JedR6R44Q7cZZpkuyq6KU4E9qBaUA6Jc/OXqbrbAAvkKzprrdAh0s mAXaT7TKhGeAQqG9OBxGnvlPPQf5PYsETQGDdLr1fIi5p503OvX9Ho0YLh9ITeRXhZ vicp2wfgPMRLpnFoMOzVUXsm0tOpkI4E5hIxYmAI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from scdbackup.webframe.org ([84.179.245.142]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mi2O1-1kcZV11Ior-00e6Mi for ; Tue, 18 Aug 2020 09:02:38 +0200 Date: Tue, 18 Aug 2020 09:02:35 +0200 From: "Thomas Schmitt" To: kernelnewbies@kernelnewbies.org Subject: Does "i_mutex" in comments mean inode_lock() in code ? Message-Id: <24370731797047302436@scdbackup.webframe.org> X-Provags-ID: V03:K1:ejv0T+akVNRxYF15VNecaSXn6mISiD6q0AnfMXV//F6U8IHviHn z4o/6wS7N0m8LerUM2dlF+N8Qtb2AApQdj2EGc700lHKmCaMFbCMN6Sx/NgM0nKvHNZbFnD Wv24klBlw5TPNYyLD6l1LIi/8mSAZDwoyAmJ6ZJYhlyVJWra/rQL1ZwYGTez6ppueSPgaO7 UrUsRzOgvFT70eXnEbWdw== X-UI-Out-Filterresults: notjunk:1;V03:K0:oLSv5ZC1mVA=:gRtMzTTCIFNb9a2ikGhiRb KbSFk4FW1PwefUV60fPH14vDIsHA2JEZRCIaGIAHUgysUwUYm2aJIps2haTJC/D5H0nq/+wnf ROh1u8skip/JvaoLqv70o+wlcYoUZHu8wq3c8dzHqVTVeWLq8OcXLAEtb42zL2ygwvJvmWT27 fWbX+p7glkFyc/mfokw48ra+hgE7PwaLRd0jYVlpB2JbxICku9tSDH0LStXBv949FQ06Fc0VR liTyhF9eHsRiUpRPF++5tUjozO/QkksXDS3FKobcJK/MT+hxI1BJNFY5yqUYgZZnkXYHl41Y8 MrB5OG51l3k3Xi7XpLg1g8c14n4NA/+ribKMnYqGeOIROkrl40mx2EVS3Ww3R0sGuz+ge+Xaj Xkx0tkGtCTKpS2PgWhqCGOocWYjx6xqMUyzKJ6Q7YZdprZ3zsyY4RW9/uJjKix9sn2OFwwZ+x LlKxcJHDyg5vHWc1zV5/sklXWO41HOCH7a8x3WL/o0huJNfFaPy6EG6HHg+i9essjKBS/I3Ss F64etLzj2WHte6UWfaDLY2HY46jL8xmuUev64FcylWfschdarT058dA9F5DluA0vkdQb/S6HM p7wSbtZWQl6FY1qCdfifp+/L2w/s0dFvYlgp9Cwl4bybmBn4Gnem+Cw655yxjVxkKwqIS2rPi bo0LzLpN+RMk5eyKthEJyGX+WXdO2kGCsJx0PaDTZrFdvR4XXGcOB+IWzfmMJztCZuBSnYRRt OIu+G57nV4xT478VGc4dv4OxugYFn61L1v06pBWtLxcR9EfvADjQFYHJ0fu6CBgtUdnOXhnu/ LBjwiBI4GgFl4ZNZTD0tihBvYDLy0H74cror9gftfyA+b5jIzcUF8WvOQuDUyakP++zLDTELE Nrj/mxW7+dgKavlcoqLDaUfGVigoeNsMxdonxF/nZxrRhzIOjAw+WCfEi+stvS3vx+1BQ0yAi Vpk6FDTExn96+kIc7YQSYVegz2rY94OfwhDa6Eewe26B+4bQq4X0nzY0ZGLdk/DGjLp4+F9T7 8NEFQs8DZ48+fBd6egCTjBrWDX1wMUHSB0r2TzUeHeFl6jfO1vpL0uDDQxTke3tv6lh5zkHM2 87y1zMLWjRoOPG1axok+hGzZez/n9jqKjZJxDI07f7rr+qqf+HGAe3yDt9EzEXUBdlIyioMd0 GwP5BZhjXbIjx3ZsLq90Aj2go61ME1DP2bEYjiE2zHUMVZA5ZliQHEP+xgRgJFTNOfhIKCkX2 R3WkKVNCZYYRp7At5 X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hi, is function inode_lock() the thing which controls what lots of comments call "i_mutex" ? I am in particular riddling over this comment in include/linux/fs.h : /* * NOTE: unlike i_size_read(), i_size_write() does need locking around it * (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount * can be lost, resulting in subsequent i_size_read() calls spinning forever. */ because i cannot find any example in the git tree by grep -r mutex_unlock'.*[^a-z]'i_mutex . and the same for mutex_lock or mutex_trylock. But i see lots of comments mentioning an "i_mutex" structure element by grep -r '.*->'i_mutex . The nearest discovery to what i search for is in include/linux/fs.h static inline void inode_lock(struct inode *inode) It has lots of call instances in the code. But in contrast to "->imutex" i found not a glimpse of documentation. (Well it has enough room to hide from me ...) So is this the call by which i can reserve a cdrom device file inode before i call i_size_write() ? If so, shouldn't the comment in fs.h be "... (normally inode_lock) ..." ? Have a nice day :) Thomas _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies