X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Finclude%2Flibcfs%2Flinux%2Flinux-mem.h;h=8fb2184a3c9dc4b8b49435ee0d67f8ca2e425950;hp=21a17d9a91e813c8a0c36a7ea8ec22accb8d9aa7;hb=3dcf18d3;hpb=421d7a675265d697a1a9308aa9dac8030eab497a;ds=sidebyside diff --git a/libcfs/include/libcfs/linux/linux-mem.h b/libcfs/include/libcfs/linux/linux-mem.h index 21a17d9..8fb2184 100644 --- a/libcfs/include/libcfs/linux/linux-mem.h +++ b/libcfs/include/libcfs/linux/linux-mem.h @@ -16,8 +16,8 @@ * in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see [sun.com URL with a - * copy of GPLv2]. + * version 2 along with this program; If not, see + * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or @@ -47,7 +47,7 @@ #ifndef __KERNEL__ #error This include is only for kernel use. -#endif +#endif #include #include @@ -110,6 +110,10 @@ extern void __cfs_free_pages(cfs_page_t *page, unsigned int order); #define __cfs_free_page(page) __cfs_free_pages(page, 0) #define cfs_free_page(p) __free_pages(p, 0) +#define libcfs_memory_pressure_get() (current->flags & PF_MEMALLOC) +#define libcfs_memory_pressure_set() do { current->flags |= PF_MEMALLOC; } while (0) +#define libcfs_memory_pressure_clr() do { current->flags &= ~PF_MEMALLOC; } while (0) + /* * In Linux there is no way to determine whether current execution context is * blockable. @@ -129,6 +133,7 @@ extern cfs_mem_cache_t * cfs_mem_cache_create (const char *, size_t, size_t, uns extern int cfs_mem_cache_destroy ( cfs_mem_cache_t * ); extern void *cfs_mem_cache_alloc ( cfs_mem_cache_t *, int); extern void cfs_mem_cache_free ( cfs_mem_cache_t *, void *); +extern int cfs_mem_is_in_cache(const void *addr, const cfs_mem_cache_t *kmem); /* */