From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kent Overstreet Subject: Re: [PATCH 1/6] Generic radix trees Date: Sat, 26 May 2018 01:56:01 -0400 Message-ID: <20180526055601.GA26155@kmo-pixel> References: <20180523011821.12165-1-kent.overstreet@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces-yBygre7rU0TnMu66kgdUjQ@public.gmane.org Errors-To: ovs-dev-bounces-yBygre7rU0TnMu66kgdUjQ@public.gmane.org To: Liu Bo Cc: dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, willy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org, selinux-+05T5uksL2qpZYMLLGbcSA@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, shli-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org List-Id: linux-raid.ids On Sat, May 26, 2018 at 11:16:42AM +0800, Liu Bo wrote: > > +/* > > + * Returns pointer to the specified byte @offset within @radix, allocating it if > > + * necessary - newly allocated slots are always zeroed out: > > + */ > > +void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset, > > + gfp_t gfp_mask) > > +{ > > + struct genradix_node **n; > > Any reason that " struct genradix_node ** " is used here instead of " > struct genradix_node * "? > > Looks like this function only manipulates *n, am I missing something? It stores to *n, when it has to allocate a node (including the root) From mboxrd@z Thu Jan 1 00:00:00 1970 From: kent.overstreet@gmail.com (Kent Overstreet) Date: Sat, 26 May 2018 01:56:01 -0400 Subject: [PATCH 1/6] Generic radix trees In-Reply-To: References: <20180523011821.12165-1-kent.overstreet@gmail.com> Message-ID: <20180526055601.GA26155@kmo-pixel> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Sat, May 26, 2018 at 11:16:42AM +0800, Liu Bo wrote: > > +/* > > + * Returns pointer to the specified byte @offset within @radix, allocating it if > > + * necessary - newly allocated slots are always zeroed out: > > + */ > > +void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset, > > + gfp_t gfp_mask) > > +{ > > + struct genradix_node **n; > > Any reason that " struct genradix_node ** " is used here instead of " > struct genradix_node * "? > > Looks like this function only manipulates *n, am I missing something? It stores to *n, when it has to allocate a node (including the root) -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id w4Q5uAw8016514 for ; Sat, 26 May 2018 01:56:10 -0400 Received: by mail-qt0-f194.google.com with SMTP id g13-v6so9220711qth.8 for ; Fri, 25 May 2018 22:56:06 -0700 (PDT) Date: Sat, 26 May 2018 01:56:01 -0400 From: Kent Overstreet To: Liu Bo Cc: linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, willy@infradead.org, gregkh@linuxfoundation.org, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, dev@openvswitch.org, shli@kernel.org, linux-raid@vger.kernel.org Message-ID: <20180526055601.GA26155@kmo-pixel> References: <20180523011821.12165-1-kent.overstreet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Subject: Re: [PATCH 1/6] Generic radix trees List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: On Sat, May 26, 2018 at 11:16:42AM +0800, Liu Bo wrote: > > +/* > > + * Returns pointer to the specified byte @offset within @radix, allocating it if > > + * necessary - newly allocated slots are always zeroed out: > > + */ > > +void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset, > > + gfp_t gfp_mask) > > +{ > > + struct genradix_node **n; > > Any reason that " struct genradix_node ** " is used here instead of " > struct genradix_node * "? > > Looks like this function only manipulates *n, am I missing something? It stores to *n, when it has to allocate a node (including the root)