X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libcfs%2Finclude%2Flibcfs%2Flinux%2Fportals_compat25.h;h=52b62441ecfbd2cda3a47333042dac2c97ea260e;hb=44f30fd7b54bbb7fa218214f18e5c3dc3e4b1171;hp=b3a493d7dea6dd5df06e214de3a58c3320f68baf;hpb=e3a7c58aebafce40323db54bf6056029e5af4a70;p=fs%2Flustre-release.git diff --git a/libcfs/include/libcfs/linux/portals_compat25.h b/libcfs/include/libcfs/linux/portals_compat25.h index b3a493d7..52b6244 100644 --- a/libcfs/include/libcfs/linux/portals_compat25.h +++ b/libcfs/include/libcfs/linux/portals_compat25.h @@ -26,6 +26,8 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, 2013, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -35,75 +37,13 @@ #ifndef __LIBCFS_LINUX_PORTALS_COMPAT_H__ #define __LIBCFS_LINUX_PORTALS_COMPAT_H__ -// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved -#if defined(SPINLOCK_DEBUG) && SPINLOCK_DEBUG -# define SIGNAL_MASK_ASSERT() \ - LASSERT(current->sighand->siglock.magic == SPINLOCK_MAGIC) -#else -# define SIGNAL_MASK_ASSERT() -#endif -// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved - -#define SIGNAL_MASK_LOCK(task, flags) \ - spin_lock_irqsave(&task->sighand->siglock, flags) -#define SIGNAL_MASK_UNLOCK(task, flags) \ - spin_unlock_irqrestore(&task->sighand->siglock, flags) -#define USERMODEHELPER(path, argv, envp) \ - call_usermodehelper(path, argv, envp, 1) -#define RECALC_SIGPENDING recalc_sigpending() -#define CLEAR_SIGPENDING clear_tsk_thread_flag(current, \ - TIF_SIGPENDING) -# define CURRENT_SECONDS get_seconds() -# define smp_num_cpus num_online_cpus() - -#define cfs_wait_event_interruptible(wq, condition, ret) \ - ret = wait_event_interruptible(wq, condition) -#define cfs_wait_event_interruptible_exclusive(wq, condition, ret) \ - ret = wait_event_interruptible_exclusive(wq, condition) - -#define UML_PID(tsk) ((tsk)->pid) - -#define THREAD_NAME(comm, len, fmt, a...) \ - snprintf(comm, len, fmt, ## a) - -/* 2.6 alloc_page users can use page->lru */ -#define PAGE_LIST_ENTRY lru -#define PAGE_LIST(page) ((page)->lru) - #ifndef __user #define __user #endif -#ifndef __fls -#define __cfs_fls fls -#else -#define __cfs_fls __fls -#endif - -#ifdef HAVE_5ARGS_SYSCTL_PROC_HANDLER -#define ll_proc_dointvec(table, write, filp, buffer, lenp, ppos) \ - proc_dointvec(table, write, buffer, lenp, ppos); - -#define ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos) \ - proc_doulongvec_minmax(table, write, buffer, lenp, ppos); -#define ll_proc_dostring(table, write, filp, buffer, lenp, ppos) \ - proc_dostring(table, write, buffer, lenp, ppos); -#define LL_PROC_PROTO(name) \ - name(cfs_sysctl_table_t *table, int write, \ - void __user *buffer, size_t *lenp, loff_t *ppos) -#else -#define ll_proc_dointvec(table, write, filp, buffer, lenp, ppos) \ - proc_dointvec(table, write, filp, buffer, lenp, ppos); - -#define ll_proc_dolongvec(table, write, filp, buffer, lenp, ppos) \ - proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos); -#define ll_proc_dostring(table, write, filp, buffer, lenp, ppos) \ - proc_dostring(table, write, filp, buffer, lenp, ppos); -#define LL_PROC_PROTO(name) \ - name(cfs_sysctl_table_t *table, int write, struct file *filp, \ - void __user *buffer, size_t *lenp, loff_t *ppos) -#endif -#define DECLARE_LL_PROC_PPOS_DECL +#define LL_PROC_PROTO(name) \ + name(struct ctl_table *table, int write, \ + void __user *buffer, size_t *lenp, loff_t *ppos) /* helper for sysctl handlers */ int proc_call_handler(void *data, int write, @@ -111,4 +51,11 @@ int proc_call_handler(void *data, int write, int (*handler)(void *data, int write, loff_t pos, void *buffer, int len)); +#ifdef HAVE_INIT_NET +# define DEFAULT_NET (&init_net) +#else +/* some broken backports */ +# define DEFAULT_NET (NULL) +#endif + #endif /* _PORTALS_COMPAT_H */