Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp340237ybz; Tue, 21 Apr 2020 10:00:51 -0700 (PDT) X-Google-Smtp-Source: APiQypJnE/ieGQzq+GCBfN6UvhWPlN+B1bWM6jklIVhMHgpzwQQWH6u4A5R0DCY6ClTfWFMo7pZF X-Received: by 2002:a17:906:1393:: with SMTP id f19mr20439524ejc.26.1587488450666; Tue, 21 Apr 2020 10:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587488450; cv=none; d=google.com; s=arc-20160816; b=LXdP3Wbf2vmcn/zWC+RyA1SAS3fAaldGYiIqveIWFy5pA5URgEYRuNNNp5DbLnx+IX ayH7j+WO9pM4WeLPyeAXRKd+xepR5huBkRzkP7dUZnHzR12WNyJ9hTgTVvBAttRfZQsC YgOwmeUlNoAigVbp+8aO+M2hYpz9UzbdUzKgGnlFDIsEGBuwUAPzwSDvekk8Q+eMa0iw CWePGsdAbC6S373UevCujKdqxw0WuuJyIKnbiWHVjVFS/dpBJX6GkO5x/Li31Cx+/C6k Rq+YoCvbZoK7Wrzpo27/zj/fkVz5eGtcl9qWRgyYXQIKyVE4twxxF6xneVF3OXFiZvJz Uc6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GyZCjq/L77sKNMqlqCwRhPG0X5ES40BHjRGyV3Cv40I=; b=McTzdsOAtTBTkkZfJBktWVH3fKXBXdkAqMIOHykp0l6q5hkBe/+n5KEYcHfwje7zM/ wiejhTwiZJAaLQ0LoO+ttBy4ysrFVKU8dMScXbafr3aeYRzoZ/4Y6/HRqtndl0oIG1D/ qLSUnR0HGP8LkI/zGbcAguW2vqNtGgy1c1xjxqhLmH8z/vS7/vEOShmuizT5trh62YKa ySsCnlUbRz1vVNxwBGMOA9E/shklGpk01enbxd+ps0oUA4iIK/1S5LZYOxqBTYaYJ53J Kwkvj0iMVYafTbJ51RKGyT1Qh3S4XJelp+IviZWZMZh5U9cEuXfE0+6bCj/3pj8x+kcF dfpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2UJGmMGR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si1975797eds.559.2020.04.21.10.00.26; Tue, 21 Apr 2020 10:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2UJGmMGR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729578AbgDUQ4o (ORCPT + 99 others); Tue, 21 Apr 2020 12:56:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:57288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729057AbgDUQyq (ORCPT ); Tue, 21 Apr 2020 12:54:46 -0400 Received: from mail.kernel.org (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E55720774; Tue, 21 Apr 2020 16:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587488084; bh=xhaZXir06iAtnnI5oD2YIdQ7HPySr1ED65+aM8CiVTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2UJGmMGR3wssmVAPwL/ck+aI5KrCT+w1LqlDNoBXSZlxyW2HxOS6FqwUcdf/YjKt/ M4ix7oNEuiuaFCmCUU8Kr3KPFVv22V1rrLqkssgAZMz/lI5flCPv9R7h1PfYKN0xZw df2Ks8HhORGf31mEs34RTTVKTfylMlnX37f8UJFE= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jQwAU-00CmER-Gq; Tue, 21 Apr 2020 18:54:42 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v2 14/29] docs: filesystems: convert files.txt to ReST Date: Tue, 21 Apr 2020 18:54:25 +0200 Message-Id: X-Mailer: git-send-email 2.25.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab --- .../filesystems/{files.txt => files.rst} | 15 ++++++++++----- Documentation/filesystems/index.rst | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) rename Documentation/filesystems/{files.txt => files.rst} (95%) diff --git a/Documentation/filesystems/files.txt b/Documentation/filesystems/files.rst similarity index 95% rename from Documentation/filesystems/files.txt rename to Documentation/filesystems/files.rst index 46dfc6b038c3..cbf8e57376bf 100644 --- a/Documentation/filesystems/files.txt +++ b/Documentation/filesystems/files.rst @@ -1,5 +1,8 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================================== File management in the Linux kernel ------------------------------------ +=================================== This document describes how locking for files (struct file) and file descriptor table (struct files) works. @@ -34,7 +37,7 @@ appear atomic. Here are the locking rules for the fdtable structure - 1. All references to the fdtable must be done through - the files_fdtable() macro : + the files_fdtable() macro:: struct fdtable *fdt; @@ -61,7 +64,8 @@ the fdtable structure - 4. To look up the file structure given an fd, a reader must use either fcheck() or fcheck_files() APIs. These take care of barrier requirements due to lock-free lookup. - An example : + + An example:: struct file *file; @@ -77,7 +81,7 @@ the fdtable structure - of the fd (fget()/fget_light()) are lock-free, it is possible that look-up may race with the last put() operation on the file structure. This is avoided using atomic_long_inc_not_zero() - on ->f_count : + on ->f_count:: rcu_read_lock(); file = fcheck_files(files, fd); @@ -106,7 +110,8 @@ the fdtable structure - holding files->file_lock. If ->file_lock is dropped, then another thread expand the files thereby creating a new fdtable and making the earlier fdtable pointer stale. - For example : + + For example:: spin_lock(&files->file_lock); fd = locate_fd(files, file, start); diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index 30925e73666c..a996d880025e 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -27,6 +27,7 @@ algorithms work. devpts dnotify fiemap + files automount-support -- 2.25.2