linux-next: manual merge of the folio tree with the xfs tree
Hi all,
Today's linux-next merge of the folio tree got a conflict in:
mm/util.c
between commit:
de2860f46362 ("mm: Add kvrealloc()")
from the xfs tree and commit:
3bc0556bade4 ("mm: Add folio_raw_mapping()")
from the folio tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Signature · 39 lines
Cheers,
Stephen Rothwell
diff --cc mm/util.c
index d06e48b28eec,e8fa30e48447..000000000000
--- a/mm/util.c
+++ b/mm/util.c
@@@ -660,31 -635,6 +660,21 @@@ void kvfree_sensitive(const void *addr
}
EXPORT_SYMBOL(kvfree_sensitive);
+void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags)
+{
+ void *newp;
+
+ if (oldsize >= newsize)
+ return (void *)p;
+ newp = kvmalloc(newsize, flags);
+ if (!newp)
+ return NULL;
+ memcpy(newp, p, oldsize);
+ kvfree(p);
+ return newp;
+}
+EXPORT_SYMBOL(kvrealloc);
+
- static inline void *__page_rmapping(struct page *page)
- {
- unsigned long mapping;
-
- mapping = (unsigned long)page->mapping;
- mapping &= ~PAGE_MAPPING_FLAGS;
-
- return (void *)mapping;
- }
-
/* Neutral page->mapping pointer to address_space or anon_vma or other */
void *page_rmapping(struct page *page)
{Quoted 14 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the folio tree got a conflict in:
mm/util.cbetween commit:
de2860f46362("mm: Addkvrealloc()")from the xfs tree and commit:
3bc0556bade4("mm: Addfolio_raw_mapping()")
Quoted 8 lines
from the folio tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Hmmm. Seeing as krealloc lives in mm/slab_common.c anyway, I might just move this function there, and (hopefully) avoid this conflict.
--D
Quoted 41 lines
Signature · 3 lines
-- Cheers, Stephen Rothwellmm/util.c +0
-10@@@ -660,31 -635,6 +660,21 @@@ void kvfree_sensitive(const void *addr }EXPORT_SYMBOL (kvfree_sensitive); +void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags) +{ + void *newp; + + if (oldsize >= newsize) + return (void *)p; + newp =kvmalloc (newsize, flags); + if (!newp) + return NULL; +memcpy (newp, p, oldsize); +kvfree (p); + return newp; +} +EXPORT_SYMBOL (kvrealloc); + - static inline void *__page_rmapping(struct page *page) - { -unsigned long mapping; - - mapping = (unsigned long )page->mapping; - mapping &= ~PAGE_MAPPING_FLAGS ; - -return (void *)mapping; - } -/* Neutral page->mapping pointer to address_space or anon_vma or other */ void *page_rmapping(struct page *page) {
Quoted 24 lines · Darrick J. Wong
Quoted 14 lines · Stephen Rothwell
Hi all,
Today's linux-next merge of the folio tree got a conflict in:
mm/util.cbetween commit:
de2860f46362("mm: Addkvrealloc()")from the xfs tree and commit:
3bc0556bade4("mm: Addfolio_raw_mapping()")Quoted 8 lines
from the folio tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
Quoted 2 lines
Hmmm. Seeing as krealloc lives in
mm/slab_common.canyway, I might just move this function there, and (hopefully) avoid this conflict.
Never mind, didn't work.
--D
Quoted 46 lines
--D
Quoted 41 lines
Signature · 3 lines
-- Cheers, Stephen Rothwellmm/util.c +0
-10@@@ -660,31 -635,6 +660,21 @@@ void kvfree_sensitive(const void *addr }EXPORT_SYMBOL (kvfree_sensitive); +void *kvrealloc(const void *p, size_t oldsize, size_t newsize, gfp_t flags) +{ + void *newp; + + if (oldsize >= newsize) + return (void *)p; + newp =kvmalloc (newsize, flags); + if (!newp) + return NULL; +memcpy (newp, p, oldsize); +kvfree (p); + return newp; +} +EXPORT_SYMBOL (kvrealloc); + - static inline void *__page_rmapping(struct page *page) - { -unsigned long mapping; - - mapping = (unsigned long )page->mapping; - mapping &= ~PAGE_MAPPING_FLAGS ; - -return (void *)mapping; - } -/* Neutral page->mapping pointer to address_space or anon_vma or other */ void *page_rmapping(struct page *page) {