From patchwork Fri Aug 25 13:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hao Xu X-Patchwork-Id: 13365739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEAF7C3DA6F for ; Fri, 25 Aug 2023 13:57:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D9DB2800B7; Fri, 25 Aug 2023 09:57:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 83BD38E0015; Fri, 25 Aug 2023 09:57:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DC4F2800B7; Fri, 25 Aug 2023 09:57:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 590448E0015 for ; Fri, 25 Aug 2023 09:57:21 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 14D8C406C6 for ; Fri, 25 Aug 2023 13:57:21 +0000 (UTC) X-FDA: 81162779082.18.F05FA85 Received: from out-244.mta1.migadu.com (out-244.mta1.migadu.com [95.215.58.244]) by imf06.hostedemail.com (Postfix) with ESMTP id 3A5E818002D for ; Fri, 25 Aug 2023 13:57:18 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ZBBdmQmn; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf06.hostedemail.com: domain of hao.xu@linux.dev designates 95.215.58.244 as permitted sender) smtp.mailfrom=hao.xu@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692971839; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/w6lIGuCSX5M2SzS7SE+A2P7DaEhoFOZKnfxuRd6M0g=; b=yzKB11NyPGKThPQ3KiKP4ntLHoFUisrg1CIXoy9zTdUlakd0VzjxxBUGTY1MsboWX1t1KC mZ7GgO2UcqQDGm2Sr0vBt5b4SpnadJYwAHRKTxYwE9IcGT0lJK2cKp5/UrtcMyJPzDbCBa GAI0M1rA9HrKM5z72Ya1NAmbBziu/jQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=ZBBdmQmn; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf06.hostedemail.com: domain of hao.xu@linux.dev designates 95.215.58.244 as permitted sender) smtp.mailfrom=hao.xu@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692971839; a=rsa-sha256; cv=none; b=3OnqNoqgBJRbluMBTOlceaIsQUOeFsL+FXG16Z9EwM07Ne7tc9NjWFESY4nrTsrIbXNR/0 2ow7m//7FZsFCW5PUJ1IEq8FN1EqJ2hAZ9eVOwgnbUEbbm2SVgxbfI0I8UuBx5TAJCH04i dNyzKxucwC/OyY7RP31WsDPXhzwajT0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1692971837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/w6lIGuCSX5M2SzS7SE+A2P7DaEhoFOZKnfxuRd6M0g=; b=ZBBdmQmn/QswMnMhJaSAfXlf1oUY8DtSqPmmn75d8pDMERuOJJX6J86JCF/c0yd1RLwCFL 31gixh9w5LkzzEj2vO8LvkCfQ90DBKrPt5Zp4Wgls4dziWWNaF03qzW9wejmnudGoy1bT6 SZd55YvanxvHQ0hgcOptPehal51m0m0= From: Hao Xu To: io-uring@vger.kernel.org, Jens Axboe Cc: Dominique Martinet , Pavel Begunkov , Christian Brauner , Alexander Viro , Stefan Roesch , Clay Harris , Dave Chinner , "Darrick J . Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-cachefs@redhat.com, ecryptfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-unionfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, linux-nilfs@vger.kernel.org, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, Wanpeng Li Subject: [PATCH 06/29] vfs: add file_pos_unlock() for io_uring usage Date: Fri, 25 Aug 2023 21:54:08 +0800 Message-Id: <20230825135431.1317785-7-hao.xu@linux.dev> In-Reply-To: <20230825135431.1317785-1-hao.xu@linux.dev> References: <20230825135431.1317785-1-hao.xu@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3A5E818002D X-Stat-Signature: ribhxjwwfmu43mhxq95ny57nkxcwy4kx X-HE-Tag: 1692971838-337195 X-HE-Meta: U2FsdGVkX19XQ5ZG4V4+4sjo297sajUMqjjdfV99d3aNaLKJmLkgZxF8hKmpI81phJkbo0d1RaOGsDMo0BjewolUIttSaCi4gXdwPKFmsbqZtK7gaaCzsCcb+tVakOhcdLLEJZPIidDQBeDagRPotcjO6NVct1FFtHLiU6D7CEC+MKWhhgbO4TcfGGVFnr92UjHkstds7PKq5jF0kApFMESVEZup75FltIvEzQfTepiJPayey2OS0OBeB/afDvbBNL0mSiGysTnRYYdYrLgUf1dgYTV3XKIkGRQ/yeLFK8AK5FgWvV8WH/BPy5VzgrWZNHkfnOFT4BSBgyf41cNT39vF+snK6fEjQp/PS9Xu3qwtpwguOOWK/jew9A9Xvp5zuHzqj4bYCv5AjtYg/bZhUQzPuPh4QbPPyTYvoLNZu8LuJAVGePlruo1WNw93H7RLLbqHWBocu1f9O5m0VIxTvHomFDUtDStK5uRjV4HRn9pgT7hBfMG42QgVGpjFp5v+MhRePZTBl+ahvWjyAcgp4BSGMPvb0LNTWpY2Z3gbq4i+wrmbowqhtY2JAKnUwJuYRs69zp/z3undLAyLzgmURKlN42p/zEtyMcxyyhNJzO63w4zX3iGfhcYFCKU9kuL2sAMXF0II3xFnloL3WLZNyqUBgjvrQLiEhrFkdulIQbZktQQVAiaUyUepJXCTlBmSRn+XDgKVXQlXGgZ6BXtMob2qKGxSTL80NaeeQYddr1iqGAmxGb/xO0r1qA26kPv/plJodpMtK2F8VTz516odUNeJq7HnjATqLM4b9M02Zedmyl9V/NTJpsheKK0V4iKT8hK7LmEADByr8xza2NzN1S6n+q0XO0JtXd9kUz0QH/iQ1fp25plTFd/p/alDDppcjUY49Wx153pLizc1cQIKNH2d3zEhAuZrX2tEqPNs76Hy3tX2eju3h2gG6e30CfErW2xTuePPiZFqQwu5TsK JwxAUbby 0qxy7FyJuzi3pELTcogFEoUlhpCvIEPBLImTow8F1nrEsszjvkmHHV/xG5zzg7HQ3B2VVgh04qwLgNy30hPT7eBk0L+QhSUi/tvlQgn7yD5hBKtBBlM1Qso+j5ey2xvsf5Raoxf3KxKgQ6DQ2An8QHklyrxdrOai6jkWNcbY46RDHkhgOi7I4KszK7oG9Dx1rlYN++cJ1yhI1GWeHnpWgmC1JpnPjXG0bthZRj5w52QHobRPtjliGuGsDaw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Hao Xu Add a helper to unlock f_pos_lock without any condition. Introduce this since io_uring handles f_pos_lock not with a fd struct, thus FDPUT_POS_UNLOCK isn't used. Signed-off-by: Hao Xu --- include/linux/file.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/file.h b/include/linux/file.h index bcc6ba0aec50..a179f4794341 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -81,6 +81,11 @@ static inline void fdput_pos(struct fd f) fdput(f); } +static inline void file_pos_unlock(struct file *file) +{ + __f_unlock_pos(file); +} + extern int file_pos_lock_nowait(struct file *file, bool nowait); DEFINE_CLASS(fd, struct fd, fdput(_T), fdget(fd), int fd)