X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=libcfs%2Finclude%2Flibcfs%2Fuser-mem.h;h=e48b124a61c85aee6036b433add6f09ac1b33e07;hb=380d84f8222486cfc320a0edeae05d17aba220d8;hp=df32135d8b46b468d59ff38858d670574558d4ba;hpb=f10a4cfd1146989e3947fc8061f2769002b3f044;p=fs%2Flustre-release.git diff --git a/libcfs/include/libcfs/user-mem.h b/libcfs/include/libcfs/user-mem.h index df32135..e48b124 100644 --- a/libcfs/include/libcfs/user-mem.h +++ b/libcfs/include/libcfs/user-mem.h @@ -1,3 +1,25 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License version 2 for more details. A copy is + * included in the COPYING file that accompanied this code. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * GPL HEADER END + */ + #ifndef __LIBCFS_USER_MEM_H__ #define __LIBCFS_USER_MEM_H__ @@ -36,16 +58,12 @@ typedef struct page { #define CFS_PAGE_SIZE (1UL << CFS_PAGE_SHIFT) #define CFS_PAGE_MASK (~((__u64)CFS_PAGE_SIZE-1)) -cfs_page_t *cfs_alloc_pages(int mask, unsigned long order); -void cfs_free_pages(cfs_page_t *pg, int what); cfs_page_t *cfs_alloc_page(unsigned int flags); void cfs_free_page(cfs_page_t *pg); void *cfs_page_address(cfs_page_t *pg); void *cfs_kmap(cfs_page_t *pg); void cfs_kunmap(cfs_page_t *pg); -#define __cfs_free_pages(pg, what) cfs_free_pages((pg), (what)) - #define cfs_get_page(p) __I_should_not_be_called__(at_all) #define cfs_page_count(p) __I_should_not_be_called__(at_all) #define cfs_page_index(p) ((p)->index) @@ -80,7 +98,7 @@ typedef struct { } cfs_mem_cache_t; #define CFS_SLAB_HWCACHE_ALIGN 0 -#define CFS_SLAB_DESTROY_BY_RCU 0 +#define SLAB_DESTROY_BY_RCU 0 #define CFS_SLAB_KERNEL 0 #define CFS_SLAB_NOFS 0 @@ -92,6 +110,20 @@ void cfs_mem_cache_free(cfs_mem_cache_t *c, void *addr); int cfs_mem_is_in_cache(const void *addr, const cfs_mem_cache_t *kmem); /* + * NUMA allocators + */ +#define cfs_cpt_malloc(cptab, cpt, bytes, flags) \ + cfs_alloc(bytes, flags) +#define cfs_cpt_vmalloc(cptab, cpt, bytes) \ + cfs_alloc(bytes) +#define cfs_page_cpt_alloc(cptab, cpt, mask) \ + cfs_alloc_page(mask) +#define cfs_mem_cache_cpt_alloc(cache, cptab, cpt, gfp) \ + cfs_mem_cache_alloc(cache, gfp) + +#define smp_rmb() do {} while (0) + +/* * Copy to/from user */ static inline int cfs_copy_from_user(void *a,void *b, int c)