From mboxrd@z Thu Jan 1 00:00:00 1970 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84609C83F36 for ; Tue, 29 Aug 2023 08:41:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693298478; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jA1KgT3GPdB1OxLMHMZXLYFWkf7YoqsirOkiMpZgxco=; b=Ao1C5TLHSdzD4SPASuGO5CFR2bSF1+wbY3YE+1WM8nxwEimZ1rkCjadgOEnrzS250ceQbj 169EOh/cJFCdOj4b/ckYV5FJWEn0Fb6LU5gc7rBMmEAeVGzUsOIiFTVj8gIOfAKBqwk4uT k5l2v84qv4G73zdofj2kv/xkEt8UxOs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-436-B76lcfZ0NH2zMxaYOOmK3w-1; Tue, 29 Aug 2023 04:41:14 -0400 X-MC-Unique: B76lcfZ0NH2zMxaYOOmK3w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AB67196EF81; Tue, 29 Aug 2023 08:41:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86020140E91E; Tue, 29 Aug 2023 08:41:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6B4AC19465BC; Tue, 29 Aug 2023 08:41:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 19D5119465A8 for ; Fri, 25 Aug 2023 14:02:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EDD036B2B6; Fri, 25 Aug 2023 14:02:17 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5C0C6B59D for ; Fri, 25 Aug 2023 14:02:17 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A03F93806620 for ; Fri, 25 Aug 2023 14:02:17 +0000 (UTC) Received: from out-249.mta1.migadu.com (out-249.mta1.migadu.com [95.215.58.249]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-2qQHnz-HNiWuBxgVRpQDDQ-1; Fri, 25 Aug 2023 10:02:15 -0400 X-MC-Unique: 2qQHnz-HNiWuBxgVRpQDDQ-1 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Xu To: io-uring@vger.kernel.org, Jens Axboe Date: Fri, 25 Aug 2023 21:54:18 +0800 Message-Id: <20230825135431.1317785-17-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-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mailman-Approved-At: Tue, 29 Aug 2023 08:41:07 +0000 Subject: [Cluster-devel] [PATCH 16/29] xfs: add nowait parameter for xfs_inode_item_init() X-BeenThere: cluster-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: "\[Cluster devel\]" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wanpeng Li , "Darrick J . Wong" , Dominique Martinet , Dave Chinner , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Stefan Roesch , Clay Harris , linux-s390@vger.kernel.org, linux-nilfs@vger.kernel.org, codalist@coda.cs.cmu.edu, cluster-devel@redhat.com, linux-cachefs@redhat.com, linux-ext4@vger.kernel.org, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, ecryptfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-block@vger.kernel.org, Alexander Viro , Christian Brauner , netdev@vger.kernel.org, samba-technical@lists.samba.org, linux-unionfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, bpf@vger.kernel.org, Pavel Begunkov , linux-btrfs@vger.kernel.org Errors-To: cluster-devel-bounces@redhat.com Sender: "Cluster-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linux.dev Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII"; x-default=true From: Hao Xu Add nowait parameter for xfs_inode_item_init() to support nowait semantics. Signed-off-by: Hao Xu --- fs/xfs/libxfs/xfs_trans_inode.c | 3 ++- fs/xfs/xfs_inode_item.c | 12 ++++++++---- fs/xfs/xfs_inode_item.h | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inod= e.c index cb4796b6e693..e7a8f63c8975 100644 --- a/fs/xfs/libxfs/xfs_trans_inode.c +++ b/fs/xfs/libxfs/xfs_trans_inode.c @@ -33,7 +33,8 @@ xfs_trans_ijoin( =20 =09ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); =09if (ip->i_itemp =3D=3D NULL) -=09=09xfs_inode_item_init(ip, ip->i_mount); +=09=09xfs_inode_item_init(ip, ip->i_mount, +=09=09=09=09 tp->t_flags & XFS_TRANS_NOWAIT); =09iip =3D ip->i_itemp; =20 =09ASSERT(iip->ili_lock_flags =3D=3D 0); diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 91c847a84e10..1742920bb4ce 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -825,21 +825,25 @@ static const struct xfs_item_ops xfs_inode_item_ops = =3D { /* * Initialize the inode log item for a newly allocated (in-core) inode. */ -void +int xfs_inode_item_init( =09struct xfs_inode=09*ip, -=09struct xfs_mount=09*mp) +=09struct xfs_mount=09*mp, +=09bool=09=09=09nowait) { =09struct xfs_inode_log_item *iip; +=09gfp_t gfp_flags =3D GFP_KERNEL | (nowait ? 0 : __GFP_NOFAIL); =20 =09ASSERT(ip->i_itemp =3D=3D NULL); -=09iip =3D ip->i_itemp =3D kmem_cache_zalloc(xfs_ili_cache, -=09=09=09=09=09 GFP_KERNEL | __GFP_NOFAIL); +=09iip =3D ip->i_itemp =3D kmem_cache_zalloc(xfs_ili_cache, gfp_flags); +=09if (!iip) +=09=09return -EAGAIN; =20 =09iip->ili_inode =3D ip; =09spin_lock_init(&iip->ili_lock); =09xfs_log_item_init(mp, &iip->ili_item, XFS_LI_INODE, =09=09=09=09=09=09&xfs_inode_item_ops); +=09return 0; } =20 /* diff --git a/fs/xfs/xfs_inode_item.h b/fs/xfs/xfs_inode_item.h index 377e06007804..7ba6f8a6b243 100644 --- a/fs/xfs/xfs_inode_item.h +++ b/fs/xfs/xfs_inode_item.h @@ -42,7 +42,8 @@ static inline int xfs_inode_clean(struct xfs_inode *ip) =09return !ip->i_itemp || !(ip->i_itemp->ili_fields & XFS_ILOG_ALL); } =20 -extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); +extern int xfs_inode_item_init(struct xfs_inode *ip, struct xfs_mount *mp, +=09=09=09 bool nowait); extern void xfs_inode_item_destroy(struct xfs_inode *); extern void xfs_iflush_abort(struct xfs_inode *); extern void xfs_iflush_shutdown_abort(struct xfs_inode *); --=20 2.25.1