Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1249731ioo; Fri, 27 May 2022 05:01:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtkCdRB72g65D5jQAKnkN1bLlFkPQfe4zpxDCW0l09ZlmU1aXgX6coAHZNi4McEENwhI5o X-Received: by 2002:a17:90b:3a85:b0:1e0:548:2bf7 with SMTP id om5-20020a17090b3a8500b001e005482bf7mr8045460pjb.55.1653652914939; Fri, 27 May 2022 05:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653652914; cv=none; d=google.com; s=arc-20160816; b=pI1gEfBPid2o7z9NsBrDKUPoIef+bbPjL8E24svrn6QlVHqZ2jvx0LeNA3ScDxCike VOjMu0iYldUdi63KuaSYiSCJpT4LGecK5AUhPObplNsqU49JxkRmt20CLgUX/AIlexZr 9vb/nmdK44OXFYHMzKSWBpHDTC+E7v+sDMpx0OsHFGLZElQvzYH8G+0od13DjmFHrWwf NgbYw7wuJF2Yb8q0cdMCGjTA1Vj8cruwohXJKmM8reKxGOgUyhDvZaBg2wLP3yQBQgDq 3y57RDTX23Y3224n4DxGLfBeQ8HlHETjaD9/pEAsJWAmaz8154TjVB7/11r8LnsGN+wS E0Hg== 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 :message-id:date:subject:cc:to:from; bh=6E0C9uPcNhtfbqEzFxgCgFDqUUiRjkDz1I381m2rNE4=; b=rV4d8AbM+lxNez2MV0Q/fvJ4Wz1dLFzADUeZ/1vSeC88bVYN1u5LkIT4AKXauhxaVJ oqyO2QiiQyZPNgxihSpbreyzHj37aImR48bjBMkwR5GZy3QskYt1TNdlsTgt7aRVdSWv qJxoYqAq3cCNIQKhSNWOzVuDkAgIqMfZCruy39y+04adF0imXVIOP2NE9w8OKBqcEuPG JdPEyuNL0AGG007RDVzu6W2dFdOpI31lQK5/acvx+v+lCo+oJq0z6g5KDPuisjnDzMJb enX2vrO9PFhmVe3TchnPqV5mP/3/BWHdGfyzB7K+EijkH/tOGWo1YVUWBpOHoAp0Yxcd A94A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb6-20020a17090ae7c600b001dfce31c936si3056190pjb.135.2022.05.27.05.01.35; Fri, 27 May 2022 05:01:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240291AbiE0G21 (ORCPT + 99 others); Fri, 27 May 2022 02:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238874AbiE0G20 (ORCPT ); Fri, 27 May 2022 02:28:26 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3097239BBB; Thu, 26 May 2022 23:28:24 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L8ZbX15V2zjX79; Fri, 27 May 2022 14:27:20 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:28:22 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:28:22 +0800 From: keliu To: , , , CC: keliu Subject: [PATCH] nfs: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 06:49:51 +0000 Message-ID: <20220527064951.2358639-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-nfs@vger.kernel.org Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- fs/nfs/nfs4state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 9e1c987c81e7..e4c311dc8b93 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -497,7 +497,7 @@ nfs4_alloc_state_owner(struct nfs_server *server, sp = kzalloc(sizeof(*sp), gfp_flags); if (!sp) return NULL; - sp->so_seqid.owner_id = ida_simple_get(&server->openowner_id, 0, 0, + sp->so_seqid.owner_id = ida_alloc(&server->openowner_id, gfp_flags); if (sp->so_seqid.owner_id < 0) { kfree(sp); @@ -534,7 +534,7 @@ static void nfs4_free_state_owner(struct nfs4_state_owner *sp) { nfs4_destroy_seqid_counter(&sp->so_seqid); put_cred(sp->so_cred); - ida_simple_remove(&sp->so_server->openowner_id, sp->so_seqid.owner_id); + ida_free(&sp->so_server->openowner_id, sp->so_seqid.owner_id); kfree(sp); } @@ -877,8 +877,8 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f refcount_set(&lsp->ls_count, 1); lsp->ls_state = state; lsp->ls_owner = fl_owner; - lsp->ls_seqid.owner_id = ida_simple_get(&server->lockowner_id, - 0, 0, GFP_KERNEL_ACCOUNT); + lsp->ls_seqid.owner_id = ida_alloc(&server->lockowner_id, + GFP_KERNEL_ACCOUNT); if (lsp->ls_seqid.owner_id < 0) goto out_free; INIT_LIST_HEAD(&lsp->ls_locks); @@ -890,7 +890,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp) { - ida_simple_remove(&server->lockowner_id, lsp->ls_seqid.owner_id); + ida_free(&server->lockowner_id, lsp->ls_seqid.owner_id); nfs4_destroy_seqid_counter(&lsp->ls_seqid); kfree(lsp); } -- 2.25.1