summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/include/linux/libcfs
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs')
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs.h44
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h2
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_private.h68
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h1
4 files changed, 5 insertions, 110 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 4410d7fdc..5dd9cdfae 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -37,34 +37,11 @@
#ifndef __LIBCFS_LIBCFS_H__
#define __LIBCFS_LIBCFS_H__
-#if !__GNUC__
-#define __attribute__(x)
-#endif
-
#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)))
-#endif
-
-#ifndef ARRAY_SIZE
-#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)
-#endif
-
-#if !defined(container_of)
-/* given a pointer @ptr to the field @member embedded into type (usually
- * struct) @type, return pointer to the embedding instance of @type. */
-#define container_of(ptr, type, member) \
- ((type *)((char *)(ptr)-(char *)(&((type *)0)->member)))
-#endif
-
static inline int __is_po2(unsigned long long val)
{
return !(val & (val - 1));
@@ -88,23 +65,6 @@ static inline int __is_po2(unsigned long long val)
int libcfs_arch_init(void);
void libcfs_arch_cleanup(void);
-/* libcfs tcpip */
-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(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(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
#define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023
@@ -184,4 +144,8 @@ static inline void *__container_of(void *ptr, unsigned long shift)
#define _LIBCFS_H
+void *libcfs_kvzalloc(size_t size, gfp_t flags);
+void *libcfs_kvzalloc_cpt(struct cfs_cpt_table *cptab, int cpt, size_t size,
+ gfp_t flags);
+
#endif /* _LIBCFS_H */
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index 3ee38782a..f5d741f25 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -134,7 +134,7 @@ struct libcfs_ioctl_handler {
#define IOC_LIBCFS_DEL_PEER _IOWR('e', 74, long)
#define IOC_LIBCFS_ADD_PEER _IOWR('e', 75, long)
#define IOC_LIBCFS_GET_PEER _IOWR('e', 76, long)
-#define IOC_LIBCFS_GET_TXDESC _IOWR('e', 77, long)
+/* ioctl 77 is free for use */
#define IOC_LIBCFS_ADD_INTERFACE _IOWR('e', 78, long)
#define IOC_LIBCFS_DEL_INTERFACE _IOWR('e', 79, long)
#define IOC_LIBCFS_GET_INTERFACE _IOWR('e', 80, long)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index fef882530..ed37d26eb 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -42,14 +42,10 @@
#ifndef __LIBCFS_PRIVATE_H__
#define __LIBCFS_PRIVATE_H__
-/* XXX this layering violation is for nidstrings */
-#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
@@ -410,36 +406,6 @@ int cfs_percpt_atomic_summary(atomic_t **refs);
*/
#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);
-char *libcfs_lnd2modname(int type);
-char *libcfs_lnd2str(int type);
-int libcfs_str2lnd(const char *str);
-char *libcfs_net2str(__u32 net);
-char *libcfs_nid2str(lnet_nid_t nid);
-__u32 libcfs_str2net(const char *str);
-lnet_nid_t libcfs_str2nid(const char *str);
-int libcfs_str2anynid(lnet_nid_t *nid, const char *str);
-char *libcfs_id2str(lnet_process_id_t id);
-void cfs_free_nidlist(struct list_head *list);
-int cfs_parse_nidlist(char *str, int len, struct list_head *list);
-int cfs_match_nid(lnet_nid_t nid, struct list_head *list);
-
-/** \addtogroup lnet_addr
- * @{ */
-/* how an LNET NID encodes net:address */
-/** extract the address part of an lnet_nid_t */
-#define LNET_NIDADDR(nid) ((__u32)((nid) & 0xffffffff))
-/** 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)))
-/* 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)))
-/** @} lnet_addr */
-
/* max value for numeric network address */
#define MAX_NUMERIC_VALUE 0xffffffff
@@ -496,19 +462,6 @@ static inline size_t cfs_round_strlen(char *fset)
return (size_t)cfs_size_round((int)strlen(fset) + 1);
}
-/* roundup \a val to power2 */
-static inline unsigned int cfs_power2_roundup(unsigned int val)
-{
- if (val != LOWEST_BIT_SET(val)) { /* not a power of 2 already */
- do {
- val &= ~LOWEST_BIT_SET(val);
- } while (val != LOWEST_BIT_SET(val));
- /* ...and round up */
- val <<= 1;
- }
- return val;
-}
-
#define LOGL(var, len, ptr) \
do { \
if (var) \
@@ -532,25 +485,4 @@ do { \
ptr += cfs_size_round(len + 1); \
} while (0)
-/**
- * Lustre Network Driver types.
- */
-enum {
- /* Only add to these values (i.e. don't ever change or redefine them):
- * network addresses depend on them... */
- QSWLND = 1,
- SOCKLND = 2,
- GMLND = 3, /* obsolete, keep it so that libcfs_nid2str works */
- PTLLND = 4,
- O2IBLND = 5,
- CIBLND = 6,
- OPENIBLND = 7,
- IIBLND = 8,
- LOLND = 9,
- RALND = 10,
- VIBLND = 11,
- MXLND = 12,
- GNILND = 13,
-};
-
#endif
diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
index 4fe50841e..3e2502a69 100644
--- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
@@ -61,7 +61,6 @@
#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>