Message ID | 20230621152214.2720319-4-stsp2@yandex.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4453815vqr; Wed, 21 Jun 2023 08:36:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fiDHZTGRJFMB7hrxxi7FtSUoCLuzIxG+R3WtTnr7sSSEijUeAEEnPtvJh9yATokNY+yMZ X-Received: by 2002:a05:6a20:9144:b0:119:be71:1596 with SMTP id x4-20020a056a20914400b00119be711596mr21619662pzc.13.1687361779941; Wed, 21 Jun 2023 08:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687361779; cv=none; d=google.com; s=arc-20160816; b=haAZ4rbUndnrT66xqVNHgK5j2Yl7hiR4IcteLxU/zrDSL1tEt5acjSbPlVY9/YhQK2 ymJL/Mh0zhCknECzewfLofQtftPd6N+VijgbTBCE+xLwQq+OjVjRB4OLfXD4PULCNVPT 3gjQSUWezZ64YV4hDgszTHRf58Lqz+65fOMAMqcWE1DcpgbdeI+fpyJXIxt/w3xYKWgM bjvnORVsi3zS7FggoohxvBYwif41FEkGuuiYsjkqvb5AjhZz8QySuwbcBK14AI/av/6A IQbisEq1ryxIkoWYGcoKqMS3RAZM4+dZecCHzWSHYUTJcrWC1QrauDd9rQaRVsYKxtBP LvHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b93M/kd7RtP0LNT+znv3PSo9p5SOOzFeXYgHQxmwv9I=; b=uZow+jIi3pyMHLVex2WvyL/tYkSM9FF8dsrh68ndQoHeAcSpKqevheGqAEEakTMIzF PseSAXeh02a65CidsdbnmnxHuIYZJ9jUlRj/Gkn+TiyRn3sn8bceMNXFLZdst8iXe9XZ ID9f/iAYDyooy6J+Vx7Mbu2K8AOxBo+bnba9q4rswWIGQAOzQJDmdoDoridzJ8nnof+9 ZF4MDaLe7X66rPTpoTaPBgA0RHNDxyxXRkeS7Wp6YyyzTdE1C8vh6L7knTnXMHvfZDzJ I5g0gY+Zu8KGniZmqv+dTbxpxaOA0c9OqHozN7e6263ONAe85uSfoZqACeRSvqplALCi h2gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=MtTY+abf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a63b513000000b00543cbc5da0bsi3996301pge.211.2023.06.21.08.36.07; Wed, 21 Jun 2023 08:36:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=MtTY+abf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231653AbjFUP3F (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Wed, 21 Jun 2023 11:29:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232339AbjFUP3E (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 21 Jun 2023 11:29:04 -0400 X-Greylist: delayed 386 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 21 Jun 2023 08:29:02 PDT Received: from forward205a.mail.yandex.net (forward205a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d205]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB54B91; Wed, 21 Jun 2023 08:29:02 -0700 (PDT) Received: from forward102a.mail.yandex.net (forward102a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d102]) by forward205a.mail.yandex.net (Yandex) with ESMTP id 2BC504727F; Wed, 21 Jun 2023 18:22:58 +0300 (MSK) Received: from mail-nwsmtp-smtp-production-main-31.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-31.vla.yp-c.yandex.net [IPv6:2a02:6b8:c18:58f:0:640:3768:0]) by forward102a.mail.yandex.net (Yandex) with ESMTP id 32548463C0; Wed, 21 Jun 2023 18:22:54 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-31.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id UMkSjYADYGk0-nDgmRaci; Wed, 21 Jun 2023 18:22:53 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1687360973; bh=b93M/kd7RtP0LNT+znv3PSo9p5SOOzFeXYgHQxmwv9I=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=MtTY+abfofItqx+ehR5syVfHqnMfG1FQeD12jGzYQ82kiujSkRSuCeFBB6O8nWzkc hVWRs5aMnczR2pQ/T/8cWAlTFji3iAc8pMjYR/6uN48E+Fr1bQ7t+Eph2OTBExkpN7 rhVfefZq1Nc6+4kX45d6x2hZFyTVvCUY+/wm3XYc= Authentication-Results: mail-nwsmtp-smtp-production-main-31.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Stas Sergeev <stsp2@yandex.ru> To: linux-kernel@vger.kernel.org Cc: Stas Sergeev <stsp2@yandex.ru>, Jeff Layton <jlayton@kernel.org>, Chuck Lever <chuck.lever@oracle.com>, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, linux-fsdevel@vger.kernel.org, Shuah Khan <shuah@kernel.org>, linux-kselftest@vger.kernel.org, linux-api@vger.kernel.org Subject: [PATCH] fcntl.2: document F_UNLCK F_OFD_GETLK extension Date: Wed, 21 Jun 2023 20:22:14 +0500 Message-Id: <20230621152214.2720319-4-stsp2@yandex.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230621152214.2720319-1-stsp2@yandex.ru> References: <20230621152214.2720319-1-stsp2@yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769327065874299322?= X-GMAIL-MSGID: =?utf-8?q?1769327065874299322?= |
Series |
v2: F_OFD_GETLK extension to read lock info
|
|
Commit Message
stsp
June 21, 2023, 3:22 p.m. UTC
F_UNLCK has the special meaning when used as a lock type on input.
It returns the information about any lock found in the specified
region on that particular file descriptor. Locks on other file
descriptors are ignored by F_UNLCK.
Signed-off-by: Stas Sergeev <stsp2@yandex.ru>
CC: Jeff Layton <jlayton@kernel.org>
CC: Chuck Lever <chuck.lever@oracle.com>
CC: Alexander Viro <viro@zeniv.linux.org.uk>
CC: Christian Brauner <brauner@kernel.org>
CC: linux-fsdevel@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: Shuah Khan <shuah@kernel.org>
CC: linux-kselftest@vger.kernel.org
CC: linux-api@vger.kernel.org
---
man2/fcntl.2 | 7 +++++++
1 file changed, 7 insertions(+)
Comments
On Wed, 2023-06-21 at 20:22 +0500, Stas Sergeev wrote: > F_UNLCK has the special meaning when used as a lock type on input. > It returns the information about any lock found in the specified > region on that particular file descriptor. Locks on other file > descriptors are ignored by F_UNLCK. > > Signed-off-by: Stas Sergeev <stsp2@yandex.ru> > > CC: Jeff Layton <jlayton@kernel.org> > CC: Chuck Lever <chuck.lever@oracle.com> > CC: Alexander Viro <viro@zeniv.linux.org.uk> > CC: Christian Brauner <brauner@kernel.org> > CC: linux-fsdevel@vger.kernel.org > CC: linux-kernel@vger.kernel.org > CC: Shuah Khan <shuah@kernel.org> > CC: linux-kselftest@vger.kernel.org > CC: linux-api@vger.kernel.org > > --- > man2/fcntl.2 | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/man2/fcntl.2 b/man2/fcntl.2 > index 7b5604e3a..e3e3e7b8c 100644 > --- a/man2/fcntl.2 > +++ b/man2/fcntl.2 > @@ -604,6 +604,13 @@ then details about one of these locks are returned via > .IR lock , > as described above for > .BR F_GETLK . > +.B F_UNLCK > +has the special meaning when put into > +.I l_type > +as an input. It returns the information about any lock in the specified > +range on that particular file descriptor. The locks on other file > +descriptors are ignored by > +.BR F_UNLCK . > .PP > In the current implementation, > .\" commit 57b65325fe34ec4c917bc4e555144b4a94d9e1f7 We need to be pedantic for manpages. A "file description" is the representation of the open file in the kernel (basically, the "struct file" in the kernel). A file _descriptor_ is the numeric identifier returned by open() and similar functions. The locks are owned by the file description, so that would be the better term to use here. I think you want something like: "When the l_type is set to F_UNLCK, returned locks are limited to ones set on the given file description. Locks set on other file descriptions are ignored on F_GETLK requests with the l_type set to F_UNLCK."
22.06.2023 17:03, Jeff Layton пишет: > We need to be pedantic for manpages. A "file description" is the > representation of the open file in the kernel (basically, the "struct > file" in the kernel). A file _descriptor_ is the numeric identifier > returned by open() and similar functions. OK. > The locks are owned by the file description, so that would be the better > term to use here. I think you want something like: > > "When the l_type is set to F_UNLCK, returned locks are limited to ones > set on the given file description. This is also inaccurate, because "limited" implies other operations act widely. But actually other operations do not consider the "same fd" at all. So the reported sets by F_UNLCK and other ops do not overlap. Which is why I decided to describe it as a "special meaning".
diff --git a/man2/fcntl.2 b/man2/fcntl.2 index 7b5604e3a..e3e3e7b8c 100644 --- a/man2/fcntl.2 +++ b/man2/fcntl.2 @@ -604,6 +604,13 @@ then details about one of these locks are returned via .IR lock , as described above for .BR F_GETLK . +.B F_UNLCK +has the special meaning when put into +.I l_type +as an input. It returns the information about any lock in the specified +range on that particular file descriptor. The locks on other file +descriptors are ignored by +.BR F_UNLCK . .PP In the current implementation, .\" commit 57b65325fe34ec4c917bc4e555144b4a94d9e1f7