Commit bd6e2c50 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: libcfs: move memory_pressure functions to libcfs_prim.h

Long ago libcfs_prim.h was used for userland code which is why
memory_pressure_*() handling is in both libcfs_prim.h and
linux-mem.h headers. So lets just move the memory_pressure_*()
to libcfs_prim.h.
Signed-off-by: default avatarJames Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/13841Reviewed-by: default avatarfrank zago <fzago@cray.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 564f5d6e
...@@ -43,15 +43,20 @@ ...@@ -43,15 +43,20 @@
/* /*
* Memory * Memory
*/ */
#ifndef memory_pressure_get static inline unsigned int memory_pressure_get(void)
#define memory_pressure_get() (0) {
#endif return current->flags & PF_MEMALLOC;
#ifndef memory_pressure_set }
#define memory_pressure_set() do {} while (0)
#endif static inline void memory_pressure_set(void)
#ifndef memory_pressure_clr {
#define memory_pressure_clr() do {} while (0) current->flags |= PF_MEMALLOC;
#endif }
static inline void memory_pressure_clr(void)
{
current->flags &= ~PF_MEMALLOC;
}
static inline int cfs_memory_pressure_get_and_set(void) static inline int cfs_memory_pressure_get_and_set(void)
{ {
......
...@@ -59,10 +59,6 @@ ...@@ -59,10 +59,6 @@
#define page_index(p) ((p)->index) #define page_index(p) ((p)->index)
#define memory_pressure_get() (current->flags & PF_MEMALLOC)
#define memory_pressure_set() do { current->flags |= PF_MEMALLOC; } while (0)
#define memory_pressure_clr() do { current->flags &= ~PF_MEMALLOC; } while (0)
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
/* limit to lowmem on 32-bit systems */ /* limit to lowmem on 32-bit systems */
#define NUM_CACHEPAGES \ #define NUM_CACHEPAGES \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment