Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp863009rwb; Wed, 26 Jul 2023 04:16:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlGBUigyD7tX9EHqITgwx5N0E9t2p3XrZld0JrxvIzdsjvi8rzndkFaiKRAx150u5tqqwy3s X-Received: by 2002:a05:6358:339c:b0:134:c682:213f with SMTP id i28-20020a056358339c00b00134c682213fmr1655784rwd.31.1690370159693; Wed, 26 Jul 2023 04:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690370159; cv=none; d=google.com; s=arc-20160816; b=QcetFNGZCa1TdjoM/w2WPd8YTYaiN4aZxBoCbqDwH8HYSzruvK/w0jEJ5XeQBycY1O +4qpXyFLjwTsnV/3QGe4uL+9TW3T43/xhAtQRIyc6XQbpc0XMXEdlJDBsIuL/65XsTMt iq2zJipKqZB+z/JF9Vew2Dw8Rt+hy095oI7hjg9xj0Y0JrX7jK1APXLKW7rxUvqwTldK 4ObjF48jgiIqFOf9doieoQjlNJlsX2M7w0jKQ6q+eMGHIRtQdmw9ehj367dvw3COXWy6 c2Nb2795dCOkYJzDDr4wOegoKfoXo32eKilY7vPHnLBg4abWnaNtFV03Ksvhoz6q6M7H 2ZqQ== 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=Lwy1bya8EhY/7tZ1lMXE+4zXJK9aZUCgnxudXlZKm68=; fh=s3EkFveja4PFWbIac+xkRWU8Dk/FoQIVbxjqrCu6kgU=; b=uWB2H6UGJ+k1cyLfIIdmZaso9lXo0VgRxhlCW8b3TVPh7/dJbo+zPBiQmXHzAAQ6iF sysUVwtrnYou6FhGyGOlpw+RM3ZZ6DGprWwe85aAt1FCuBSgsjcZTeJwg0TvcdybtqUi qaV8wQ56rHRV0tzeLjjT/W/DceT88tZXaUeH7i0rr6n20ACEQZ/Dm0mhI/rGFRh4pdRy Ki6fpNhL2OZMy1lj+uGr+TuRzQ/Xpei6HlHnr1JQQL4Ce2cw1mwCnxTb1JApR/FB2zCF nwDjJb5ZH/H1lQkLdeuiKhcDKGD7kKO8CBXl5MrXmLm/TOdVKykRd0fS4eESuP/2TWAW edWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ux551U6n; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o29-20020a63921d000000b005533c53f542si12934421pgd.763.2023.07.26.04.15.25; Wed, 26 Jul 2023 04:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@linux.dev header.s=key1 header.b=ux551U6n; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbjGZK2D (ORCPT + 99 others); Wed, 26 Jul 2023 06:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233864AbjGZK1Y (ORCPT ); Wed, 26 Jul 2023 06:27:24 -0400 X-Greylist: delayed 69 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 26 Jul 2023 03:27:23 PDT Received: from out-47.mta1.migadu.com (out-47.mta1.migadu.com [95.215.58.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 476A51FEC for ; Wed, 26 Jul 2023 03:27:22 -0700 (PDT) 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=1690367194; 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=Lwy1bya8EhY/7tZ1lMXE+4zXJK9aZUCgnxudXlZKm68=; b=ux551U6nhVvd09Fj1FVNymeGKcLT6zQsEBqhk225f+PUyMSHGeN5cY/do/fviplQGSDyEa wDLTA/5zkhT7BGUXE02iGDI3c9FhGSpI38RqZnn4nJtV4JEUJxp+DqWLdBDnHBPMLV6JSm NwF24t3Iddnn29aDeFdB1045RF83B/k= 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, Wanpeng Li Subject: [PATCH 4/7] add llseek_nowait() for struct file_operations Date: Wed, 26 Jul 2023 18:26:00 +0800 Message-Id: <20230726102603.155522-5-hao.xu@linux.dev> In-Reply-To: <20230726102603.155522-1-hao.xu@linux.dev> References: <20230726102603.155522-1-hao.xu@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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: X-Mailing-List: linux-ext4@vger.kernel.org From: Hao Xu Add a new function member llseek_nowait() in struct file_operations for nowait llseek. It act just like llseek() but has an extra boolean parameter called nowait to indicate if it's a nowait try, avoid IO and locks if so. Signed-off-by: Hao Xu --- include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index f3e315e8efdd..d37290da2d7e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1823,6 +1823,7 @@ struct file_operations { int (*uring_cmd)(struct io_uring_cmd *ioucmd, unsigned int issue_flags); int (*uring_cmd_iopoll)(struct io_uring_cmd *, struct io_comp_batch *, unsigned int poll_flags); + loff_t (*llseek_nowait)(struct file *, loff_t, int, bool); } __randomize_layout; struct inode_operations { -- 2.25.1