aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/include
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/include')
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/bitmap.h1
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/curproc.h2
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs.h55
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h10
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h2
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h18
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h33
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h17
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h4
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_private.h43
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_time.h29
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/kp30.h93
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h67
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-bitops.h38
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h84
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-crypto.h49
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h204
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h11
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h82
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h72
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h149
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/linux-types.h36
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h22
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/lucache.h16
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/params_tree.h164
-rw-r--r--drivers/staging/lustre/include/linux/lnet/api-support.h8
-rw-r--r--drivers/staging/lustre/include/linux/lnet/api.h5
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-lnet.h50
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lib-types.h23
-rw-r--r--drivers/staging/lustre/include/linux/lnet/linux/api-support.h1
-rw-r--r--drivers/staging/lustre/include/linux/lnet/linux/lib-lnet.h5
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lnet-sysctl.h2
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lnet.h6
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lnetctl.h22
-rw-r--r--drivers/staging/lustre/include/linux/lnet/lnetst.h6
-rw-r--r--drivers/staging/lustre/include/linux/lnet/ptllnd.h3
-rw-r--r--drivers/staging/lustre/include/linux/lnet/ptllnd_wire.h3
-rw-r--r--drivers/staging/lustre/include/linux/lnet/socklnd.h4
-rw-r--r--drivers/staging/lustre/include/linux/lnet/types.h4
39 files changed, 234 insertions, 1209 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/bitmap.h b/drivers/staging/lustre/include/linux/libcfs/bitmap.h
deleted file mode 100644
index 8b137891791f..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/bitmap.h
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/drivers/staging/lustre/include/linux/libcfs/curproc.h b/drivers/staging/lustre/include/linux/libcfs/curproc.h
index b314f34d2e68..1edfca58c1c6 100644
--- a/drivers/staging/lustre/include/linux/libcfs/curproc.h
+++ b/drivers/staging/lustre/include/linux/libcfs/curproc.h
@@ -73,7 +73,7 @@ typedef __u32 cfs_cap_t;
(1 << CFS_CAP_DAC_OVERRIDE) | \
(1 << CFS_CAP_DAC_READ_SEARCH) | \
(1 << CFS_CAP_FOWNER) | \
- (1 << CFS_CAP_FSETID ) | \
+ (1 << CFS_CAP_FSETID) | \
(1 << CFS_CAP_LINUX_IMMUTABLE) | \
(1 << CFS_CAP_SYS_ADMIN) | \
(1 << CFS_CAP_SYS_BOOT) | \
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 26b53f6420e5..7d37bec918f3 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -41,21 +41,21 @@
#define __attribute__(x)
#endif
-#include <linux/libcfs/linux/libcfs.h>
+#include "linux/libcfs.h"
#include <linux/gfp.h>
#include "curproc.h"
#ifndef offsetof
-# define offsetof(typ,memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb)))
+# define offsetof(typ, memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb)))
#endif
#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0])))
+#define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))
#endif
#if !defined(swap)
-#define swap(x,y) do { typeof(x) z = x; x = y; y = z; } while (0)
+#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
#endif
#if !defined(container_of)
@@ -89,18 +89,18 @@ static inline int __is_po2(unsigned long long val)
int libcfs_ipif_query(char *name, int *up, __u32 *ip, __u32 *mask);
int libcfs_ipif_enumerate(char ***names);
void libcfs_ipif_free_enumeration(char **names, int n);
-int libcfs_sock_listen(socket_t **sockp, __u32 ip, int port, int backlog);
-int libcfs_sock_accept(socket_t **newsockp, socket_t *sock);
-void libcfs_sock_abort_accept(socket_t *sock);
-int libcfs_sock_connect(socket_t **sockp, int *fatal,
+int libcfs_sock_listen(struct socket **sockp, __u32 ip, int port, int backlog);
+int libcfs_sock_accept(struct socket **newsockp, struct socket *sock);
+void libcfs_sock_abort_accept(struct socket *sock);
+int libcfs_sock_connect(struct socket **sockp, int *fatal,
__u32 local_ip, int local_port,
__u32 peer_ip, int peer_port);
-int libcfs_sock_setbuf(socket_t *socket, int txbufsize, int rxbufsize);
-int libcfs_sock_getbuf(socket_t *socket, int *txbufsize, int *rxbufsize);
-int libcfs_sock_getaddr(socket_t *socket, int remote, __u32 *ip, int *port);
-int libcfs_sock_write(socket_t *sock, void *buffer, int nob, int timeout);
-int libcfs_sock_read(socket_t *sock, void *buffer, int nob, int timeout);
-void libcfs_sock_release(socket_t *sock);
+int libcfs_sock_setbuf(struct socket *socket, int txbufsize, int rxbufsize);
+int libcfs_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
+int libcfs_sock_getaddr(struct socket *socket, int remote, __u32 *ip, int *port);
+int libcfs_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
+int libcfs_sock_read(struct socket *sock, void *buffer, int nob, int timeout);
+void libcfs_sock_release(struct socket *sock);
/* need both kernel and user-land acceptor */
#define LNET_ACCEPTOR_MIN_RESERVED_PORT 512
@@ -155,20 +155,19 @@ unsigned int cfs_rand(void);
void cfs_srand(unsigned int, unsigned int);
void cfs_get_random_bytes(void *buf, int size);
-#include <linux/libcfs/libcfs_debug.h>
-#include <linux/libcfs/libcfs_cpu.h>
-#include <linux/libcfs/libcfs_private.h>
-#include <linux/libcfs/libcfs_ioctl.h>
-#include <linux/libcfs/libcfs_prim.h>
-#include <linux/libcfs/libcfs_time.h>
-#include <linux/libcfs/libcfs_string.h>
-#include <linux/libcfs/libcfs_kernelcomm.h>
-#include <linux/libcfs/libcfs_workitem.h>
-#include <linux/libcfs/libcfs_hash.h>
-#include <linux/libcfs/libcfs_heap.h>
-#include <linux/libcfs/libcfs_fail.h>
-#include <linux/libcfs/params_tree.h>
-#include <linux/libcfs/libcfs_crypto.h>
+#include "libcfs_debug.h"
+#include "libcfs_cpu.h"
+#include "libcfs_private.h"
+#include "libcfs_ioctl.h"
+#include "libcfs_prim.h"
+#include "libcfs_time.h"
+#include "libcfs_string.h"
+#include "libcfs_kernelcomm.h"
+#include "libcfs_workitem.h"
+#include "libcfs_hash.h"
+#include "libcfs_heap.h"
+#include "libcfs_fail.h"
+#include "libcfs_crypto.h"
/* container_of depends on "likely" which is defined in libcfs_private.h */
static inline void *__container_of(void *ptr, unsigned long shift)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index b270d84def98..30098f39181f 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -165,7 +165,7 @@ struct ptldebug_header {
#define CDEBUG_DEFAULT_MIN_DELAY ((cfs_time_seconds(1) + 1) / 2) /* jiffies */
#define CDEBUG_DEFAULT_BACKOFF 2
struct cfs_debug_limit_state {
- cfs_time_t cdls_next;
+ unsigned long cdls_next;
unsigned int cdls_delay;
int cdls_count;
};
@@ -254,19 +254,19 @@ do { \
goto label; \
} while (0)
-extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
+int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format1, ...)
__attribute__ ((format (printf, 2, 3)));
-extern int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
+int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
const char *format1,
va_list args, const char *format2, ...)
__attribute__ ((format (printf, 4, 5)));
/* other external symbols that tracefile provides: */
-extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
+int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
const char *usr_buffer, int usr_buffer_nob);
-extern int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
+int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
const char *knl_buffer, char *append);
#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
index 8393c2703ce6..1934ec20e536 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
@@ -153,6 +153,7 @@ static inline void cfs_race(__u32 id)
if (CFS_FAIL_PRECHECK(id)) {
if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) {
int rc;
+
cfs_race_state = 0;
CERROR("cfs_race id %x sleeping\n", id);
cfs_wait_event_interruptible(cfs_race_waitq,
@@ -165,6 +166,7 @@ static inline void cfs_race(__u32 id)
}
}
}
+
#define CFS_RACE(id) cfs_race(id)
#endif /* _LIBCFS_FAIL_H */
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 954164361ca4..375586bf7312 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -628,21 +628,21 @@ static inline int cfs_hash_bd_dec_and_lock(struct cfs_hash *hs, struct cfs_hash_
}
static inline struct hlist_head *cfs_hash_bd_hhead(struct cfs_hash *hs,
- struct cfs_hash_bd *bd)
+ struct cfs_hash_bd *bd)
{
return hs->hs_hops->hop_hhead(hs, bd);
}
struct hlist_node *cfs_hash_bd_lookup_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bd, const void *key);
+ struct cfs_hash_bd *bd, const void *key);
struct hlist_node *cfs_hash_bd_peek_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bd, const void *key);
+ struct cfs_hash_bd *bd, const void *key);
struct hlist_node *cfs_hash_bd_findadd_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bd, const void *key,
+ struct cfs_hash_bd *bd, const void *key,
struct hlist_node *hnode,
int insist_add);
struct hlist_node *cfs_hash_bd_finddel_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bd, const void *key,
+ struct cfs_hash_bd *bd, const void *key,
struct hlist_node *hnode);
/**
@@ -661,21 +661,21 @@ static inline void cfs_hash_dual_bd_get_and_lock(struct cfs_hash *hs, const void
}
struct hlist_node *cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bds,
+ struct cfs_hash_bd *bds,
const void *key);
struct hlist_node *cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bds,
+ struct cfs_hash_bd *bds,
const void *key,
struct hlist_node *hnode,
int insist_add);
struct hlist_node *cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs,
- struct cfs_hash_bd *bds,
+ struct cfs_hash_bd *bds,
const void *key,
struct hlist_node *hnode);
/* Hash init/cleanup functions */
struct cfs_hash *cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits,
- unsigned bkt_bits, unsigned extra_bytes,
+ unsigned bkt_bits, unsigned extra_bytes,
unsigned min_theta, unsigned max_theta,
cfs_hash_ops_t *ops, unsigned flags);
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index 49ba62a4daa8..87f2d901c7c1 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -41,7 +41,6 @@
#ifndef __LIBCFS_IOCTL_H__
#define __LIBCFS_IOCTL_H__
-
#define LIBCFS_IOCTL_VERSION 0x0001000a
struct libcfs_ioctl_data {
@@ -90,7 +89,6 @@ do { \
data.ioc_len = sizeof(data); \
} while (0)
-
struct libcfs_ioctl_handler {
struct list_head item;
int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_data *data);
@@ -102,11 +100,9 @@ struct libcfs_ioctl_handler {
/* .handle_ioctl = */ func \
}
-
/* FIXME check conflict with lustre_lib.h */
#define LIBCFS_IOC_DEBUG_MASK _IOWR('f', 250, long)
-
/* ioctls for manipulating snapshots 30- */
#define IOC_LIBCFS_TYPE 'e'
#define IOC_LIBCFS_MIN_NR 30
@@ -149,6 +145,7 @@ struct libcfs_ioctl_handler {
static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
{
int len = sizeof(*data);
+
len += cfs_size_round(data->ioc_inllen1);
len += cfs_size_round(data->ioc_inllen2);
return len;
@@ -157,64 +154,62 @@ static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data)
{
if (data->ioc_len > (1<<30)) {
- CERROR ("LIBCFS ioctl: ioc_len larger than 1<<30\n");
+ CERROR("LIBCFS ioctl: ioc_len larger than 1<<30\n");
return 1;
}
if (data->ioc_inllen1 > (1<<30)) {
- CERROR ("LIBCFS ioctl: ioc_inllen1 larger than 1<<30\n");
+ CERROR("LIBCFS ioctl: ioc_inllen1 larger than 1<<30\n");
return 1;
}
if (data->ioc_inllen2 > (1<<30)) {
- CERROR ("LIBCFS ioctl: ioc_inllen2 larger than 1<<30\n");
+ CERROR("LIBCFS ioctl: ioc_inllen2 larger than 1<<30\n");
return 1;
}
if (data->ioc_inlbuf1 && !data->ioc_inllen1) {
- CERROR ("LIBCFS ioctl: inlbuf1 pointer but 0 length\n");
+ CERROR("LIBCFS ioctl: inlbuf1 pointer but 0 length\n");
return 1;
}
if (data->ioc_inlbuf2 && !data->ioc_inllen2) {
- CERROR ("LIBCFS ioctl: inlbuf2 pointer but 0 length\n");
+ CERROR("LIBCFS ioctl: inlbuf2 pointer but 0 length\n");
return 1;
}
if (data->ioc_pbuf1 && !data->ioc_plen1) {
- CERROR ("LIBCFS ioctl: pbuf1 pointer but 0 length\n");
+ CERROR("LIBCFS ioctl: pbuf1 pointer but 0 length\n");
return 1;
}
if (data->ioc_pbuf2 && !data->ioc_plen2) {
- CERROR ("LIBCFS ioctl: pbuf2 pointer but 0 length\n");
+ CERROR("LIBCFS ioctl: pbuf2 pointer but 0 length\n");
return 1;
}
if (data->ioc_plen1 && !data->ioc_pbuf1) {
- CERROR ("LIBCFS ioctl: plen1 nonzero but no pbuf1 pointer\n");
+ CERROR("LIBCFS ioctl: plen1 nonzero but no pbuf1 pointer\n");
return 1;
}
if (data->ioc_plen2 && !data->ioc_pbuf2) {
- CERROR ("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n");
+ CERROR("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n");
return 1;
}
- if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len ) {
- CERROR ("LIBCFS ioctl: packlen != ioc_len\n");
+ if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len) {
+ CERROR("LIBCFS ioctl: packlen != ioc_len\n");
return 1;
}
if (data->ioc_inllen1 &&
data->ioc_bulk[data->ioc_inllen1 - 1] != '\0') {
- CERROR ("LIBCFS ioctl: inlbuf1 not 0 terminated\n");
+ CERROR("LIBCFS ioctl: inlbuf1 not 0 terminated\n");
return 1;
}
if (data->ioc_inllen2 &&
data->ioc_bulk[cfs_size_round(data->ioc_inllen1) +
data->ioc_inllen2 - 1] != '\0') {
- CERROR ("LIBCFS ioctl: inlbuf2 not 0 terminated\n");
+ CERROR("LIBCFS ioctl: inlbuf2 not 0 terminated\n");
return 1;
}
return 0;
}
-
int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_ioctl_getdata(char *buf, char *end, void *arg);
int libcfs_ioctl_popdata(void *arg, void *buf, int size);
-
#endif /* __LIBCFS_IOCTL_H__ */
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
index 037ae8a6d531..f19a121a37cd 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
@@ -47,7 +47,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
-
/* KUC message header.
* All current and future KUC messages should use this header.
* To avoid having to include Lustre headers from libcfs, define this here.
@@ -90,12 +89,12 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg);
#define KUC_GRP_MAX KUC_GRP_HSM
/* Kernel methods */
-extern int libcfs_kkuc_msg_put(struct file *fp, void *payload);
-extern int libcfs_kkuc_group_put(int group, void *payload);
-extern int libcfs_kkuc_group_add(struct file *fp, int uid, int group,
+int libcfs_kkuc_msg_put(struct file *fp, void *payload);
+int libcfs_kkuc_group_put(int group, void *payload);
+int libcfs_kkuc_group_add(struct file *fp, int uid, int group,
__u32 data);
-extern int libcfs_kkuc_group_rem(int uid, int group);
-extern int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
+int libcfs_kkuc_group_rem(int uid, int group);
+int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
void *cb_arg);
#define LK_FLG_STOP 0x01
@@ -111,9 +110,9 @@ typedef struct lustre_kernelcomm {
} __attribute__((packed)) lustre_kernelcomm;
/* Userspace methods */
-extern int libcfs_ukuc_start(lustre_kernelcomm *l, int groups);
-extern int libcfs_ukuc_stop(lustre_kernelcomm *l);
-extern int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize,
+int libcfs_ukuc_start(lustre_kernelcomm *l, int groups);
+int libcfs_ukuc_stop(lustre_kernelcomm *l);
+int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize,
int transport);
#endif /* __LIBCFS_KERNELCOMM_H__ */
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
index 7cf34aa78f79..a38209506d6c 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_prim.h
@@ -50,10 +50,10 @@ void add_wait_queue_exclusive_head(wait_queue_head_t *, wait_queue_t *);
void cfs_init_timer(struct timer_list *t);
void cfs_timer_init(struct timer_list *t, cfs_timer_func_t *func, void *arg);
void cfs_timer_done(struct timer_list *t);
-void cfs_timer_arm(struct timer_list *t, cfs_time_t deadline);
+void cfs_timer_arm(struct timer_list *t, unsigned long deadline);
void cfs_timer_disarm(struct timer_list *t);
int cfs_timer_is_armed(struct timer_list *t);
-cfs_time_t cfs_timer_deadline(struct timer_list *t);
+unsigned long cfs_timer_deadline(struct timer_list *t);
/*
* Memory
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index 740bfcd2f09a..82a269cee6dd 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -43,14 +43,13 @@
#define __LIBCFS_PRIVATE_H__
/* XXX this layering violation is for nidstrings */
-#include <linux/lnet/types.h>
+#include "../lnet/types.h"
#ifndef DEBUG_SUBSYSTEM
# define DEBUG_SUBSYSTEM S_UNDEFINED
#endif
-
/*
* When this is on, LASSERT macro includes check for assignment used instead
* of equality check, but doesn't have unlikely(). Turn this on from time to
@@ -58,7 +57,6 @@
*/
#define LASSERT_CHECKED (0)
-
#define LASSERTF(cond, fmt, ...) \
do { \
if (unlikely(!(cond))) { \
@@ -80,18 +78,18 @@ do { \
*/
# define LINVRNT(exp) LASSERT(exp)
#else
-# define LINVRNT(exp) ((void)sizeof!!(exp))
+# define LINVRNT(exp) ((void)sizeof !!(exp))
#endif
#define KLASSERT(e) LASSERT(e)
-void lbug_with_loc(struct libcfs_debug_msg_data *) __attribute__((noreturn));
+void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn));
#define LBUG() \
do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
lbug_with_loc(&msgdata); \
-} while(0)
+} while (0)
extern atomic_t libcfs_kmemory;
/*
@@ -111,7 +109,6 @@ do { \
# define libcfs_kmem_read() \
atomic_read(&libcfs_kmemory)
-
#ifndef LIBCFS_VMALLOC_SIZE
#define LIBCFS_VMALLOC_SIZE (2 << PAGE_CACHE_SHIFT) /* 2 pages */
#endif
@@ -220,7 +217,6 @@ int libcfs_debug_mark_buffer(const char *text);
void libcfs_debug_set_level(unsigned int debug_level);
-
/*
* allocate per-cpu-partition data, returned value is an array of pointers,
* variable can be indexed by CPU ID.
@@ -339,8 +335,8 @@ do { \
#define LASSERT_ATOMIC_ZERO(a) LASSERT_ATOMIC_EQ(a, 0)
#define LASSERT_ATOMIC_POS(a) LASSERT_ATOMIC_GT(a, 0)
-#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof (*(ptr)));
-#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof (*(ptr)));
+#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof(*(ptr)));
+#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof(*(ptr)));
/*
* percpu partition lock
@@ -363,7 +359,6 @@ enum {
CFS_PERCPT_LOCK_EX = -1, /* negative */
};
-
struct cfs_percpt_lock {
/* cpu-partition-table for this lock */
struct cfs_cpt_table *pcl_cptab;
@@ -380,7 +375,6 @@ cfs_percpt_lock_num(struct cfs_percpt_lock *pcl)
return cfs_cpt_number(pcl->pcl_cptab);
}
-
/*
* create a cpu-partition lock based on CPU partition table \a cptab,
* each private lock has extra \a psize bytes padding data
@@ -400,7 +394,6 @@ void cfs_percpt_atomic_free(atomic_t **refs);
/* return sum of all percpu refs */
int cfs_percpt_atomic_summary(atomic_t **refs);
-
/** Compile-time assertion.
* Check an invariant described by a constant expression at compile time by
@@ -415,7 +408,7 @@ int cfs_percpt_atomic_summary(atomic_t **refs);
* value after conversion...
*
*/
-#define CLASSERT(cond) do {switch(42) {case (cond): case 0: break;}} while (0)
+#define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)
/* support decl needed both by kernel and liblustre */
int libcfs_isknown_lnd(int type);
@@ -440,11 +433,11 @@ int cfs_match_nid(lnet_nid_t nid, struct list_head *list);
/** extract the network part of an lnet_nid_t */
#define LNET_NIDNET(nid) ((__u32)(((nid) >> 32)) & 0xffffffff)
/** make an lnet_nid_t from a network part and an address part */
-#define LNET_MKNID(net,addr) ((((__u64)(net))<<32)|((__u64)(addr)))
+#define LNET_MKNID(net, addr) ((((__u64)(net))<<32)|((__u64)(addr)))
/* how net encodes type:number */
#define LNET_NETNUM(net) ((net) & 0xffff)
#define LNET_NETTYP(net) (((net) >> 16) & 0xffff)
-#define LNET_MKNET(typ,num) ((((__u32)(typ))<<16)|((__u32)(num)))
+#define LNET_MKNET(typ, num) ((((__u32)(typ))<<16)|((__u32)(num)))
/** @} lnet_addr */
/* max value for numeric network address */
@@ -458,7 +451,6 @@ int cfs_match_nid(lnet_nid_t nid, struct list_head *list);
/* --------------------------------------------------------------------
* Light-weight trace
* Support for temporary event tracing with minimal Heisenberg effect.
- * All stuff about lwt are put in arch/kp30.h
* -------------------------------------------------------------------- */
struct libcfs_device_userstate
@@ -469,24 +461,25 @@ struct libcfs_device_userstate
/* what used to be in portals_lib.h */
#ifndef MIN
-# define MIN(a,b) (((a)<(b)) ? (a): (b))
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
-# define MAX(a,b) (((a)>(b)) ? (a): (b))
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
-#define MKSTR(ptr) ((ptr))? (ptr) : ""
+#define MKSTR(ptr) ((ptr)) ? (ptr) : ""
-static inline int cfs_size_round4 (int val)
+static inline int cfs_size_round4(int val)
{
return (val + 3) & (~0x3);
}
#ifndef HAVE_CFS_SIZE_ROUND
-static inline int cfs_size_round (int val)
+static inline int cfs_size_round(int val)
{
return (val + 7) & (~0x7);
}
+
#define HAVE_CFS_SIZE_ROUND
#endif
@@ -525,21 +518,21 @@ static inline unsigned int cfs_power2_roundup(unsigned int val)
return val;
}
-#define LOGL(var,len,ptr) \
+#define LOGL(var, len, ptr) \
do { \
if (var) \
memcpy((char *)ptr, (const char *)var, len); \
ptr += cfs_size_round(len); \
} while (0)
-#define LOGU(var,len,ptr) \
+#define LOGU(var, len, ptr) \
do { \
if (var) \
memcpy((char *)var, (const char *)ptr, len); \
ptr += cfs_size_round(len); \
} while (0)
-#define LOGL0(var,len,ptr) \
+#define LOGL0(var, len, ptr) \
do { \
if (!len) \
break; \
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
index 4bdd77163d5e..1344139c46c3 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_time.h
@@ -43,28 +43,27 @@
* generic time manipulation functions.
*/
-static inline cfs_time_t cfs_time_add(cfs_time_t t, cfs_duration_t d)
+static inline unsigned long cfs_time_add(unsigned long t, long d)
{
- return (cfs_time_t)(t + d);
+ return (unsigned long)(t + d);
}
-static inline cfs_duration_t cfs_time_sub(cfs_time_t t1, cfs_time_t t2)
+static inline unsigned long cfs_time_sub(unsigned long t1, unsigned long t2)
{
- return (cfs_time_t)(t1 - t2);
+ return (unsigned long)(t1 - t2);
}
-static inline int cfs_time_after(cfs_time_t t1, cfs_time_t t2)
+static inline int cfs_time_after(unsigned long t1, unsigned long t2)
{
- return cfs_time_before(t2, t1);
+ return time_before(t2, t1);
}
-static inline int cfs_time_aftereq(cfs_time_t t1, cfs_time_t t2)
+static inline int cfs_time_aftereq(unsigned long t1, unsigned long t2)
{
- return cfs_time_beforeq(t2, t1);
+ return time_before_eq(t2, t1);
}
-
-static inline cfs_time_t cfs_time_shift(int seconds)
+static inline unsigned long cfs_time_shift(int seconds)
{
return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds));
}
@@ -72,7 +71,7 @@ static inline cfs_time_t cfs_time_shift(int seconds)
static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small,
struct timeval *result)
{
- long r = (long) (
+ long r = (long)(
(large->tv_sec - small->tv_sec) * ONE_MILLION +
(large->tv_usec - small->tv_usec));
if (result != NULL) {
@@ -82,12 +81,12 @@ static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small,
return r;
}
-static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg)
+static inline void cfs_slow_warning(unsigned long now, int seconds, char *msg)
{
if (cfs_time_after(cfs_time_current(),
cfs_time_add(now, cfs_time_seconds(15))))
CERROR("slow %s "CFS_TIME_T" sec\n", msg,
- cfs_duration_sec(cfs_time_sub(cfs_time_current(),now)));
+ cfs_duration_sec(cfs_time_sub(cfs_time_current(), now)));
}
#define CFS_RATELIMIT(seconds) \
@@ -112,7 +111,7 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg)
*/
static inline void cfs_fs_timeval(struct timeval *tv)
{
- cfs_fs_time_t time;
+ struct timespec time;
cfs_fs_time_current(&time);
cfs_fs_time_usec(&time, tv);
@@ -122,7 +121,7 @@ static inline void cfs_fs_timeval(struct timeval *tv)
* return valid time-out based on user supplied one. Currently we only check
* that time-out is not shorted than allowed.
*/
-static inline cfs_duration_t cfs_timeout_cap(cfs_duration_t timeout)
+static inline long cfs_timeout_cap(long timeout)
{
if (timeout < CFS_TICK)
timeout = CFS_TICK;
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h b/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h
deleted file mode 100644
index a09fed3c6ea8..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/kp30.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LIBCFS_LINUX_KP30_H__
-#define __LIBCFS_LINUX_KP30_H__
-
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/errno.h>
-#include <linux/unistd.h>
-#include <linux/kmod.h>
-#include <linux/notifier.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/vmalloc.h>
-#include <linux/time.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/highmem.h>
-#include <linux/module.h>
-#include <asm/atomic.h>
-#include <asm/uaccess.h>
-#include <linux/rwsem.h>
-#include <linux/proc_fs.h>
-#include <linux/file.h>
-#include <linux/smp.h>
-#include <linux/ctype.h>
-#include <linux/compiler.h>
-#include <linux/mm_inline.h>
-#include <linux/kallsyms.h>
-#include <linux/moduleparam.h>
-#include <linux/scatterlist.h>
-
-#include <linux/libcfs/linux/portals_compat25.h>
-
-/* this is a bit chunky */
-
-# define LPU64 "%llu"
-# define LPD64 "%lld"
-# define LPX64 "%#llx"
-# define LPX64i "%llx"
-# define LPO64 "%#llo"
-# define LPF64 "L"
-
-/*
- * long_ptr_t & ulong_ptr_t, same to "long" for gcc
- */
-# define LPLU "%lu"
-# define LPLD "%ld"
-# define LPLX "%#lx"
-
-/*
- * pid_t
- */
-# define LPPID "%d"
-
-#endif
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
index a7bca40e9fb7..ccc55fc41a9e 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
@@ -42,28 +42,57 @@
#endif
-
-#include <stdarg.h>
-#include <linux/libcfs/linux/linux-cpu.h>
-#include <linux/libcfs/linux/linux-time.h>
-#include <linux/libcfs/linux/linux-mem.h>
-#include <linux/libcfs/linux/linux-prim.h>
-#include <linux/libcfs/linux/linux-lock.h>
-#include <linux/libcfs/linux/linux-tcpip.h>
-#include <linux/libcfs/linux/linux-bitops.h>
-#include <linux/libcfs/linux/linux-types.h>
-#include <linux/libcfs/linux/kp30.h>
-
-#include <asm/types.h>
+#include <linux/bitops.h>
+#include <linux/compiler.h>
+#include <linux/ctype.h>
+#include <linux/errno.h>
+#include <linux/file.h>
+#include <linux/fs.h>
+#include <linux/highmem.h>
+#include <linux/interrupt.h>
+#include <linux/kallsyms.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+#include <linux/kthread.h>
+#include <linux/miscdevice.h>
+#include <linux/mm.h>
+#include <linux/mm_inline.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/mutex.h>
+#include <linux/notifier.h>
+#include <linux/proc_fs.h>
+#include <linux/random.h>
+#include <linux/rbtree.h>
+#include <linux/rwsem.h>
+#include <linux/scatterlist.h>
+#include <linux/sched.h>
+#include <linux/signal.h>
+#include <linux/slab.h>
+#include <linux/smp.h>
+#include <linux/stat.h>
+#include <linux/string.h>
+#include <linux/time.h>
+#include <linux/timer.h>
#include <linux/types.h>
+#include <linux/unistd.h>
+#include <linux/vmalloc.h>
+#include <net/sock.h>
+#include <asm/atomic.h>
+#include <asm/div64.h>
#include <asm/timex.h>
-#include <linux/sched.h> /* THREAD_SIZE */
-#include <linux/rbtree.h>
+#include <asm/uaccess.h>
+#include <stdarg.h>
+#include "linux-cpu.h"
+#include "linux-time.h"
+#include "linux-mem.h"
+#include "portals_compat25.h"
+
#define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5)
#if !defined(__x86_64__)
-# ifdef __ia64__
+# ifdef __ia64__
# define CDEBUG_STACK() (THREAD_SIZE - \
((unsigned long)__builtin_dwarf_cfa() & \
(THREAD_SIZE - 1)))
@@ -89,7 +118,7 @@ do { \
} while (0)
#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls)
#else /* __x86_64__ */
-#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0)
+#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while (0)
#define CDEBUG_STACK() (0L)
#endif /* __x86_64__ */
@@ -103,7 +132,7 @@ do { \
*
* Implementation is in linux-curproc.c
*/
-#define CFS_CURPROC_COMM_MAX (sizeof ((struct task_struct *)0)->comm)
+#define CFS_CURPROC_COMM_MAX (sizeof((struct task_struct *)0)->comm)
#include <linux/capability.h>
@@ -116,6 +145,4 @@ typedef long long_ptr_t;
#endif
-
-
#endif /* _LINUX_LIBCFS_H */
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-bitops.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-bitops.h
deleted file mode 100644
index 43936e349dd4..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-bitops.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/linux/linux-bitops.h
- */
-#include <linux/bitops.h>
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
index 8dd354d51606..520209f17173 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-cpu.h
@@ -42,7 +42,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
-
#include <linux/cpu.h>
#include <linux/cpuset.h>
#include <linux/topology.h>
@@ -79,88 +78,5 @@ struct cfs_cpt_table {
nodemask_t *ctb_nodemask;
};
-/**
- * comment out definitions for compatible layer
- *
- * typedef cpumask_t cfs_cpumask_t;
- *
- * #define cfs_cpu_current() smp_processor_id()
- * #define cfs_cpu_online(i) cpu_online(i)
- * #define cfs_cpu_online_num() num_online_cpus()
- * #define cfs_cpu_online_for_each(i) for_each_online_cpu(i)
- * #define cfs_cpu_possible_num() num_possible_cpus()
- * #define cfs_cpu_possible_for_each(i) for_each_possible_cpu(i)
- *
- * #ifdef CONFIG_CPUMASK_SIZE
- * #define cfs_cpu_mask_size() cpumask_size()
- * #else
- * #define cfs_cpu_mask_size() sizeof(cfs_cpumask_t)
- * #endif
- *
- * #define cfs_cpu_mask_set(i, mask) cpu_set(i, mask)
- * #define cfs_cpu_mask_unset(i, mask) cpu_clear(i, mask)
- * #define cfs_cpu_mask_isset(i, mask) cpu_isset(i, mask)
- * #define cfs_cpu_mask_clear(mask) cpus_clear(mask)
- * #define cfs_cpu_mask_empty(mask) cpus_empty(mask)
- * #define cfs_cpu_mask_weight(mask) cpus_weight(mask)
- * #define cfs_cpu_mask_first(mask) first_cpu(mask)
- * #define cfs_cpu_mask_any_online(mask) (any_online_cpu(mask) != NR_CPUS)
- * #define cfs_cpu_mask_for_each(i, mask) for_each_cpu_mask(i, mask)
- * #define cfs_cpu_mask_bind(t, mask) set_cpus_allowed(t, mask)
- *
- * #ifdef HAVE_CPUMASK_COPY
- * #define cfs_cpu_mask_copy(dst, src) cpumask_copy(dst, src)
- * #else
- * #define cfs_cpu_mask_copy(dst, src) memcpy(dst, src, sizeof(*src))
- * #endif
- *
- * static inline void
- * cfs_cpu_mask_of_online(cfs_cpumask_t *mask)
- * {
- * cfs_cpu_mask_copy(mask, &cpu_online_map);
- * }
- *
- * #ifdef CONFIG_NUMA
- *
- * #define CFS_NODE_NR MAX_NUMNODES
- *
- * typedef nodemask_t cfs_node_mask_t;
- *
- * #define cfs_node_of_cpu(cpu) cpu_to_node(cpu)
- * #define cfs_node_online(i) node_online(i)
- * #define cfs_node_online_num() num_online_nodes()
- * #define cfs_node_online_for_each(i) for_each_online_node(i)
- * #define cfs_node_possible_num() num_possible_nodes()
- * #define cfs_node_possible_for_each(i) for_each_node(i)
- *
- * static inline void cfs_node_to_cpumask(int node, cfs_cpumask_t *mask)
- * {
- * #if defined(HAVE_NODE_TO_CPUMASK)
- * *mask = node_to_cpumask(node);
- * #elif defined(HAVE_CPUMASK_OF_NODE)
- * cfs_cpu_mask_copy(mask, cpumask_of_node(node));
- * #else
- * # error "Needs node_to_cpumask or cpumask_of_node"
- * #endif
- * }
- *
- * #define cfs_node_mask_set(i, mask) node_set(i, mask)
- * #define cfs_node_mask_unset(i, mask) node_clear(i, mask)
- * #define cfs_node_mask_isset(i, mask) node_isset(i, mask)
- * #define cfs_node_mask_clear(mask) nodes_reset(mask)
- * #define cfs_node_mask_empty(mask) nodes_empty(mask)
- * #define cfs_node_mask_weight(mask) nodes_weight(mask)
- * #define cfs_node_mask_for_each(i, mask) for_each_node_mask(i, mask)
- * #define cfs_node_mask_copy(dst, src) memcpy(dst, src, sizeof(*src))
- *
- * static inline void
- * cfs_node_mask_of_online(cfs_node_mask_t *mask)
- * {
- * cfs_node_mask_copy(mask, &node_online_map);
- * }
- *
- * #endif
- */
-
#endif /* CONFIG_SMP */
#endif /* __LIBCFS_LINUX_CPU_H__ */
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-crypto.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-crypto.h
deleted file mode 100644
index 97c771cf691f..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-crypto.h
+++ /dev/null
@@ -1,49 +0,0 @@
- /*
- * 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 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 http://www.gnu.org/licenses
- *
- * Please visit http://www.xyratex.com/contact if you need additional
- * information or have any questions.
- *
- * GPL HEADER END
- */
-
-/*
- * Copyright 2012 Xyratex Technology Limited
- */
-
-/**
- * Linux crypto hash specific functions.
- */
-
-/**
- * Functions for start/stop shash CRC32 algorithm.
- */
-int cfs_crypto_crc32_register(void);
-void cfs_crypto_crc32_unregister(void);
-
-/**
- * Functions for start/stop shash adler32 algorithm.
- */
-int cfs_crypto_adler32_register(void);
-void cfs_crypto_adler32_unregister(void);
-
-/**
- * Functions for start/stop shash crc32 pclmulqdq
- */
-int cfs_crypto_crc32_pclmul_register(void);
-void cfs_crypto_crc32_pclmul_unregister(void);
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h
deleted file mode 100644
index b75e401d9a97..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-lock.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/linux/linux-lock.h
- *
- * Basic library routines.
- */
-
-#ifndef __LIBCFS_LINUX_CFS_LOCK_H__
-#define __LIBCFS_LINUX_CFS_LOCK_H__
-
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
-#endif
-
-
-#include <linux/mutex.h>
-
-/*
- * IMPORTANT !!!!!!!!
- *
- * All locks' declaration are not guaranteed to be initialized,
- * although some of them are initialized in Linux. All locks
- * declared by CFS_DECL_* should be initialized explicitly.
- */
-
-/*
- * spin_lock "implementation" (use Linux kernel's primitives)
- *
- * - spin_lock_init(x)
- * - spin_lock(x)
- * - spin_lock_bh(x)
- * - spin_lock_bh_init(x)
- * - spin_unlock(x)
- * - spin_unlock_bh(x)
- * - spin_trylock(x)
- * - assert_spin_locked(x)
- *
- * - spin_lock_irq(x)
- * - spin_lock_irqsave(x, f)
- * - spin_unlock_irqrestore(x, f)
- * - read_lock_irqsave(lock, f)
- * - write_lock_irqsave(lock, f)
- * - write_unlock_irqrestore(lock, f)
- */
-
-/*
- * spinlock "implementation"
- */
-
-
-
-
-/*
- * rw_semaphore "implementation" (use Linux kernel's primitives)
- *
- * - sema_init(x)
- * - init_rwsem(x)
- * - down_read(x)
- * - up_read(x)
- * - down_write(x)
- * - up_write(x)
- */
-
-
-#define fini_rwsem(s) do {} while (0)
-
-
-/*
- * rwlock_t "implementation" (use Linux kernel's primitives)
- *
- * - rwlock_init(x)
- * - read_lock(x)
- * - read_unlock(x)
- * - write_lock(x)
- * - write_unlock(x)
- * - write_lock_bh(x)
- * - write_unlock_bh(x)
- *
- * - RW_LOCK_UNLOCKED
- */
-
-
-#ifndef DEFINE_RWLOCK
-#define DEFINE_RWLOCK(lock) rwlock_t lock = __RW_LOCK_UNLOCKED(lock)
-#endif
-
-/*
- * completion "implementation" (use Linux kernel's primitives)
- *
- * - DECLARE_COMPLETION(work)
- * - INIT_COMPLETION(c)
- * - COMPLETION_INITIALIZER(work)
- * - init_completion(c)
- * - complete(c)
- * - wait_for_completion(c)
- * - wait_for_completion_interruptible(c)
- * - fini_completion(c)
- */
-#define fini_completion(c) do { } while (0)
-
-/*
- * semaphore "implementation" (use Linux kernel's primitives)
- * - DEFINE_SEMAPHORE(name)
- * - sema_init(sem, val)
- * - up(sem)
- * - down(sem)
- * - down_interruptible(sem)
- * - down_trylock(sem)
- */
-
-/*
- * mutex "implementation" (use Linux kernel's primitives)
- *
- * - DEFINE_MUTEX(name)
- * - mutex_init(x)
- * - mutex_lock(x)
- * - mutex_unlock(x)
- * - mutex_trylock(x)
- * - mutex_is_locked(x)
- * - mutex_destroy(x)
- */
-
-#ifndef lockdep_set_class
-
-/**************************************************************************
- *
- * Lockdep "implementation". Also see liblustre.h
- *
- **************************************************************************/
-
-struct lock_class_key {
- ;
-};
-
-#define lockdep_set_class(lock, key) \
- do { (void)sizeof(lock); (void)sizeof(key); } while (0)
-/* This has to be a macro, so that `subclass' can be undefined in kernels
- * that do not support lockdep. */
-
-
-static inline void lockdep_off(void)
-{
-}
-
-static inline void lockdep_on(void)
-{
-}
-#else
-
-#endif /* lockdep_set_class */
-
-#ifndef CONFIG_DEBUG_LOCK_ALLOC
-#ifndef mutex_lock_nested
-#define mutex_lock_nested(mutex, subclass) mutex_lock(mutex)
-#endif
-
-#ifndef spin_lock_nested
-#define spin_lock_nested(lock, subclass) spin_lock(lock)
-#endif
-
-#ifndef down_read_nested
-#define down_read_nested(lock, subclass) down_read(lock)
-#endif
-
-#ifndef down_write_nested
-#define down_write_nested(lock, subclass) down_write(lock)
-#endif
-#endif /* CONFIG_DEBUG_LOCK_ALLOC */
-
-
-#endif /* __LIBCFS_LINUX_CFS_LOCK_H__ */
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h
index ccee5c3e4142..0f2fd79e5ec8 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h
@@ -45,7 +45,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
-
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
@@ -55,7 +54,7 @@
#ifndef HAVE_LIBCFS_CPT
/* Need this for cfs_cpt_table */
-#include <linux/libcfs/libcfs_cpu.h>
+#include "../libcfs_cpu.h"
#endif
#define CFS_PAGE_MASK (~((__u64)PAGE_CACHE_SIZE-1))
@@ -73,15 +72,9 @@
#define NUM_CACHEPAGES totalram_pages
#endif
-/*
- * In Linux there is no way to determine whether current execution context is
- * blockable.
- */
-#define ALLOC_ATOMIC_TRY GFP_ATOMIC
-
#define DECL_MMSPACE mm_segment_t __oldfs
#define MMSPACE_OPEN \
- do { __oldfs = get_fs(); set_fs(get_ds());} while(0)
+ do { __oldfs = get_fs(); set_fs(get_ds()); } while (0)
#define MMSPACE_CLOSE set_fs(__oldfs)
#endif /* __LINUX_CFS_MEM_H__ */
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h
deleted file mode 100644
index 2aeff27b1641..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-prim.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/linux/linux-prim.h
- *
- * Basic library routines.
- */
-
-#ifndef __LIBCFS_LINUX_CFS_PRIM_H__
-#define __LIBCFS_LINUX_CFS_PRIM_H__
-
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
-#endif
-
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/proc_fs.h>
-#include <linux/mm.h>
-#include <linux/timer.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/kthread.h>
-#include <linux/random.h>
-
-#include <linux/miscdevice.h>
-#include <linux/libcfs/linux/portals_compat25.h>
-#include <asm/div64.h>
-
-#include <linux/libcfs/linux/linux-time.h>
-
-/*
- * Sysctl register
- */
-typedef struct ctl_table ctl_table_t;
-typedef struct ctl_table_header ctl_table_header_t;
-
-#define DECLARE_PROC_HANDLER(name) \
-static int \
-LL_PROC_PROTO(name) \
-{ \
- DECLARE_LL_PROC_PPOS_DECL; \
- \
- return proc_call_handler(table->data, write, \
- ppos, buffer, lenp, \
- __##name); \
-}
-
-#endif
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h
deleted file mode 100644
index 7a8d006903b9..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-tcpip.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/linux/linux-tcpip.h
- *
- * Basic library routines.
- */
-
-#ifndef __LIBCFS_LINUX_CFS_TCP_H__
-#define __LIBCFS_LINUX_CFS_TCP_H__
-
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
-#endif
-
-
-#include <net/sock.h>
-
-typedef struct socket socket_t;
-
-#define SOCK_SNDBUF(so) ((so)->sk->sk_sndbuf)
-#define SOCK_TEST_NOSPACE(so) test_bit(SOCK_NOSPACE, &(so)->flags)
-
-static inline int
-cfs_sock_error(struct socket *sock)
-{
- return sock->sk->sk_err;
-}
-
-static inline int
-cfs_sock_wmem_queued(struct socket *sock)
-{
- return sock->sk->sk_wmem_queued;
-}
-
-#define cfs_sk_sleep(sk) sk_sleep(sk)
-
-#define DEFAULT_NET (&init_net)
-
-#endif
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
index a386d1b1286b..1158a3112bcc 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/linux-time.h
@@ -45,56 +45,15 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
-
-/* Portable time API */
-
-/*
- * Platform provides three opaque data-types:
- *
- * cfs_time_t represents point in time. This is internal kernel
- * time rather than "wall clock". This time bears no
- * relation to gettimeofday().
- *
- * cfs_duration_t represents time interval with resolution of internal
- * platform clock
- *
- * cfs_fs_time_t represents instance in world-visible time. This is
- * used in file-system time-stamps
- *
- * cfs_time_t cfs_time_current(void);
- * cfs_time_t cfs_time_add (cfs_time_t, cfs_duration_t);
- * cfs_duration_t cfs_time_sub (cfs_time_t, cfs_time_t);
- * int cfs_impl_time_before (cfs_time_t, cfs_time_t);
- * int cfs_impl_time_before_eq(cfs_time_t, cfs_time_t);
- *
- * cfs_duration_t cfs_duration_build(int64_t);
- *
- * time_t cfs_duration_sec (cfs_duration_t);
- * void cfs_duration_usec(cfs_duration_t, struct timeval *);
- * void cfs_duration_nsec(cfs_duration_t, struct timespec *);
- *
- * void cfs_fs_time_current(cfs_fs_time_t *);
- * time_t cfs_fs_time_sec (cfs_fs_time_t *);
- * void cfs_fs_time_usec (cfs_fs_time_t *, struct timeval *);
- * void cfs_fs_time_nsec (cfs_fs_time_t *, struct timespec *);
- * int cfs_fs_time_before (cfs_fs_time_t *, cfs_fs_time_t *);
- * int cfs_fs_time_beforeq(cfs_fs_time_t *, cfs_fs_time_t *);
- *
- * CFS_TIME_FORMAT
- * CFS_DURATION_FORMAT
- *
- */
-
#define ONE_BILLION ((u_int64_t)1000000000)
#define ONE_MILLION 1000000
-
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/time.h>
#include <asm/div64.h>
-#include <linux/libcfs/linux/portals_compat25.h>
+#include "portals_compat25.h"
/*
* post 2.5 kernels.
@@ -102,133 +61,58 @@
#include <linux/jiffies.h>
-typedef struct timespec cfs_fs_time_t;
-static inline void cfs_fs_time_usec(cfs_fs_time_t *t, struct timeval *v)
+static inline void cfs_fs_time_usec(struct timespec *t, struct timeval *v)
{
v->tv_sec = t->tv_sec;
v->tv_usec = t->tv_nsec / 1000;
}
-static inline void cfs_fs_time_nsec(cfs_fs_time_t *t, struct timespec *s)
-{
- *s = *t;
-}
-
-/*
- * internal helper function used by cfs_fs_time_before*()
- */
-static inline unsigned long long __cfs_fs_time_flat(cfs_fs_time_t *t)
-{
- return (unsigned long long)t->tv_sec * ONE_BILLION + t->tv_nsec;
-}
-
-
/*
* Generic kernel stuff
*/
-typedef unsigned long cfs_time_t; /* jiffies */
-typedef long cfs_duration_t;
-typedef cycles_t cfs_cycles_t;
-
-static inline int cfs_time_before(cfs_time_t t1, cfs_time_t t2)
-{
- return time_before(t1, t2);
-}
-
-static inline int cfs_time_beforeq(cfs_time_t t1, cfs_time_t t2)
-{
- return time_before_eq(t1, t2);
-}
-
-static inline cfs_time_t cfs_time_current(void)
+static inline unsigned long cfs_time_current(void)
{
return jiffies;
}
-static inline time_t cfs_time_current_sec(void)
-{
- return get_seconds();
-}
-
-static inline void cfs_fs_time_current(cfs_fs_time_t *t)
+static inline void cfs_fs_time_current(struct timespec *t)
{
*t = CURRENT_TIME;
}
-static inline time_t cfs_fs_time_sec(cfs_fs_time_t *t)
+static inline time_t cfs_fs_time_sec(struct timespec *t)
{
return t->tv_sec;
}
-static inline int cfs_fs_time_before(cfs_fs_time_t *t1, cfs_fs_time_t *t2)
-{
- return __cfs_fs_time_flat(t1) < __cfs_fs_time_flat(t2);
-}
-
-static inline int cfs_fs_time_beforeq(cfs_fs_time_t *t1, cfs_fs_time_t *t2)
-{
- return __cfs_fs_time_flat(t1) <= __cfs_fs_time_flat(t2);
-}
-
-#if 0
-static inline cfs_duration_t cfs_duration_build(int64_t nano)
-{
-#if (BITS_PER_LONG == 32)
- /* We cannot use do_div(t, ONE_BILLION), do_div can only process
- * 64 bits n and 32 bits base */
- int64_t t = nano * HZ;
- do_div(t, 1000);
- do_div(t, 1000000);
- return (cfs_duration_t)t;
-#else
- return (nano * HZ / ONE_BILLION);
-#endif
-}
-#endif
-
-static inline cfs_duration_t cfs_time_seconds(int seconds)
+static inline long cfs_time_seconds(int seconds)
{
- return ((cfs_duration_t)seconds) * HZ;
+ return ((long)seconds) * HZ;
}
-static inline time_t cfs_duration_sec(cfs_duration_t d)
+static inline time_t cfs_duration_sec(long d)
{
return d / HZ;
}
-static inline void cfs_duration_usec(cfs_duration_t d, struct timeval *s)
+static inline void cfs_duration_usec(long d, struct timeval *s)
{
#if (BITS_PER_LONG == 32) && (HZ > 4096)
__u64 t;
s->tv_sec = d / HZ;
- t = (d - (cfs_duration_t)s->tv_sec * HZ) * ONE_MILLION;
+ t = (d - (long)s->tv_sec * HZ) * ONE_MILLION;
do_div(t, HZ);
s->tv_usec = t;
#else
s->tv_sec = d / HZ;
- s->tv_usec = ((d - (cfs_duration_t)s->tv_sec * HZ) * \
+ s->tv_usec = ((d - (long)s->tv_sec * HZ) * \
ONE_MILLION) / HZ;
#endif
}
-static inline void cfs_duration_nsec(cfs_duration_t d, struct timespec *s)
-{
-#if (BITS_PER_LONG == 32)
- __u64 t;
-
- s->tv_sec = d / HZ;
- t = (d - s->tv_sec * HZ) * ONE_BILLION;
- do_div(t, HZ);
- s->tv_nsec = t;
-#else
- s->tv_sec = d / HZ;
- s->tv_nsec = ((d - s->tv_sec * HZ) * ONE_BILLION) / HZ;
-#endif
-}
-
#define cfs_time_current_64 get_jiffies_64
static inline __u64 cfs_time_add_64(__u64 t, __u64 d)
@@ -252,7 +136,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2)
return (__s64)t2 - (__s64)t1 >= 0;
}
-
/*
* One jiffy
*/
@@ -261,14 +144,4 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2)
#define CFS_TIME_T "%lu"
#define CFS_DURATION_T "%ld"
-
#endif /* __LIBCFS_LINUX_LINUX_TIME_H__ */
-/*
- * Local variables:
- * c-indentation-style: "K&R"
- * c-basic-offset: 8
- * tab-width: 8
- * fill-column: 80
- * scroll-step: 1
- * End:
- */
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/linux-types.h b/drivers/staging/lustre/include/linux/libcfs/linux/linux-types.h
deleted file mode 100644
index 142394925567..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/linux/linux-types.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * libcfs/include/libcfs/user-bitops.h
- */
-#include <linux/types.h>
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h
index fe4c63fb40a4..442d61be1c18 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/portals_compat25.h
@@ -37,14 +37,14 @@
#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
+/* 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
+/* 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)
@@ -78,22 +78,4 @@
#define __cfs_fls __fls
#endif
-#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(ctl_table_t *table, int write, \
- void __user *buffer, size_t *lenp, loff_t *ppos)
-#define DECLARE_LL_PROC_PPOS_DECL
-
-/* helper for sysctl handlers */
-int proc_call_handler(void *data, int write,
- loff_t *ppos, void *buffer, size_t *lenp,
- int (*handler)(void *data, int write,
- loff_t pos, void *buffer, int len));
-
#endif /* _PORTALS_COMPAT_H */
diff --git a/drivers/staging/lustre/include/linux/libcfs/lucache.h b/drivers/staging/lustre/include/linux/libcfs/lucache.h
index 9668b397f0f6..5d6e1b9de206 100644
--- a/drivers/staging/lustre/include/linux/libcfs/lucache.h
+++ b/drivers/staging/lustre/include/linux/libcfs/lucache.h
@@ -37,7 +37,7 @@
#ifndef _LUCACHE_H
#define _LUCACHE_H
-#include <linux/libcfs/libcfs.h>
+#include "libcfs.h"
/** \defgroup ucache ucache
*
@@ -88,8 +88,8 @@ struct upcall_cache_entry {
atomic_t ue_refcount;
int ue_flags;
wait_queue_head_t ue_waitq;
- cfs_time_t ue_acquire_expire;
- cfs_time_t ue_expire;
+ unsigned long ue_acquire_expire;
+ unsigned long ue_expire;
union {
struct md_identity identity;
} u;
@@ -104,17 +104,17 @@ struct upcall_cache;
struct upcall_cache_ops {
void (*init_entry)(struct upcall_cache_entry *, void *args);
void (*free_entry)(struct upcall_cache *,
- struct upcall_cache_entry *);
+ struct upcall_cache_entry *);
int (*upcall_compare)(struct upcall_cache *,
- struct upcall_cache_entry *,
+ struct upcall_cache_entry *,
__u64 key, void *args);
int (*downcall_compare)(struct upcall_cache *,
- struct upcall_cache_entry *,
+ struct upcall_cache_entry *,
__u64 key, void *args);
int (*do_upcall)(struct upcall_cache *,
- struct upcall_cache_entry *);
+ struct upcall_cache_entry *);
int (*parse_downcall)(struct upcall_cache *,
- struct upcall_cache_entry *, void *);
+ struct upcall_cache_entry *, void *);
};
struct upcall_cache {
diff --git a/drivers/staging/lustre/include/linux/libcfs/params_tree.h b/drivers/staging/lustre/include/linux/libcfs/params_tree.h
deleted file mode 100644
index 78a2c4ed4d6c..000000000000
--- a/drivers/staging/lustre/include/linux/libcfs/params_tree.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * 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 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
- * 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
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * API and structure definitions for params_tree.
- *
- * Author: LiuYing <emoly.liu@oracle.com>
- */
-#ifndef __PARAMS_TREE_H__
-#define __PARAMS_TREE_H__
-
-#include <linux/libcfs/libcfs.h>
-
-#undef LPROCFS
-#if defined(CONFIG_PROC_FS)
-# define LPROCFS
-#endif
-
-#ifdef LPROCFS
-typedef struct file cfs_param_file_t;
-typedef struct inode cfs_inode_t;
-typedef struct proc_inode cfs_proc_inode_t;
-typedef struct seq_file cfs_seq_file_t;
-typedef struct seq_operations cfs_seq_ops_t;
-typedef struct file_operations cfs_param_file_ops_t;
-typedef struct proc_dir_entry cfs_param_dentry_t;
-typedef struct poll_table_struct cfs_poll_table_t;
-#define CFS_PARAM_MODULE THIS_MODULE
-#define cfs_file_private(file) (file->private_data)
-#define cfs_dentry_data(dentry) (dentry->data)
-#define cfs_proc_inode_pde(proc_inode) (proc_inode->pde)
-#define cfs_proc_inode(proc_inode) (proc_inode->vfs_inode)
-#define cfs_seq_read_common seq_read
-#define cfs_seq_lseek_common seq_lseek
-#define cfs_seq_private(seq) (seq->private)
-#define cfs_seq_printf(seq, format, ...) seq_printf(seq, format, \
- ## __VA_ARGS__)
-#define cfs_seq_release(inode, file) seq_release(inode, file)
-#define cfs_seq_puts(seq, s) seq_puts(seq, s)
-#define cfs_seq_putc(seq, s) seq_putc(seq, s)
-#define cfs_seq_read(file, buf, count, ppos, rc) (rc = seq_read(file, buf, \
- count, ppos))
-#define cfs_seq_open(file, ops, rc) (rc = seq_open(file, ops))
-
-#else /* !LPROCFS */
-
-typedef struct cfs_params_file {
- void *param_private;
- loff_t param_pos;
- unsigned int param_flags;
-} cfs_param_file_t;
-
-typedef struct cfs_param_inode {
- void *param_private;
-} cfs_inode_t;
-
-typedef struct cfs_param_dentry {
- void *param_data;
-} cfs_param_dentry_t;
-
-typedef struct cfs_proc_inode {
- cfs_param_dentry_t *param_pde;
- cfs_inode_t param_inode;
-} cfs_proc_inode_t;
-
-struct cfs_seq_operations;
-typedef struct cfs_seq_file {
- char *buf;
- size_t size;
- size_t from;
- size_t count;
- loff_t index;
- loff_t version;
- struct mutex lock;
- struct cfs_seq_operations *op;
- void *private;
-} cfs_seq_file_t;
-
-typedef struct cfs_seq_operations {
- void *(*start) (cfs_seq_file_t *m, loff_t *pos);
- void (*stop) (cfs_seq_file_t *m, void *v);
- void *(*next) (cfs_seq_file_t *m, void *v, loff_t *pos);
- int (*show) (cfs_seq_file_t *m, void *v);
-} cfs_seq_ops_t;
-
-typedef void *cfs_poll_table_t;
-
-typedef struct cfs_param_file_ops {
- struct module *owner;
- int (*open) (cfs_inode_t *, struct file *);
- loff_t (*llseek)(struct file *, loff_t, int);
- int (*release) (cfs_inode_t *, cfs_param_file_t *);
- unsigned int (*poll) (struct file *, cfs_poll_table_t *);
- ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
- ssize_t (*read)(struct file *, char *, size_t, loff_t *);
-} cfs_param_file_ops_t;
-typedef cfs_param_file_ops_t *cfs_lproc_filep_t;
-
-static inline cfs_proc_inode_t *FAKE_PROC_I(const cfs_inode_t *inode)
-{
- return container_of(inode, cfs_proc_inode_t, param_inode);
-}
-
-#define CFS_PARAM_MODULE NULL
-#define cfs_file_private(file) (file->param_private)
-#define cfs_dentry_data(dentry) (dentry->param_data)
-#define cfs_proc_inode(proc_inode) (proc_inode->param_inode)
-#define cfs_proc_inode_pde(proc_inode) (proc_inode->param_pde)
-#define cfs_seq_read_common NULL
-#define cfs_seq_lseek_common NULL
-#define cfs_seq_private(seq) (seq->private)
-#define cfs_seq_read(file, buf, count, ppos, rc) do {} while(0)
-#define cfs_seq_open(file, ops, rc) \
-do { \
- cfs_seq_file_t *p = cfs_file_private(file); \
- if (!p) { \
- LIBCFS_ALLOC(p, sizeof(*p)); \
- if (!p) { \
- rc = -ENOMEM; \
- break; \
- } \
- cfs_file_private(file) = p; \
- } \
- memset(p, 0, sizeof(*p)); \
- p->op = ops; \
- rc = 0; \
-} while(0)
-
-#endif /* LPROCFS */
-
-/* XXX: params_tree APIs */
-
-#endif /* __PARAMS_TREE_H__ */
diff --git a/drivers/staging/lustre/include/linux/lnet/api-support.h b/drivers/staging/lustre/include/linux/lnet/api-support.h
index a8d91dbe6060..8f7fa28b517c 100644
--- a/drivers/staging/lustre/include/linux/lnet/api-support.h
+++ b/drivers/staging/lustre/include/linux/lnet/api-support.h
@@ -35,10 +35,10 @@
#ifndef __LNET_API_SUPPORT_H__
#define __LNET_API_SUPPORT_H__
-#include <linux/lnet/linux/api-support.h>
+#include "linux/api-support.h"
-#include <linux/libcfs/libcfs.h>
-#include <linux/lnet/types.h>
-#include <linux/lnet/lnet.h>
+#include "../libcfs/libcfs.h"
+#include "types.h"
+#include "lnet.h"
#endif
diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h
index e8642e33860d..cd865175703f 100644
--- a/drivers/staging/lustre/include/linux/lnet/api.h
+++ b/drivers/staging/lustre/include/linux/lnet/api.h
@@ -47,7 +47,7 @@
* @{
*/
-#include <linux/lnet/types.h>
+#include "../lnet/types.h"
/** \defgroup lnet_init_fini Initialization and cleanup
* The LNet must be properly initialized before any LNet calls can be made.
@@ -84,7 +84,6 @@ void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle);
/** @} lnet_addr */
-
/** \defgroup lnet_me Match entries
*
* A match entry (abbreviated as ME) describes a set of criteria to accept
@@ -171,7 +170,6 @@ int LNetEQFree(lnet_handle_eq_t eventq_in);
int LNetEQGet(lnet_handle_eq_t eventq_in,
lnet_event_t *event_out);
-
int LNetEQWait(lnet_handle_eq_t eventq_in,
lnet_event_t *event_out);
@@ -204,7 +202,6 @@ int LNetGet(lnet_nid_t self,
unsigned int offset_in);
/** @} lnet_data */
-
/** \defgroup lnet_misc Miscellaneous operations.
* Miscellaneous operations.
* @{ */
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 06ff463e4af6..5e8ea222b49f 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -41,12 +41,11 @@
#ifndef __LNET_LIB_LNET_H__
#define __LNET_LIB_LNET_H__
-#include <linux/lnet/linux/lib-lnet.h>
-
-#include <linux/libcfs/libcfs.h>
-#include <linux/lnet/types.h>
-#include <linux/lnet/lnet.h>
-#include <linux/lnet/lib-types.h>
+#include "linux/lib-lnet.h"
+#include "../libcfs/libcfs.h"
+#include "types.h"
+#include "lnet.h"
+#include "lib-types.h"
extern lnet_t the_lnet; /* THE network */
@@ -167,7 +166,6 @@ lnet_net_lock_current(void)
#define LNET_LOCK() lnet_net_lock(LNET_LOCK_EX)
#define LNET_UNLOCK() lnet_net_unlock(LNET_LOCK_EX)
-
#define lnet_ptl_lock(ptl) spin_lock(&(ptl)->ptl_lock)
#define lnet_ptl_unlock(ptl) spin_unlock(&(ptl)->ptl_lock)
#define lnet_eq_wait_lock() spin_lock(&the_lnet.ln_eq_wait_lock)
@@ -177,7 +175,6 @@ lnet_net_lock_current(void)
#define LNET_MUTEX_LOCK(m) mutex_lock(m)
#define LNET_MUTEX_UNLOCK(m) mutex_unlock(m)
-
#define MAX_PORTALS 64
/* these are only used by code with LNET_USE_LIB_FREELIST, but we still
@@ -215,7 +212,6 @@ lnet_freelist_free(lnet_freelist_t *fl, void *obj)
list_add(&o->fo_list, &fl->fl_list);
}
-
static inline lnet_eq_t *
lnet_eq_alloc(void)
{
@@ -572,7 +568,7 @@ lnet_peer_addref_locked(lnet_peer_t *lp)
lp->lp_refcount++;
}
-extern void lnet_destroy_peer_locked(lnet_peer_t *lp);
+void lnet_destroy_peer_locked(lnet_peer_t *lp);
static inline void
lnet_peer_decref_locked(lnet_peer_t *lp)
@@ -641,15 +637,14 @@ lnet_net2rnethash(__u32 net)
extern lnd_t the_lolnd;
+int lnet_cpt_of_nid_locked(lnet_nid_t nid);
+int lnet_cpt_of_nid(lnet_nid_t nid);
+lnet_ni_t *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
+lnet_ni_t *lnet_net2ni_locked(__u32 net, int cpt);
+lnet_ni_t *lnet_net2ni(__u32 net);
-extern int lnet_cpt_of_nid_locked(lnet_nid_t nid);
-extern int lnet_cpt_of_nid(lnet_nid_t nid);
-extern lnet_ni_t *lnet_nid2ni_locked(lnet_nid_t nid, int cpt);
-extern lnet_ni_t *lnet_net2ni_locked(__u32 net, int cpt);
-extern lnet_ni_t *lnet_net2ni(__u32 net);
-
-int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, cfs_time_t when);
-void lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive, cfs_time_t when);
+int lnet_notify(lnet_ni_t *ni, lnet_nid_t peer, int alive, unsigned long when);
+void lnet_notify_locked(lnet_peer_t *lp, int notifylnd, int alive, unsigned long when);
int lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway_nid,
unsigned int priority);
int lnet_check_routes(void);
@@ -715,7 +710,7 @@ lnet_ptl_unsetopt(lnet_portal_t *ptl, int opt)
/* match-table functions */
struct list_head *lnet_mt_match_head(struct lnet_match_table *mtable,
- lnet_process_id_t id, __u64 mbits);
+ lnet_process_id_t id, __u64 mbits);
struct lnet_match_table *lnet_mt_of_attach(unsigned int index,
lnet_process_id_t id, __u64 mbits,
__u64 ignore_bits,
@@ -735,7 +730,7 @@ void lnet_portals_destroy(void);
/* message functions */
int lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr,
- lnet_nid_t fromnid, void *private, int rdma_req);
+ lnet_nid_t fromnid, void *private, int rdma_req);
void lnet_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
unsigned int offset, unsigned int mlen, unsigned int rlen);
lnet_msg_t *lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *get_msg);
@@ -758,7 +753,7 @@ void lnet_counters_reset(void);
unsigned int lnet_iov_nob(unsigned int niov, struct iovec *iov);
int lnet_extract_iov(int dst_niov, struct iovec *dst,
- int src_niov, struct iovec *src,
+ int src_niov, struct iovec *src,
unsigned int offset, unsigned int len);
unsigned int lnet_kiov_nob(unsigned int niov, lnet_kiov_t *iov);
@@ -767,19 +762,19 @@ int lnet_extract_kiov(int dst_niov, lnet_kiov_t *dst,
unsigned int offset, unsigned int len);
void lnet_copy_iov2iov(unsigned int ndiov, struct iovec *diov,
- unsigned int doffset,
+ unsigned int doffset,
unsigned int nsiov, struct iovec *siov,
unsigned int soffset, unsigned int nob);
void lnet_copy_kiov2iov(unsigned int niov, struct iovec *iov,
- unsigned int iovoffset,
+ unsigned int iovoffset,
unsigned int nkiov, lnet_kiov_t *kiov,
unsigned int kiovoffset, unsigned int nob);
void lnet_copy_iov2kiov(unsigned int nkiov, lnet_kiov_t *kiov,
- unsigned int kiovoffset,
+ unsigned int kiovoffset,
unsigned int niov, struct iovec *iov,
unsigned int iovoffset, unsigned int nob);
void lnet_copy_kiov2kiov(unsigned int ndkiov, lnet_kiov_t *dkiov,
- unsigned int doffset,
+ unsigned int doffset,
unsigned int nskiov, lnet_kiov_t *skiov,
unsigned int soffset, unsigned int nob);
@@ -810,6 +805,7 @@ lnet_copy_flat2iov(unsigned int ndiov, struct iovec *diov, unsigned int doffset,
int slen, void *src, unsigned int soffset, unsigned int nob)
{
struct iovec siov = {/*.iov_base = */ src, /*.iov_len = */slen};
+
lnet_copy_iov2iov(ndiov, diov, doffset,
1, &siov, soffset, nob);
}
@@ -819,6 +815,7 @@ lnet_copy_flat2kiov(unsigned int ndiov, lnet_kiov_t *dkiov, unsigned int doffset
int slen, void *src, unsigned int soffset, unsigned int nob)
{
struct iovec siov = {/* .iov_base = */ src, /* .iov_len = */ slen};
+
lnet_copy_iov2kiov(ndiov, dkiov, doffset,
1, &siov, soffset, nob);
}
@@ -832,7 +829,7 @@ void lnet_register_lnd(lnd_t *lnd);
void lnet_unregister_lnd(lnd_t *lnd);
int lnet_set_ip_niaddr(lnet_ni_t *ni);
-int lnet_connect(socket_t **sockp, lnet_nid_t peer_nid,
+int lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
__u32 local_ip, __u32 peer_ip, int peer_port);
void lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
__u32 peer_ip, int port);
@@ -871,5 +868,4 @@ void lnet_peer_tables_destroy(void);
int lnet_peer_tables_create(void);
void lnet_debug_peer(lnet_nid_t nid);
-
#endif
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index a63654b660de..f16213f1771a 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -42,11 +42,11 @@
#ifndef __LNET_LIB_TYPES_H__
#define __LNET_LIB_TYPES_H__
-#include <linux/lnet/linux/lib-types.h>
+#include "linux/lib-types.h"
-#include <linux/libcfs/libcfs.h>
+#include "../libcfs/libcfs.h"
#include <linux/list.h>
-#include <linux/lnet/types.h>
+#include "types.h"
#define WIRE_ATTR __attribute__((packed))
@@ -156,7 +156,6 @@ typedef struct {
* "stub" reply using their current protocol */
#define LNET_PROTO_MAGIC 0x45726963 /* ! */
-
#define LNET_PROTO_TCP_VERSION_MAJOR 1
#define LNET_PROTO_TCP_VERSION_MINOR 0
@@ -225,7 +224,6 @@ typedef struct lnet_msg {
lnet_hdr_t msg_hdr;
} lnet_msg_t;
-
typedef struct lnet_libhandle {
struct list_head lh_hash_chain;
__u64 lh_cookie;
@@ -280,6 +278,7 @@ typedef struct lnet_libmd {
#define LNET_MD_FLAG_ZOMBIE (1 << 0)
#define LNET_MD_FLAG_AUTO_UNLINK (1 << 1)
+#define LNET_MD_FLAG_ABORTED (1 << 2)
#ifdef LNET_USE_LIB_FREELIST
typedef struct {
@@ -363,10 +362,10 @@ typedef struct lnet_lnd {
void (*lnd_notify)(struct lnet_ni *ni, lnet_nid_t peer, int alive);
/* query of peer aliveness */
- void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, cfs_time_t *when);
+ void (*lnd_query)(struct lnet_ni *ni, lnet_nid_t peer, unsigned long *when);
/* accept a new connection */
- int (*lnd_accept)(struct lnet_ni *ni, socket_t *sock);
+ int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
} lnd_t;
@@ -458,11 +457,11 @@ typedef struct lnet_peer {
unsigned int lp_ping_notsent; /* SEND event outstanding from ping */
int lp_alive_count; /* # times router went dead<->alive */
long lp_txqnob; /* bytes queued for sending */
- cfs_time_t lp_timestamp; /* time of last aliveness news */
- cfs_time_t lp_ping_timestamp; /* time of last ping attempt */
- cfs_time_t lp_ping_deadline; /* != 0 if ping reply expected */
- cfs_time_t lp_last_alive; /* when I was last alive */
- cfs_time_t lp_last_query; /* when lp_ni was queried last time */
+ unsigned long lp_timestamp; /* time of last aliveness news */
+ unsigned long lp_ping_timestamp; /* time of last ping attempt */
+ unsigned long lp_ping_deadline; /* != 0 if ping reply expected */
+ unsigned long lp_last_alive; /* when I was last alive */
+ unsigned long lp_last_query; /* when lp_ni was queried last time */
lnet_ni_t *lp_ni; /* interface peer is on */
lnet_nid_t lp_nid; /* peer's NID */
int lp_refcount; /* # refs */
diff --git a/drivers/staging/lustre/include/linux/lnet/linux/api-support.h b/drivers/staging/lustre/include/linux/lnet/linux/api-support.h
index ca78a0a4e908..e237ad6af422 100644
--- a/drivers/staging/lustre/include/linux/lnet/linux/api-support.h
+++ b/drivers/staging/lustre/include/linux/lnet/linux/api-support.h
@@ -39,5 +39,4 @@
#error Do not #include this file directly. #include <lnet /api-support.h> instead
#endif
-
#endif
diff --git a/drivers/staging/lustre/include/linux/lnet/linux/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/linux/lib-lnet.h
index d2c0a70f1f7e..0f8f04d1ecff 100644
--- a/drivers/staging/lustre/include/linux/lnet/linux/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/linux/lib-lnet.h
@@ -42,10 +42,10 @@
# include <asm/page.h>
# include <linux/string.h>
# include <asm/io.h>
-# include <linux/libcfs/libcfs.h>
+#include "../../libcfs/libcfs.h"
static inline __u64
-lnet_page2phys (struct page *p)
+lnet_page2phys(struct page *p)
{
/* compiler optimizer will elide unused branches */
@@ -66,7 +66,6 @@ lnet_page2phys (struct page *p)
}
}
-
#define LNET_ROUTER
#endif /* __LNET_LINUX_LIB_LNET_H__ */
diff --git a/drivers/staging/lustre/include/linux/lnet/lnet-sysctl.h b/drivers/staging/lustre/include/linux/lnet/lnet-sysctl.h
index 1bde44ebb911..2dee1b97fb88 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnet-sysctl.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnet-sysctl.h
@@ -37,7 +37,6 @@
#if defined(CONFIG_SYSCTL)
-
#define CTL_KRANAL 201
#define CTL_O2IBLND 205
#define CTL_PTLLND 206
@@ -45,7 +44,6 @@
#define CTL_SOCKLND 208
#define CTL_GNILND 210
-
#endif
#endif
diff --git a/drivers/staging/lustre/include/linux/lnet/lnet.h b/drivers/staging/lustre/include/linux/lnet/lnet.h
index c532b15d7643..75c0ab9193cc 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnet.h
@@ -40,10 +40,10 @@
*
* User application interface file
*/
-#include <linux/lnet/linux/lnet.h>
+#include "linux/lnet.h"
-#include <linux/lnet/types.h>
-#include <linux/lnet/api.h>
+#include "types.h"
+#include "api.h"
#define LNET_NIDSTR_COUNT 1024 /* # of nidstrings */
#define LNET_NIDSTR_SIZE 32 /* size of each one (see below for usage) */
diff --git a/drivers/staging/lustre/include/linux/lnet/lnetctl.h b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
index b22daa234255..98181d389396 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnetctl.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnetctl.h
@@ -19,8 +19,8 @@
#ifndef _PTLCTL_H_
#define _PTLCTL_H_
-#include <linux/libcfs/libcfs.h>
-#include <linux/lnet/types.h>
+#include "../libcfs/libcfs.h"
+#include "types.h"
#define LNET_DEV_ID 0
#define LNET_DEV_PATH "/dev/lnet"
@@ -43,10 +43,10 @@ int jt_ptl_which_nid(int argc, char **argv);
int jt_ptl_print_interfaces(int argc, char **argv);
int jt_ptl_add_interface(int argc, char **argv);
int jt_ptl_del_interface(int argc, char **argv);
-int jt_ptl_print_peers (int argc, char **argv);
-int jt_ptl_add_peer (int argc, char **argv);
-int jt_ptl_del_peer (int argc, char **argv);
-int jt_ptl_print_connections (int argc, char **argv);
+int jt_ptl_print_peers(int argc, char **argv);
+int jt_ptl_add_peer(int argc, char **argv);
+int jt_ptl_del_peer(int argc, char **argv);
+int jt_ptl_print_connections(int argc, char **argv);
int jt_ptl_disconnect(int argc, char **argv);
int jt_ptl_push_connection(int argc, char **argv);
int jt_ptl_print_active_txs(int argc, char **argv);
@@ -56,11 +56,11 @@ int jt_ptl_add_uuid(int argc, char **argv);
int jt_ptl_add_uuid_old(int argc, char **argv); /* backwards compatibility */
int jt_ptl_close_uuid(int argc, char **argv);
int jt_ptl_del_uuid(int argc, char **argv);
-int jt_ptl_add_route (int argc, char **argv);
-int jt_ptl_del_route (int argc, char **argv);
-int jt_ptl_notify_router (int argc, char **argv);
-int jt_ptl_print_routes (int argc, char **argv);
-int jt_ptl_fail_nid (int argc, char **argv);
+int jt_ptl_add_route(int argc, char **argv);
+int jt_ptl_del_route(int argc, char **argv);
+int jt_ptl_notify_router(int argc, char **argv);
+int jt_ptl_print_routes(int argc, char **argv);
+int jt_ptl_fail_nid(int argc, char **argv);
int jt_ptl_lwt(int argc, char **argv);
int jt_ptl_testprotocompat(int argc, char **argv);
int jt_ptl_memhog(int argc, char **argv);
diff --git a/drivers/staging/lustre/include/linux/lnet/lnetst.h b/drivers/staging/lustre/include/linux/lnet/lnetst.h
index 87fe9ac76a6c..885f708d4031 100644
--- a/drivers/staging/lustre/include/linux/lnet/lnetst.h
+++ b/drivers/staging/lustre/include/linux/lnet/lnetst.h
@@ -41,9 +41,9 @@
#ifndef __LNET_ST_H__
#define __LNET_ST_H__
-#include <linux/libcfs/libcfs.h>
-#include <linux/lnet/lnet.h>
-#include <linux/lnet/lib-types.h>
+#include "../libcfs/libcfs.h"
+#include "lnet.h"
+#include "lib-types.h"
#define LST_FEAT_NONE (0)
#define LST_FEAT_BULK_LEN (1 << 0) /* enable variable page size */
diff --git a/drivers/staging/lustre/include/linux/lnet/ptllnd.h b/drivers/staging/lustre/include/linux/lnet/ptllnd.h
index 313442a7ed3e..c91d65329995 100644
--- a/drivers/staging/lustre/include/linux/lnet/ptllnd.h
+++ b/drivers/staging/lustre/include/linux/lnet/ptllnd.h
@@ -46,11 +46,10 @@
*/
#define LUSTRE_PORTALS_UNLINK_SEMANTICS
-
#ifdef _USING_LUSTRE_PORTALS_
/* NIDs are 64-bits on Lustre Portals */
-#define FMT_NID LPU64
+#define FMT_NID "%llu"
#define FMT_PID "%d"
/* When using Lustre Portals Lustre completion semantics are imlicit*/
diff --git a/drivers/staging/lustre/include/linux/lnet/ptllnd_wire.h b/drivers/staging/lustre/include/linux/lnet/ptllnd_wire.h
index 0d3ec5be0a00..808f37b64a4f 100644
--- a/drivers/staging/lustre/include/linux/lnet/ptllnd_wire.h
+++ b/drivers/staging/lustre/include/linux/lnet/ptllnd_wire.h
@@ -54,7 +54,6 @@
* enough to avoid RDMA for anything sent while control is not in liblustre */
#define PTLLND_MAX_ULND_MSG_SIZE 512
-
/************************************************************************
* Portals LND Wire message format.
* These are sent in sender's byte order (i.e. receiver flips).
@@ -103,7 +102,7 @@ typedef struct {
} kptl_msg_t;
/* kptl_msg_t::ptlm_credits is only a __u8 */
-#define PTLLND_MSG_MAX_CREDITS ((typeof(((kptl_msg_t*) 0)->ptlm_credits)) - 1)
+#define PTLLND_MSG_MAX_CREDITS ((typeof(((kptl_msg_t *)0)->ptlm_credits)) - 1)
#define PTLLND_MSG_MAGIC LNET_PROTO_PTL_MAGIC
#define PTLLND_MSG_VERSION 0x04
diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h b/drivers/staging/lustre/include/linux/lnet/socklnd.h
index bacc74933a39..389038b122c5 100644
--- a/drivers/staging/lustre/include/linux/lnet/socklnd.h
+++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h
@@ -38,8 +38,8 @@
#ifndef __LNET_LNET_SOCKLND_H__
#define __LNET_LNET_SOCKLND_H__
-#include <linux/lnet/types.h>
-#include <linux/lnet/lib-types.h>
+#include "types.h"
+#include "lib-types.h"
#define SOCKLND_CONN_NONE (-1)
#define SOCKLND_CONN_ANY 0
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index 2add7976b3b2..68d8139a2b11 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -40,7 +40,7 @@
/** \addtogroup lnet
* @{ */
-#include <linux/libcfs/libcfs.h>
+#include "../libcfs/libcfs.h"
/** \addtogroup lnet_addr
* @{ */
@@ -110,7 +110,7 @@ static inline void LNetInvalidateHandle(lnet_handle_any_t *h)
*
* \return 1 if handles are equal, 0 if otherwise.
*/
-static inline int LNetHandleIsEqual (lnet_handle_any_t h1, lnet_handle_any_t h2)
+static inline int LNetHandleIsEqual(lnet_handle_any_t h1, lnet_handle_any_t h2)
{
return h1.cookie == h2.cookie;
}