diff options
Diffstat (limited to 'drivers/staging/lustre/include/linux/libcfs')
3 files changed, 14 insertions, 25 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index a6b2f906bb1a..4410d7fdc1b4 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -85,6 +85,9 @@ static inline int __is_po2(unsigned long long val) #include <linux/list.h> +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); diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 375586bf7312..808e49411a30 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -454,25 +454,23 @@ cfs_hash_bkt_size(struct cfs_hash *hs) hs->hs_extra_bytes; } -#define CFS_HOP(hs, op) (hs)->hs_ops->hs_ ## op - static inline unsigned cfs_hash_id(struct cfs_hash *hs, const void *key, unsigned mask) { - return CFS_HOP(hs, hash)(hs, key, mask); + return hs->hs_ops->hs_hash(hs, key, mask); } static inline void * cfs_hash_key(struct cfs_hash *hs, struct hlist_node *hnode) { - return CFS_HOP(hs, key)(hnode); + return hs->hs_ops->hs_key(hnode); } static inline void cfs_hash_keycpy(struct cfs_hash *hs, struct hlist_node *hnode, void *key) { - if (CFS_HOP(hs, keycpy) != NULL) - CFS_HOP(hs, keycpy)(hnode, key); + if (hs->hs_ops->hs_keycpy) + hs->hs_ops->hs_keycpy(hnode, key); } /** @@ -481,42 +479,38 @@ cfs_hash_keycpy(struct cfs_hash *hs, struct hlist_node *hnode, void *key) static inline int cfs_hash_keycmp(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) { - return CFS_HOP(hs, keycmp)(key, hnode); + return hs->hs_ops->hs_keycmp(key, hnode); } static inline void * cfs_hash_object(struct cfs_hash *hs, struct hlist_node *hnode) { - return CFS_HOP(hs, object)(hnode); + return hs->hs_ops->hs_object(hnode); } static inline void cfs_hash_get(struct cfs_hash *hs, struct hlist_node *hnode) { - return CFS_HOP(hs, get)(hs, hnode); + return hs->hs_ops->hs_get(hs, hnode); } static inline void cfs_hash_put_locked(struct cfs_hash *hs, struct hlist_node *hnode) { - LASSERT(CFS_HOP(hs, put_locked) != NULL); - - return CFS_HOP(hs, put_locked)(hs, hnode); + return hs->hs_ops->hs_put_locked(hs, hnode); } static inline void cfs_hash_put(struct cfs_hash *hs, struct hlist_node *hnode) { - LASSERT(CFS_HOP(hs, put) != NULL); - - return CFS_HOP(hs, put)(hs, hnode); + return hs->hs_ops->hs_put(hs, hnode); } static inline void cfs_hash_exit(struct cfs_hash *hs, struct hlist_node *hnode) { - if (CFS_HOP(hs, exit)) - CFS_HOP(hs, exit)(hs, hnode); + if (hs->hs_ops->hs_exit) + hs->hs_ops->hs_exit(hs, hnode); } static inline void cfs_hash_lock(struct cfs_hash *hs, int excl) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 2817112c0633..3d86fb5b5481 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -458,14 +458,6 @@ struct libcfs_device_userstate { struct page *ldu_memhog_root_page; }; -/* what used to be in portals_lib.h */ -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - #define MKSTR(ptr) ((ptr)) ? (ptr) : "" static inline int cfs_size_round4(int val) |