diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
commit | e5fd91f1ef340da553f7a79da9540c3db711c937 (patch) | |
tree | b11842027dc6641da63f4bcc524f8678263304a3 /drivers/staging/lustre/include/linux/libcfs/libcfs.h | |
parent | 2a9b0348e685a63d97486f6749622b61e9e3292f (diff) |
Linux-libre 4.2-gnu
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs/libcfs.h')
-rw-r--r-- | drivers/staging/lustre/include/linux/libcfs/libcfs.h | 44 |
1 files changed, 4 insertions, 40 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 */ |