From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BA95250E2; Fri, 26 Jan 2024 21:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304447; cv=none; b=EZJIsK2ssxE5an0ufuCuEj2N1tBGMuK+7i15+3N3LVV6l3/soAABcA/oVLHv1apxGwDjGGeOBGlMycugvOLqGuJi1pOrDXgddWwUhvyDqHRTn+JllOUEdY+Vtq92gkuU8OoFhoq9F6qpJjO7hcnMT4LuEkZ8ItpR8R4L62ycCBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706304447; c=relaxed/simple; bh=0Ibpzu52pa7xZyWfPXdiBU7biXDc1fNDD9XSBAy9kds=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=L0j8c/tPAdQvXWFgt5vJJbucRTotxyjt3giIfdI6DfFhGsDlFQE1ScnBN9Tfk8agsQcuJvz8PxqgTKq9tzlaTYrMh1KOogcO/ZIfVBnEJVte9HHG+HO8LAB7ehGpEXUDWd5PFrzjhtfBmDuvw7ji8sUWkK3ZrsUsGxSPGswzFDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A4BC433F1; Fri, 26 Jan 2024 21:27:25 +0000 (UTC) Date: Fri, 26 Jan 2024 16:27:28 -0500 From: Steven Rostedt To: Mathieu Desnoyers Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Christian Brauner , Ajay Kaher , Geert Uytterhoeven , linux-fsdevel , Linus Torvalds Subject: Re: [RESEND] [PATCH] eventfs: Have inodes have unique inode numbers Message-ID: <20240126162728.786e56dd@gandalf.local.home> In-Reply-To: References: <20240126151251.74cb9285@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 26 Jan 2024 15:24:17 -0500 Mathieu Desnoyers wrote: > On 2024-01-26 15:12, Steven Rostedt wrote: > [...] > > diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c > > index e1b172c0e091..2187be6d7b23 100644 > > --- a/fs/tracefs/inode.c > > +++ b/fs/tracefs/inode.c > > @@ -223,13 +223,41 @@ static const struct inode_operations tracefs_file_inode_operations = { > > .setattr = tracefs_setattr, > > }; > > > > +/* Copied from get_next_ino() but adds allocation for multiple inodes */ > > +#define LAST_INO_BATCH 1024 > > +#define LAST_INO_MASK (~(LAST_INO_BATCH - 1)) > > +static DEFINE_PER_CPU(unsigned int, last_ino); > > + > > +unsigned int tracefs_get_next_ino(int files) > > +{ > > + unsigned int *p = &get_cpu_var(last_ino); > > + unsigned int res = *p; > > + > > +#ifdef CONFIG_SMP > > + /* Check if adding files+1 overflows */ > > How does it handle a @files input where: > > * (files+1 > LAST_INO_BATCH) ? > > * (files+1 == LAST_INO_BATCH) ? Well, this is moot anyway, as Linus hates it. -- Steve