Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2408107ybb; Mon, 30 Mar 2020 05:37:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtzjjTicHo7svcHPrBsomWvYNWdB+npHLQLoGA0AD2uQhzE8h3Y/Ax4CarwWZhGf85Ue0Mv X-Received: by 2002:a9d:5787:: with SMTP id q7mr8464172oth.137.1585571878764; Mon, 30 Mar 2020 05:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585571878; cv=none; d=google.com; s=arc-20160816; b=AEZvEGfBNoEdEj/czsGZHpKZMTzhdw/ELq+UwOzP7PmyAW0O3ncV4095r1LH9uUVPu HSSNgr87h4JOZm1ZQhGD8ZZl6NjBGOlDMy4SxwcnOBbzGjIb93yc4buB68ZW651F9Ntl FZWk/DdiifxulPNjY17rWMfHLfkCya/4+Vzbml9N2S5aA/s5aFB8LlBDtVI3m9h/cv0A aqqKvVr7Dw3rIPCao4bIpa0rAwYbhx5Vg9FZMNqERt14Sf4RKGr0PyiceR7yztIY6Y1S tzNH7fOOw+HSUYQgt6FHoYiUlrNA2lTzZNV5DziRtogQ/tmjsoTYHloWErP8nZ2BPObR LPKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GTBHkl7isrWXV+sHcC3EtBMm1ghUU8V36ZM9hA1KeIA=; b=HCI7hjMqB4Yg5nl3eugPeGmATM+1Z0rj4aI6C31LbeY2QW6Afwnyfz9BfhPjQsiKrT VnHdzW2/RQECwi5ACpIZ5eFPUZPuBQf0muyn3QP0eCaxS00hMv/nrL2qpWu2sV/9H+5G xRFUS7Md8CSe9xfHtsvnlM8exirYXd/QfzP+OX/Hdr43CuuP5DkL0S9PtRlryk9bK9j1 0Z3+al5++kp9PWQCGFDeZAE/MNtJ+2O1TVUZ2FHQ7JiaVMRYI6IthJF0P4bbRxCAqq5x rNvS3kugK0psGlJXeeJkokZ0QP2FrLYpplyM8ZOy7VFfzyMG0sd5iiGJbT6Sb3qdmPZ2 Ps9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ACDtkNhR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u135si5767725oif.248.2020.03.30.05.37.46; Mon, 30 Mar 2020 05:37:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ACDtkNhR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730266AbgC3MhU (ORCPT + 99 others); Mon, 30 Mar 2020 08:37:20 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38307 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730240AbgC3MhR (ORCPT ); Mon, 30 Mar 2020 08:37:17 -0400 Received: by mail-wr1-f66.google.com with SMTP id s1so21397802wrv.5; Mon, 30 Mar 2020 05:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GTBHkl7isrWXV+sHcC3EtBMm1ghUU8V36ZM9hA1KeIA=; b=ACDtkNhRFlh28WtvGv0vfHh3xRvklEc4mwUwoCo2eXP+XKX7m0oWe2gOrEeP0Mi5an zyCy7+41PuwBhI3QCxrrQLkQbQmWO4DkbPEq8Rq2NVK+efjGsTZseZcbAFdCYReR4WiF Wqf7xBrZOKZmSYflbg/1V8wdPzdAu5peTRQ02c1wuwCXzrHyBxPocDdN6jrTHzuUw2Kg 9U0OKHCdl6AuRZ567RrIkhyCoaF2/HHHRVEaM1wyEYntrFPOOAMGNN94l2rinI5gulZT 3L9aY4Lavy//uDFyVzM93fgKjJQz4M6MnI3AATdAMOPzREh/A4yUAu+dTtSCICo7phMR 5yrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GTBHkl7isrWXV+sHcC3EtBMm1ghUU8V36ZM9hA1KeIA=; b=CbFLtZ2+iY1jl5596hE759iYL7u80pJovkz6ioHcLDa+8zZcGa+nlW3RKD6I8pKrmp bbRYdQk8rDlG4njCAQHdEmfbN2gU+N0xdJCh2U4/kdvy52jdfmg7KwyLXQxEfb/M2mIW jlGmT4ZXffku7s5+aDRI4Q089YHsrD5nuPWXUNeIeBXUE9WdavRlwPx2VtVolTh5SMc3 2/dIZ+/YcybNQnzcAsF0lhxiHK+Tu5ld+FdcBO2NN4WFwgn9JdTKuSIG02YzJlzQ+Mfs R99dTdXmEUI4ANOhZbw3Qpaf18ndBntrK0DQTcK+58DNHycYH2F1lthvCfKwJ73rfdy1 oCnQ== X-Gm-Message-State: ANhLgQ0l8RDNAVmK6ZqEqbzCT5rnQdG4RAYiw+efUJLs5nGTMQUN8NNv m+7DU0v7ZycHO2ZnCHup4hA= X-Received: by 2002:adf:fac7:: with SMTP id a7mr15150439wrs.191.1585571835746; Mon, 30 Mar 2020 05:37:15 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id b26sm13735631wmj.21.2020.03.30.05.37.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 05:37:15 -0700 (PDT) From: Wei Yang To: willy@infradead.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 6/9] XArray: internal node is a xa_node when it is bigger than XA_ZERO_ENTRY Date: Mon, 30 Mar 2020 12:36:40 +0000 Message-Id: <20200330123643.17120-7-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200330123643.17120-1-richard.weiyang@gmail.com> References: <20200330123643.17120-1-richard.weiyang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the comment mentioned, we reserved several ranges of internal node for tree maintenance, 0-62, 256, 257. This means a node bigger than XA_ZERO_ENTRY is a normal node. The checked on XA_ZERO_ENTRY seems to be more meaningful. Signed-off-by: Wei Yang --- include/linux/xarray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/xarray.h b/include/linux/xarray.h index a491653d8882..e9d07483af64 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -1221,7 +1221,7 @@ static inline struct xa_node *xa_to_node(const void *entry) /* Private */ static inline bool xa_is_node(const void *entry) { - return xa_is_internal(entry) && (unsigned long)entry > 4096; + return xa_is_internal(entry) && entry > XA_ZERO_ENTRY; } /* Private */ -- 2.23.0