Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp706532ybz; Wed, 15 Apr 2020 17:09:11 -0700 (PDT) X-Google-Smtp-Source: APiQypLQXdvR9Az3dc22hQps9NNENgfctfVnXOFaeD/CbOGt3ZuXdVnasd3nvAVoHDV9Pxkx4Pm+ X-Received: by 2002:aa7:df8c:: with SMTP id b12mr28236872edy.22.1586995751492; Wed, 15 Apr 2020 17:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995751; cv=none; d=google.com; s=arc-20160816; b=PgAzp2d/7TpprvswcJKjLpDdcvkBnvkO/urT1IIaIqeERYmvO5MLT31FUV8tPVo8sg GYKhPYR0U6cacGroLb9o10Vz5shVvwkVcm4uk8nUIaKr2+fG+AZv638mBqEiCDcIs7x0 zXryNxWHClHYPTFwvbd+bPEHs1qcOLuu0Ejh55UqUPdCXH1sYvOywqFnDJjrCqHAg6Eg A3j2D5vXdgprv6+KK5bS+1miP92bc+Oz5Lpg1JOp3NSpdrs/0b48EZ8yUxToJqSsxxbM GXNuGd5txGZ47fkGjUxoSqukIYPGAJixgkWEQ6j6vMI5WUHc8S+4HxqgAwjdSLV5gBKJ vGKg== 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=fPInRpfPaPeX0/VmLXM4FbTlecz5cp23VKPSZ+mfcGY=; b=wRsw/aqDYmALmzZPpxdYlnqYZBSJujZu5mazaxZgSaNk7Y0mecttvZGVOElIfbrwSR Wj4Ipo8nOeU4wXCYwR6dUSwaK07K0lv3iQdfqYUuhpQ0o3Qt4hUpxkMLofai9Cj/s0nw KMTmcLn+0T3TDnqGil50p2D4NXvlqSIt84hNZXPCYmpYdbLKT791CxwzwfDg32NVMK0b IVoXOu2tVPY4WPqIVfqkT5Bzb+ItzhQLc6mzHHeodbv4WfNPUz+6kBomst8xnxy2JD87 CT+8VlOofSeblTQ67n7Y/QoLXtX0Qdm8xV2ZNK9GtWTnf7m92FjEjdE7UtiX3g23spws nDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=05a2Xxlq; 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 oy6si11041370ejb.383.2020.04.15.17.08.48; Wed, 15 Apr 2020 17:09:11 -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=05a2Xxlq; 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 S2394157AbgDOOei (ORCPT + 99 others); Wed, 15 Apr 2020 10:34:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:45458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394101AbgDOOdT (ORCPT ); Wed, 15 Apr 2020 10:33:19 -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 C75642076D; Wed, 15 Apr 2020 14:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586961178; bh=wgc5ZRDNb/Os5mnZGCAK3Ryr5aIheM5QZV5lEE7sBMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=05a2XxlqWagShzDpfT4FBP6Lw/+9REzu9U9BcGscNUMU97S9feNRDD84/ce9C85rm 75P3qGl8mkXNxTTDpgwSjjIMSygW7BUmp6SIdBrQkRHeGKe/QIz78ZnFcF2IgN8/ex bAhzcrU3jkNltDwnSjVJyqNtYYRk9wMHHUrhZNXM= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jOj5t-006kOy-Hw; Wed, 15 Apr 2020 16:32:49 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH 16/34] docs: filesystems: convert files.txt to ReST Date: Wed, 15 Apr 2020 16:32:29 +0200 Message-Id: <26a803d5200555d5104df155d9e59221c9528be8.1586960617.git.mchehab+huawei@kernel.org> 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 5514fd122619..c947df7b2a47 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -28,6 +28,7 @@ algorithms work. devpts dnotify fiemap + files automount-support -- 2.25.2