lkml.org 
[lkml]   [2022]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] lib/genalloc: Set chunk size to real size which gen_pool managed.
On Tue, 14 Jun 2022 13:20:08 +0800 chi wu <wuchi.zero@gmail.com> wrote:

> > If we're going to do this then gen_pool_add_owner() no longer needs its
> > `size' argument.
> >
> >
> Sorry, What point did I misunderstand?

I mean we can now do this:

--- a/lib/genalloc.c~lib-genalloc-set-chunk-size-to-real-size-which-gen_pool-managed-fix
+++ a/lib/genalloc.c
@@ -181,13 +181,14 @@ EXPORT_SYMBOL(gen_pool_create);
*
* Returns 0 on success or a -ve errno on failure.
*/
-int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt, phys_addr_t phys,
- size_t size, int nid, void *owner)
+int gen_pool_add_owner(struct gen_pool *pool, unsigned long virt,
+ phys_addr_t phys, int nid, void *owner)
{
struct gen_pool_chunk *chunk;
unsigned long nbits = size >> pool->min_alloc_order;
unsigned long nbytes = sizeof(struct gen_pool_chunk) +
BITS_TO_LONGS(nbits) * sizeof(long);
+ size_t size;

chunk = vzalloc_node(nbytes, nid);
if (unlikely(chunk == NULL))
_
and fix up all the callers, prototype, kerneldoc, etc. Probably as a
second followup patch.


Please take a look at that, add the additional details to the changelog
and resend?

\
 
 \ /
  Last update: 2022-06-14 19:55    [W:0.059 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site