Whamcloud - gitweb
LU-1346 libcfs: replace cfs_ memory wrappers 31/2831/13
authorPeng Tao <tao.peng@emc.com>
Mon, 17 Jun 2013 09:33:12 +0000 (17:33 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 28 Jun 2013 19:01:34 +0000 (19:01 +0000)
commit1b2547843817b4b7adbeb87ea9b070d9cac35c90
tree6e5de510ace582d0ca2d626bd99b00329f23f7bd
parent9f5eea8ea8b42298e8b7eadebc51ceba4687705c
LU-1346 libcfs: replace cfs_ memory wrappers

Replace memory relevant wrappers with kernel API.

Affected primitives:
CFS_PAGE_SIZE, CFS_PAGE_SHIFT, cfs_num_physpages,
cfs_copy_from_user, cfs_copy_to_user, cfs_page_address,
cfs_kmap/cfs_kunmap, cfs_get_page, cfs_page_count,
cfs_page_index, cfs_page_pin, cfs_page_unpin,
cfs_memory_pressure_get/set/clr, CFS_NUM_CACHEPAGES,
CFS_ALLOC_XXX flags, cfs_alloc/free, cfs_alloc/free_large,
cfs_alloc/free_page, CFS_DECL_MMSPACE, CFS_MMSPACE_OPEN,
CFS_MMSPACE_CLOSE, CFS_SLAB_XXX flags, cfs_shrinker_t,
cfs_set/remove_shrinker, CFS_DEFAULT_SEEKS, cfs_mem_cache_t,
cfs_mem_cache_alloc/free/create/destroy, cfs_mem_is_in_cache

manual changes:
1. cfs_alloc_flags_to_gfp() is removed
2. remove kmalloc/kfree etc. from linux-mem.c and linux-mem.h
3. remove page_address/kmap/kunmap etc. from linux-mem.h
4. remove page_cache_get/page_cache_release from echo_internal.h. They
are defined already in user-mem.h
5. change kmem_cache_create/destroy prototype to kernel's and modify
all callers to match them
6. define _SPL_KMEM_H and related macros to avoid using spl's
sys/kmem.h that redefines slab allocator
7. change kmem_virt to is_vmalloc_addr as provided by kernel, so that
we don't use any spl's sys/kmem.h functions
8. clean up include files a little bit in osd-zfs
9. various coding style cleanup

NUMA allocators(cfs_cpt_xxx) are not changed in this patch.
gnilnd is not converted, as requested by James Simmons.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Iadfbb0d5a0e31c78dd6c811e5ffdb468fa7e6f44
Reviewed-on: http://review.whamcloud.com/2831
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
212 files changed:
contrib/scripts/libcfs_cleanup.sed
libcfs/include/libcfs/darwin/darwin-mem.h
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/libcfs_crypto.h
libcfs/include/libcfs/libcfs_prim.h
libcfs/include/libcfs/libcfs_private.h
libcfs/include/libcfs/libcfs_string.h
libcfs/include/libcfs/linux/kp30.h
libcfs/include/libcfs/linux/linux-mem.h
libcfs/include/libcfs/posix/libcfs.h
libcfs/include/libcfs/user-mem.h
libcfs/include/libcfs/winnt/portals_utils.h
libcfs/include/libcfs/winnt/winnt-mem.h
libcfs/include/libcfs/winnt/winnt-prim.h
libcfs/include/libcfs/winnt/winnt-tcpip.h
libcfs/libcfs/darwin/darwin-mem.c
libcfs/libcfs/darwin/darwin-tcpip.c
libcfs/libcfs/darwin/darwin-tracefile.c
libcfs/libcfs/debug.c
libcfs/libcfs/heap.c
libcfs/libcfs/kernel_user_comm.c
libcfs/libcfs/libcfs_string.c
libcfs/libcfs/linux/linux-crypto.c
libcfs/libcfs/linux/linux-curproc.c
libcfs/libcfs/linux/linux-mem.c
libcfs/libcfs/linux/linux-tcpip.c
libcfs/libcfs/linux/linux-tracefile.c
libcfs/libcfs/lwt.c
libcfs/libcfs/module.c
libcfs/libcfs/posix/posix-debug.c
libcfs/libcfs/tracefile.c
libcfs/libcfs/tracefile.h
libcfs/libcfs/user-crypto.c
libcfs/libcfs/user-mem.c
libcfs/libcfs/winnt/winnt-curproc.c
libcfs/libcfs/winnt/winnt-fs.c
libcfs/libcfs/winnt/winnt-mem.c
libcfs/libcfs/winnt/winnt-module.c
libcfs/libcfs/winnt/winnt-prim.c
libcfs/libcfs/winnt/winnt-proc.c
libcfs/libcfs/winnt/winnt-tcpip.c
libcfs/libcfs/winnt/winnt-tracefile.c
libcfs/libcfs/winnt/winnt-usr.c
libcfs/libcfs/winnt/winnt-utils.c
lnet/include/lnet/darwin/lib-types.h
lnet/include/lnet/types.h
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/ptllnd/ptllnd.c
lnet/klnds/ptllnd/ptllnd.h
lnet/klnds/ptllnd/ptllnd_rx_buf.c
lnet/klnds/socklnd/socklnd_lib-darwin.c
lnet/klnds/socklnd/socklnd_lib-linux.c
lnet/lnet/api-ni.c
lnet/lnet/lib-md.c
lnet/lnet/lib-move.c
lnet/lnet/router.c
lnet/lnet/router_proc.c
lnet/selftest/brw_test.c
lnet/selftest/conctl.c
lnet/selftest/conrpc.c
lnet/selftest/console.c
lnet/selftest/framework.c
lnet/selftest/rpc.c
lnet/selftest/selftest.h
lnet/utils/lst.c
lustre/fld/fld_cache.c
lustre/include/cl_object.h
lustre/include/lclient.h
lustre/include/liblustre.h
lustre/include/lu_object.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_capa.h
lustre/include/lustre_debug.h
lustre/include/lustre_disk.h
lustre/include/lustre_idmap.h
lustre/include/lustre_lib.h
lustre/include/lustre_net.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/include/obd_support.h
lustre/lclient/lcommon_cl.c
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/lfsck/lfsck_namespace.c
lustre/liblustre/dir.c
lustre/liblustre/llite_cl.c
lustre/liblustre/llite_lib.h
lustre/liblustre/super.c
lustre/liblustre/tests/sanity.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/llite_mmap.c
lustre/llite/lloop.c
lustre/llite/lproc_llite.c
lustre/llite/remote_perm.c
lustre/llite/rw.c
lustre/llite/rw26.c
lustre/llite/super25.c
lustre/llite/vvp_dev.c
lustre/llite/vvp_internal.h
lustre/llite/vvp_io.c
lustre/llite/vvp_page.c
lustre/lmv/lmv_obd.c
lustre/lmv/lproc_lmv.c
lustre/lod/lod_dev.c
lustre/lod/lod_object.c
lustre/lov/lov_cl_internal.h
lustre/lov/lov_dev.c
lustre/lov/lov_ea.c
lustre/lov/lov_internal.h
lustre/lov/lov_lock.c
lustre/lov/lov_obd.c
lustre/lov/lov_object.c
lustre/lov/lov_pack.c
lustre/lov/lov_page.c
lustre/lov/lovsub_dev.c
lustre/lov/lovsub_lock.c
lustre/lov/lovsub_object.c
lustre/lov/lovsub_page.c
lustre/lvfs/fsfilt_ext3.c
lustre/mdc/mdc_request.c
lustre/mdd/mdd_device.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_lproc.c
lustre/mdd/mdd_object.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lproc.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_handler.c
lustre/mgs/mgs_nids.c
lustre/obdclass/capa.c
lustre/obdclass/cl_lock.c
lustre/obdclass/cl_object.c
lustre/obdclass/cl_page.c
lustre/obdclass/class_obd.c
lustre/obdclass/debug.c
lustre/obdclass/dt_object.c
lustre/obdclass/genops.c
lustre/obdclass/linkea.c
lustre/obdclass/linux/linux-module.c
lustre/obdclass/linux/linux-obdo.c
lustre/obdclass/linux/linux-sysctl.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lu_object.c
lustre/obdclass/lu_ref.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/obdecho/echo_internal.h
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_fmd.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_obd.c
lustre/osc/lproc_osc.c
lustre/osc/osc_cache.c
lustre/osc/osc_cl_internal.h
lustre/osc/osc_dev.c
lustre/osc/osc_internal.h
lustre/osc/osc_io.c
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osc/osc_page.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_io.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-ldiskfs/osd_quota_fmt.c
lustre/osd-zfs/osd_handler.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_io.c
lustre/osd-zfs/osd_lproc.c
lustre/osd-zfs/osd_object.c
lustre/osd-zfs/osd_quota.c
lustre/osd-zfs/udmu.h
lustre/osp/osp_dev.c
lustre/osp/osp_internal.h
lustre/osp/osp_md_object.c
lustre/ost/ost_handler.c
lustre/ost/ost_internal.h
lustre/ptlrpc/client.c
lustre/ptlrpc/events.c
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/gss/gss_krb5_mech.c
lustre/ptlrpc/gss/gss_pipefs.c
lustre/ptlrpc/import.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/nrs.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/pers.c
lustre/ptlrpc/ptlrpc_internal.h
lustre/ptlrpc/recover.c
lustre/ptlrpc/sec_bulk.c
lustre/ptlrpc/sec_plain.c
lustre/quota/lquota_entry.c
lustre/quota/lquota_internal.h
lustre/quota/lquota_lib.c
lustre/quota/qsd_internal.h
lustre/quota/qsd_lib.c
lustre/quota/qsd_reint.c
lustre/quota/qsd_request.c
lustre/quota/qsd_writeback.c
lustre/tests/checkfiemap.c
lustre/utils/lustre_cfg.c