Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
220897ff
Commit
220897ff
authored
Oct 27, 2002
by
Alan Cox
Committed by
Linus Torvalds
Oct 27, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] mempool helpers used by device mapper
parent
8341f60b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
include/linux/mempool.h
include/linux/mempool.h
+7
-0
mm/mempool.c
mm/mempool.c
+17
-0
No files found.
include/linux/mempool.h
View file @
220897ff
...
@@ -27,4 +27,11 @@ extern void mempool_destroy(mempool_t *pool);
...
@@ -27,4 +27,11 @@ extern void mempool_destroy(mempool_t *pool);
extern
void
*
mempool_alloc
(
mempool_t
*
pool
,
int
gfp_mask
);
extern
void
*
mempool_alloc
(
mempool_t
*
pool
,
int
gfp_mask
);
extern
void
mempool_free
(
void
*
element
,
mempool_t
*
pool
);
extern
void
mempool_free
(
void
*
element
,
mempool_t
*
pool
);
/*
* A mempool_alloc_t and mempool_free_t that get the memory from
* a slab that is passed in through pool_data.
*/
void
*
mempool_alloc_slab
(
int
gfp_mask
,
void
*
pool_data
);
void
mempool_free_slab
(
void
*
element
,
void
*
pool_data
);
#endif
/* _LINUX_MEMPOOL_H */
#endif
/* _LINUX_MEMPOOL_H */
mm/mempool.c
View file @
220897ff
...
@@ -259,8 +259,25 @@ void mempool_free(void *element, mempool_t *pool)
...
@@ -259,8 +259,25 @@ void mempool_free(void *element, mempool_t *pool)
pool
->
free
(
element
,
pool
->
pool_data
);
pool
->
free
(
element
,
pool
->
pool_data
);
}
}
/*
* A commonly used alloc and free fn.
*/
void
*
mempool_alloc_slab
(
int
gfp_mask
,
void
*
pool_data
)
{
kmem_cache_t
*
mem
=
(
kmem_cache_t
*
)
pool_data
;
return
kmem_cache_alloc
(
mem
,
gfp_mask
);
}
void
mempool_free_slab
(
void
*
element
,
void
*
pool_data
)
{
kmem_cache_t
*
mem
=
(
kmem_cache_t
*
)
pool_data
;
kmem_cache_free
(
mem
,
element
);
}
EXPORT_SYMBOL
(
mempool_create
);
EXPORT_SYMBOL
(
mempool_create
);
EXPORT_SYMBOL
(
mempool_resize
);
EXPORT_SYMBOL
(
mempool_resize
);
EXPORT_SYMBOL
(
mempool_destroy
);
EXPORT_SYMBOL
(
mempool_destroy
);
EXPORT_SYMBOL
(
mempool_alloc
);
EXPORT_SYMBOL
(
mempool_alloc
);
EXPORT_SYMBOL
(
mempool_free
);
EXPORT_SYMBOL
(
mempool_free
);
EXPORT_SYMBOL
(
mempool_alloc_slab
);
EXPORT_SYMBOL
(
mempool_free_slab
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment