diff options
Diffstat (limited to 'drivers/staging/lustre/include')
4 files changed, 181 insertions, 291 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/bitmap.h b/drivers/staging/lustre/include/linux/libcfs/bitmap.h index f3d4a89..8b13789 100644 --- a/drivers/staging/lustre/include/linux/libcfs/bitmap.h +++ b/drivers/staging/lustre/include/linux/libcfs/bitmap.h @@ -1,111 +1 @@ -/* - * 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. - */ -#ifndef _LIBCFS_BITMAP_H_ -#define _LIBCFS_BITMAP_H_ - -typedef struct { - int size; - unsigned long data[0]; -} cfs_bitmap_t; - -#define CFS_BITMAP_SIZE(nbits) \ - (((nbits/BITS_PER_LONG)+1)*sizeof(long)+sizeof(cfs_bitmap_t)) - -static inline -cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size) -{ - cfs_bitmap_t *ptr; - - OBD_ALLOC(ptr, CFS_BITMAP_SIZE(size)); - if (ptr == NULL) - return ptr; - - ptr->size = size; - - return ptr; -} - -#define CFS_FREE_BITMAP(ptr) OBD_FREE(ptr, CFS_BITMAP_SIZE(ptr->size)) - -static inline -void cfs_bitmap_set(cfs_bitmap_t *bitmap, int nbit) -{ - set_bit(nbit, bitmap->data); -} - -static inline -void cfs_bitmap_clear(cfs_bitmap_t *bitmap, int nbit) -{ - test_and_clear_bit(nbit, bitmap->data); -} - -static inline -int cfs_bitmap_check(cfs_bitmap_t *bitmap, int nbit) -{ - return test_bit(nbit, bitmap->data); -} - -static inline -int cfs_bitmap_test_and_clear(cfs_bitmap_t *bitmap, int nbit) -{ - return test_and_clear_bit(nbit, bitmap->data); -} - -/* return 0 is bitmap has none set bits */ -static inline -int cfs_bitmap_check_empty(cfs_bitmap_t *bitmap) -{ - return find_first_bit(bitmap->data, bitmap->size) == bitmap->size; -} - -static inline -void cfs_bitmap_copy(cfs_bitmap_t *new, cfs_bitmap_t *old) -{ - int newsize; - - LASSERT(new->size >= old->size); - newsize = new->size; - memcpy(new, old, CFS_BITMAP_SIZE(old->size)); - new->size = newsize; -} - -#define cfs_foreach_bit(bitmap, pos) \ - for ((pos) = find_first_bit((bitmap)->data, bitmap->size); \ - (pos) < (bitmap)->size; \ - (pos) = find_next_bit((bitmap)->data, (bitmap)->size, (pos) + 1)) - -#endif diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index e6439d1..40282b7 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -165,11 +165,11 @@ struct ptldebug_header { #define CDEBUG_DEFAULT_MAX_DELAY (cfs_time_seconds(600)) /* jiffies */ #define CDEBUG_DEFAULT_MIN_DELAY ((cfs_time_seconds(1) + 1) / 2) /* jiffies */ #define CDEBUG_DEFAULT_BACKOFF 2 -typedef struct { +struct cfs_debug_limit_state { cfs_time_t cdls_next; unsigned int cdls_delay; int cdls_count; -} cfs_debug_limit_state_t; +}; struct libcfs_debug_msg_data { const char *msg_file; @@ -177,7 +177,7 @@ struct libcfs_debug_msg_data { int msg_subsys; int msg_line; int msg_mask; - cfs_debug_limit_state_t *msg_cdls; + struct cfs_debug_limit_state *msg_cdls; }; #define LIBCFS_DEBUG_MSG_DATA_INIT(data, mask, cdls) \ @@ -226,7 +226,7 @@ do { \ #define CDEBUG_LIMIT(mask, format, ...) \ do { \ - static cfs_debug_limit_state_t cdls; \ + static struct cfs_debug_limit_state cdls; \ \ __CDEBUG(&cdls, mask, format, ## __VA_ARGS__);\ } while (0) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 98f5be2..9d5ee1a 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -81,10 +81,10 @@ struct cfs_hash_ops; struct cfs_hash_lock_ops; struct cfs_hash_hlist_ops; -typedef union { +union cfs_hash_lock { rwlock_t rw; /**< rwlock */ spinlock_t spin; /**< spinlock */ -} cfs_hash_lock_t; +}; /** * cfs_hash_bucket is a container of: @@ -97,22 +97,22 @@ typedef union { * which depends on requirement of user * - some extra bytes (caller can require it while creating hash) */ -typedef struct cfs_hash_bucket { - cfs_hash_lock_t hsb_lock; /**< bucket lock */ +struct cfs_hash_bucket { + union cfs_hash_lock hsb_lock; /**< bucket lock */ __u32 hsb_count; /**< current entries */ __u32 hsb_version; /**< change version */ unsigned int hsb_index; /**< index of bucket */ int hsb_depmax; /**< max depth on bucket */ long hsb_head[0]; /**< hash-head array */ -} cfs_hash_bucket_t; +}; /** * cfs_hash bucket descriptor, it's normally in stack of caller */ -typedef struct cfs_hash_bd { - cfs_hash_bucket_t *bd_bucket; /**< address of bucket */ +struct cfs_hash_bd { + struct cfs_hash_bucket *bd_bucket; /**< address of bucket */ unsigned int bd_offset; /**< offset in bucket */ -} cfs_hash_bd_t; +}; #define CFS_HASH_NAME_LEN 16 /**< default name length */ #define CFS_HASH_BIGNAME_LEN 64 /**< bigname for param tree */ @@ -210,10 +210,10 @@ enum cfs_hash_tag { * locations; additions must take care to only insert into the new bucket. */ -typedef struct cfs_hash { +struct cfs_hash { /** serialize with rehash, or serialize all operations if * the hash-table has CFS_HASH_NO_BKTLOCK */ - cfs_hash_lock_t hs_lock; + union cfs_hash_lock hs_lock; /** hash operations */ struct cfs_hash_ops *hs_ops; /** hash lock operations */ @@ -221,7 +221,7 @@ typedef struct cfs_hash { /** hash list operations */ struct cfs_hash_hlist_ops *hs_hops; /** hash buckets-table */ - cfs_hash_bucket_t **hs_buckets; + struct cfs_hash_bucket **hs_buckets; /** total number of items on this hash-table */ atomic_t hs_count; /** hash flags, see cfs_hash_tag for detail */ @@ -255,7 +255,7 @@ typedef struct cfs_hash { /** refcount on this hash table */ atomic_t hs_refcount; /** rehash buckets-table */ - cfs_hash_bucket_t **hs_rehash_buckets; + struct cfs_hash_bucket **hs_rehash_buckets; #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 /** serialize debug members */ spinlock_t hs_dep_lock; @@ -272,35 +272,35 @@ typedef struct cfs_hash { #endif /** name of htable */ char hs_name[0]; -} cfs_hash_t; +}; typedef struct cfs_hash_lock_ops { /** lock the hash table */ - void (*hs_lock)(cfs_hash_lock_t *lock, int exclusive); + void (*hs_lock)(union cfs_hash_lock *lock, int exclusive); /** unlock the hash table */ - void (*hs_unlock)(cfs_hash_lock_t *lock, int exclusive); + void (*hs_unlock)(union cfs_hash_lock *lock, int exclusive); /** lock the hash bucket */ - void (*hs_bkt_lock)(cfs_hash_lock_t *lock, int exclusive); + void (*hs_bkt_lock)(union cfs_hash_lock *lock, int exclusive); /** unlock the hash bucket */ - void (*hs_bkt_unlock)(cfs_hash_lock_t *lock, int exclusive); + void (*hs_bkt_unlock)(union cfs_hash_lock *lock, int exclusive); } cfs_hash_lock_ops_t; typedef struct cfs_hash_hlist_ops { /** return hlist_head of hash-head of @bd */ - struct hlist_head *(*hop_hhead)(cfs_hash_t *hs, cfs_hash_bd_t *bd); + struct hlist_head *(*hop_hhead)(struct cfs_hash *hs, struct cfs_hash_bd *bd); /** return hash-head size */ - int (*hop_hhead_size)(cfs_hash_t *hs); + int (*hop_hhead_size)(struct cfs_hash *hs); /** add @hnode to hash-head of @bd */ - int (*hop_hnode_add)(cfs_hash_t *hs, - cfs_hash_bd_t *bd, struct hlist_node *hnode); + int (*hop_hnode_add)(struct cfs_hash *hs, + struct cfs_hash_bd *bd, struct hlist_node *hnode); /** remove @hnode from hash-head of @bd */ - int (*hop_hnode_del)(cfs_hash_t *hs, - cfs_hash_bd_t *bd, struct hlist_node *hnode); + int (*hop_hnode_del)(struct cfs_hash *hs, + struct cfs_hash_bd *bd, struct hlist_node *hnode); } cfs_hash_hlist_ops_t; typedef struct cfs_hash_ops { /** return hashed value from @key */ - unsigned (*hs_hash)(cfs_hash_t *hs, const void *key, unsigned mask); + unsigned (*hs_hash)(struct cfs_hash *hs, const void *key, unsigned mask); /** return key address of @hnode */ void * (*hs_key)(struct hlist_node *hnode); /** copy key from @hnode to @key */ @@ -313,13 +313,13 @@ typedef struct cfs_hash_ops { /** return object address of @hnode, i.e: container_of(...hnode) */ void * (*hs_object)(struct hlist_node *hnode); /** get refcount of item, always called with holding bucket-lock */ - void (*hs_get)(cfs_hash_t *hs, struct hlist_node *hnode); + void (*hs_get)(struct cfs_hash *hs, struct hlist_node *hnode); /** release refcount of item */ - void (*hs_put)(cfs_hash_t *hs, struct hlist_node *hnode); + void (*hs_put)(struct cfs_hash *hs, struct hlist_node *hnode); /** release refcount of item, always called with holding bucket-lock */ - void (*hs_put_locked)(cfs_hash_t *hs, struct hlist_node *hnode); + void (*hs_put_locked)(struct cfs_hash *hs, struct hlist_node *hnode); /** it's called before removing of @hnode */ - void (*hs_exit)(cfs_hash_t *hs, struct hlist_node *hnode); + void (*hs_exit)(struct cfs_hash *hs, struct hlist_node *hnode); } cfs_hash_ops_t; /** total number of buckets in @hs */ @@ -340,41 +340,41 @@ typedef struct cfs_hash_ops { #define CFS_HASH_RH_NHLIST(hs) (1U << (hs)->hs_rehash_bits) static inline int -cfs_hash_with_no_lock(cfs_hash_t *hs) +cfs_hash_with_no_lock(struct cfs_hash *hs) { /* caller will serialize all operations for this hash-table */ return (hs->hs_flags & CFS_HASH_NO_LOCK) != 0; } static inline int -cfs_hash_with_no_bktlock(cfs_hash_t *hs) +cfs_hash_with_no_bktlock(struct cfs_hash *hs) { /* no bucket lock, one single lock to protect the hash-table */ return (hs->hs_flags & CFS_HASH_NO_BKTLOCK) != 0; } static inline int -cfs_hash_with_rw_bktlock(cfs_hash_t *hs) +cfs_hash_with_rw_bktlock(struct cfs_hash *hs) { /* rwlock to protect hash bucket */ return (hs->hs_flags & CFS_HASH_RW_BKTLOCK) != 0; } static inline int -cfs_hash_with_spin_bktlock(cfs_hash_t *hs) +cfs_hash_with_spin_bktlock(struct cfs_hash *hs) { /* spinlock to protect hash bucket */ return (hs->hs_flags & CFS_HASH_SPIN_BKTLOCK) != 0; } static inline int -cfs_hash_with_add_tail(cfs_hash_t *hs) +cfs_hash_with_add_tail(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_ADD_TAIL) != 0; } static inline int -cfs_hash_with_no_itemref(cfs_hash_t *hs) +cfs_hash_with_no_itemref(struct cfs_hash *hs) { /* hash-table doesn't keep refcount on item, * item can't be removed from hash unless it's @@ -383,75 +383,75 @@ cfs_hash_with_no_itemref(cfs_hash_t *hs) } static inline int -cfs_hash_with_bigname(cfs_hash_t *hs) +cfs_hash_with_bigname(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_BIGNAME) != 0; } static inline int -cfs_hash_with_counter(cfs_hash_t *hs) +cfs_hash_with_counter(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_COUNTER) != 0; } static inline int -cfs_hash_with_rehash(cfs_hash_t *hs) +cfs_hash_with_rehash(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_REHASH) != 0; } static inline int -cfs_hash_with_rehash_key(cfs_hash_t *hs) +cfs_hash_with_rehash_key(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_REHASH_KEY) != 0; } static inline int -cfs_hash_with_shrink(cfs_hash_t *hs) +cfs_hash_with_shrink(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_SHRINK) != 0; } static inline int -cfs_hash_with_assert_empty(cfs_hash_t *hs) +cfs_hash_with_assert_empty(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_ASSERT_EMPTY) != 0; } static inline int -cfs_hash_with_depth(cfs_hash_t *hs) +cfs_hash_with_depth(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_DEPTH) != 0; } static inline int -cfs_hash_with_nblk_change(cfs_hash_t *hs) +cfs_hash_with_nblk_change(struct cfs_hash *hs) { return (hs->hs_flags & CFS_HASH_NBLK_CHANGE) != 0; } static inline int -cfs_hash_is_exiting(cfs_hash_t *hs) +cfs_hash_is_exiting(struct cfs_hash *hs) { /* cfs_hash_destroy is called */ return hs->hs_exiting; } static inline int -cfs_hash_is_rehashing(cfs_hash_t *hs) +cfs_hash_is_rehashing(struct cfs_hash *hs) { /* rehash is launched */ return hs->hs_rehash_bits != 0; } static inline int -cfs_hash_is_iterating(cfs_hash_t *hs) +cfs_hash_is_iterating(struct cfs_hash *hs) { /* someone is calling cfs_hash_for_each_* */ return hs->hs_iterating || hs->hs_iterators != 0; } static inline int -cfs_hash_bkt_size(cfs_hash_t *hs) +cfs_hash_bkt_size(struct cfs_hash *hs) { - return offsetof(cfs_hash_bucket_t, hsb_head[0]) + + return offsetof(struct cfs_hash_bucket, hsb_head[0]) + hs->hs_hops->hop_hhead_size(hs) * CFS_HASH_BKT_NHLIST(hs) + hs->hs_extra_bytes; } @@ -459,19 +459,19 @@ cfs_hash_bkt_size(cfs_hash_t *hs) #define CFS_HOP(hs, op) (hs)->hs_ops->hs_ ## op static inline unsigned -cfs_hash_id(cfs_hash_t *hs, const void *key, unsigned mask) +cfs_hash_id(struct cfs_hash *hs, const void *key, unsigned mask) { return CFS_HOP(hs, hash)(hs, key, mask); } static inline void * -cfs_hash_key(cfs_hash_t *hs, struct hlist_node *hnode) +cfs_hash_key(struct cfs_hash *hs, struct hlist_node *hnode) { return CFS_HOP(hs, key)(hnode); } static inline void -cfs_hash_keycpy(cfs_hash_t *hs, struct hlist_node *hnode, void *key) +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); @@ -481,25 +481,25 @@ cfs_hash_keycpy(cfs_hash_t *hs, struct hlist_node *hnode, void *key) * Returns 1 on a match, */ static inline int -cfs_hash_keycmp(cfs_hash_t *hs, const void *key, struct hlist_node *hnode) +cfs_hash_keycmp(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) { return CFS_HOP(hs, keycmp)(key, hnode); } static inline void * -cfs_hash_object(cfs_hash_t *hs, struct hlist_node *hnode) +cfs_hash_object(struct cfs_hash *hs, struct hlist_node *hnode) { return CFS_HOP(hs, object)(hnode); } static inline void -cfs_hash_get(cfs_hash_t *hs, struct hlist_node *hnode) +cfs_hash_get(struct cfs_hash *hs, struct hlist_node *hnode) { return CFS_HOP(hs, get)(hs, hnode); } static inline void -cfs_hash_put_locked(cfs_hash_t *hs, struct hlist_node *hnode) +cfs_hash_put_locked(struct cfs_hash *hs, struct hlist_node *hnode) { LASSERT(CFS_HOP(hs, put_locked) != NULL); @@ -507,7 +507,7 @@ cfs_hash_put_locked(cfs_hash_t *hs, struct hlist_node *hnode) } static inline void -cfs_hash_put(cfs_hash_t *hs, struct hlist_node *hnode) +cfs_hash_put(struct cfs_hash *hs, struct hlist_node *hnode) { LASSERT(CFS_HOP(hs, put) != NULL); @@ -515,37 +515,37 @@ cfs_hash_put(cfs_hash_t *hs, struct hlist_node *hnode) } static inline void -cfs_hash_exit(cfs_hash_t *hs, struct hlist_node *hnode) +cfs_hash_exit(struct cfs_hash *hs, struct hlist_node *hnode) { if (CFS_HOP(hs, exit)) CFS_HOP(hs, exit)(hs, hnode); } -static inline void cfs_hash_lock(cfs_hash_t *hs, int excl) +static inline void cfs_hash_lock(struct cfs_hash *hs, int excl) { hs->hs_lops->hs_lock(&hs->hs_lock, excl); } -static inline void cfs_hash_unlock(cfs_hash_t *hs, int excl) +static inline void cfs_hash_unlock(struct cfs_hash *hs, int excl) { hs->hs_lops->hs_unlock(&hs->hs_lock, excl); } -static inline int cfs_hash_dec_and_lock(cfs_hash_t *hs, +static inline int cfs_hash_dec_and_lock(struct cfs_hash *hs, atomic_t *condition) { LASSERT(cfs_hash_with_no_bktlock(hs)); return atomic_dec_and_lock(condition, &hs->hs_lock.spin); } -static inline void cfs_hash_bd_lock(cfs_hash_t *hs, - cfs_hash_bd_t *bd, int excl) +static inline void cfs_hash_bd_lock(struct cfs_hash *hs, + struct cfs_hash_bd *bd, int excl) { hs->hs_lops->hs_bkt_lock(&bd->bd_bucket->hsb_lock, excl); } -static inline void cfs_hash_bd_unlock(cfs_hash_t *hs, - cfs_hash_bd_t *bd, int excl) +static inline void cfs_hash_bd_unlock(struct cfs_hash *hs, + struct cfs_hash_bd *bd, int excl) { hs->hs_lops->hs_bkt_unlock(&bd->bd_bucket->hsb_lock, excl); } @@ -554,56 +554,56 @@ static inline void cfs_hash_bd_unlock(cfs_hash_t *hs, * operations on cfs_hash bucket (bd: bucket descriptor), * they are normally for hash-table without rehash */ -void cfs_hash_bd_get(cfs_hash_t *hs, const void *key, cfs_hash_bd_t *bd); +void cfs_hash_bd_get(struct cfs_hash *hs, const void *key, struct cfs_hash_bd *bd); -static inline void cfs_hash_bd_get_and_lock(cfs_hash_t *hs, const void *key, - cfs_hash_bd_t *bd, int excl) +static inline void cfs_hash_bd_get_and_lock(struct cfs_hash *hs, const void *key, + struct cfs_hash_bd *bd, int excl) { cfs_hash_bd_get(hs, key, bd); cfs_hash_bd_lock(hs, bd, excl); } -static inline unsigned cfs_hash_bd_index_get(cfs_hash_t *hs, cfs_hash_bd_t *bd) +static inline unsigned cfs_hash_bd_index_get(struct cfs_hash *hs, struct cfs_hash_bd *bd) { return bd->bd_offset | (bd->bd_bucket->hsb_index << hs->hs_bkt_bits); } -static inline void cfs_hash_bd_index_set(cfs_hash_t *hs, - unsigned index, cfs_hash_bd_t *bd) +static inline void cfs_hash_bd_index_set(struct cfs_hash *hs, + unsigned index, struct cfs_hash_bd *bd) { bd->bd_bucket = hs->hs_buckets[index >> hs->hs_bkt_bits]; bd->bd_offset = index & (CFS_HASH_BKT_NHLIST(hs) - 1U); } static inline void * -cfs_hash_bd_extra_get(cfs_hash_t *hs, cfs_hash_bd_t *bd) +cfs_hash_bd_extra_get(struct cfs_hash *hs, struct cfs_hash_bd *bd) { return (void *)bd->bd_bucket + cfs_hash_bkt_size(hs) - hs->hs_extra_bytes; } static inline __u32 -cfs_hash_bd_version_get(cfs_hash_bd_t *bd) +cfs_hash_bd_version_get(struct cfs_hash_bd *bd) { /* need hold cfs_hash_bd_lock */ return bd->bd_bucket->hsb_version; } static inline __u32 -cfs_hash_bd_count_get(cfs_hash_bd_t *bd) +cfs_hash_bd_count_get(struct cfs_hash_bd *bd) { /* need hold cfs_hash_bd_lock */ return bd->bd_bucket->hsb_count; } static inline int -cfs_hash_bd_depmax_get(cfs_hash_bd_t *bd) +cfs_hash_bd_depmax_get(struct cfs_hash_bd *bd) { return bd->bd_bucket->hsb_depmax; } static inline int -cfs_hash_bd_compare(cfs_hash_bd_t *bd1, cfs_hash_bd_t *bd2) +cfs_hash_bd_compare(struct cfs_hash_bd *bd1, struct cfs_hash_bd *bd2) { if (bd1->bd_bucket->hsb_index != bd2->bd_bucket->hsb_index) return bd1->bd_bucket->hsb_index - bd2->bd_bucket->hsb_index; @@ -614,14 +614,14 @@ cfs_hash_bd_compare(cfs_hash_bd_t *bd1, cfs_hash_bd_t *bd2) return 0; } -void cfs_hash_bd_add_locked(cfs_hash_t *hs, cfs_hash_bd_t *bd, +void cfs_hash_bd_add_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *hnode); -void cfs_hash_bd_del_locked(cfs_hash_t *hs, cfs_hash_bd_t *bd, +void cfs_hash_bd_del_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *hnode); -void cfs_hash_bd_move_locked(cfs_hash_t *hs, cfs_hash_bd_t *bd_old, - cfs_hash_bd_t *bd_new, struct hlist_node *hnode); +void cfs_hash_bd_move_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd_old, + struct cfs_hash_bd *bd_new, struct hlist_node *hnode); -static inline int cfs_hash_bd_dec_and_lock(cfs_hash_t *hs, cfs_hash_bd_t *bd, +static inline int cfs_hash_bd_dec_and_lock(struct cfs_hash *hs, struct cfs_hash_bd *bd, atomic_t *condition) { LASSERT(cfs_hash_with_spin_bktlock(hs)); @@ -629,109 +629,109 @@ static inline int cfs_hash_bd_dec_and_lock(cfs_hash_t *hs, cfs_hash_bd_t *bd, &bd->bd_bucket->hsb_lock.spin); } -static inline struct hlist_head *cfs_hash_bd_hhead(cfs_hash_t *hs, - cfs_hash_bd_t *bd) +static inline struct hlist_head *cfs_hash_bd_hhead(struct cfs_hash *hs, + struct cfs_hash_bd *bd) { return hs->hs_hops->hop_hhead(hs, bd); } -struct hlist_node *cfs_hash_bd_lookup_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bd, const void *key); -struct hlist_node *cfs_hash_bd_peek_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bd, const void *key); -struct hlist_node *cfs_hash_bd_findadd_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bd, const void *key, +struct hlist_node *cfs_hash_bd_lookup_locked(struct cfs_hash *hs, + 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 hlist_node *cfs_hash_bd_findadd_locked(struct cfs_hash *hs, + struct cfs_hash_bd *bd, const void *key, struct hlist_node *hnode, int insist_add); -struct hlist_node *cfs_hash_bd_finddel_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bd, const void *key, +struct hlist_node *cfs_hash_bd_finddel_locked(struct cfs_hash *hs, + struct cfs_hash_bd *bd, const void *key, struct hlist_node *hnode); /** * operations on cfs_hash bucket (bd: bucket descriptor), * they are safe for hash-table with rehash */ -void cfs_hash_dual_bd_get(cfs_hash_t *hs, const void *key, cfs_hash_bd_t *bds); -void cfs_hash_dual_bd_lock(cfs_hash_t *hs, cfs_hash_bd_t *bds, int excl); -void cfs_hash_dual_bd_unlock(cfs_hash_t *hs, cfs_hash_bd_t *bds, int excl); +void cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key, struct cfs_hash_bd *bds); +void cfs_hash_dual_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds, int excl); +void cfs_hash_dual_bd_unlock(struct cfs_hash *hs, struct cfs_hash_bd *bds, int excl); -static inline void cfs_hash_dual_bd_get_and_lock(cfs_hash_t *hs, const void *key, - cfs_hash_bd_t *bds, int excl) +static inline void cfs_hash_dual_bd_get_and_lock(struct cfs_hash *hs, const void *key, + struct cfs_hash_bd *bds, int excl) { cfs_hash_dual_bd_get(hs, key, bds); cfs_hash_dual_bd_lock(hs, bds, excl); } -struct hlist_node *cfs_hash_dual_bd_lookup_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bds, +struct hlist_node *cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs, + struct cfs_hash_bd *bds, const void *key); -struct hlist_node *cfs_hash_dual_bd_findadd_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bds, +struct hlist_node *cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs, + struct cfs_hash_bd *bds, const void *key, struct hlist_node *hnode, int insist_add); -struct hlist_node *cfs_hash_dual_bd_finddel_locked(cfs_hash_t *hs, - cfs_hash_bd_t *bds, +struct hlist_node *cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs, + struct cfs_hash_bd *bds, const void *key, struct hlist_node *hnode); /* Hash init/cleanup functions */ -cfs_hash_t *cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, +struct cfs_hash *cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, unsigned bkt_bits, unsigned extra_bytes, unsigned min_theta, unsigned max_theta, cfs_hash_ops_t *ops, unsigned flags); -cfs_hash_t *cfs_hash_getref(cfs_hash_t *hs); -void cfs_hash_putref(cfs_hash_t *hs); +struct cfs_hash *cfs_hash_getref(struct cfs_hash *hs); +void cfs_hash_putref(struct cfs_hash *hs); /* Hash addition functions */ -void cfs_hash_add(cfs_hash_t *hs, const void *key, +void cfs_hash_add(struct cfs_hash *hs, const void *key, struct hlist_node *hnode); -int cfs_hash_add_unique(cfs_hash_t *hs, const void *key, +int cfs_hash_add_unique(struct cfs_hash *hs, const void *key, struct hlist_node *hnode); -void *cfs_hash_findadd_unique(cfs_hash_t *hs, const void *key, +void *cfs_hash_findadd_unique(struct cfs_hash *hs, const void *key, struct hlist_node *hnode); /* Hash deletion functions */ -void *cfs_hash_del(cfs_hash_t *hs, const void *key, struct hlist_node *hnode); -void *cfs_hash_del_key(cfs_hash_t *hs, const void *key); +void *cfs_hash_del(struct cfs_hash *hs, const void *key, struct hlist_node *hnode); +void *cfs_hash_del_key(struct cfs_hash *hs, const void *key); /* Hash lookup/for_each functions */ #define CFS_HASH_LOOP_HOG 1024 -typedef int (*cfs_hash_for_each_cb_t)(cfs_hash_t *hs, cfs_hash_bd_t *bd, +typedef int (*cfs_hash_for_each_cb_t)(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *node, void *data); -void *cfs_hash_lookup(cfs_hash_t *hs, const void *key); -void cfs_hash_for_each(cfs_hash_t *hs, cfs_hash_for_each_cb_t, void *data); -void cfs_hash_for_each_safe(cfs_hash_t *hs, cfs_hash_for_each_cb_t, void *data); -int cfs_hash_for_each_nolock(cfs_hash_t *hs, +void *cfs_hash_lookup(struct cfs_hash *hs, const void *key); +void cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each_cb_t, void *data); +void cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t, void *data); +int cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t, void *data); -int cfs_hash_for_each_empty(cfs_hash_t *hs, +int cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t, void *data); -void cfs_hash_for_each_key(cfs_hash_t *hs, const void *key, +void cfs_hash_for_each_key(struct cfs_hash *hs, const void *key, cfs_hash_for_each_cb_t, void *data); typedef int (*cfs_hash_cond_opt_cb_t)(void *obj, void *data); -void cfs_hash_cond_del(cfs_hash_t *hs, cfs_hash_cond_opt_cb_t, void *data); +void cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t, void *data); -void cfs_hash_hlist_for_each(cfs_hash_t *hs, unsigned hindex, +void cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned hindex, cfs_hash_for_each_cb_t, void *data); -int cfs_hash_is_empty(cfs_hash_t *hs); -__u64 cfs_hash_size_get(cfs_hash_t *hs); +int cfs_hash_is_empty(struct cfs_hash *hs); +__u64 cfs_hash_size_get(struct cfs_hash *hs); /* * Rehash - Theta is calculated to be the average chained * hash depth assuming a perfectly uniform hash function. */ -void cfs_hash_rehash_cancel_locked(cfs_hash_t *hs); -void cfs_hash_rehash_cancel(cfs_hash_t *hs); -int cfs_hash_rehash(cfs_hash_t *hs, int do_rehash); -void cfs_hash_rehash_key(cfs_hash_t *hs, const void *old_key, +void cfs_hash_rehash_cancel_locked(struct cfs_hash *hs); +void cfs_hash_rehash_cancel(struct cfs_hash *hs); +int cfs_hash_rehash(struct cfs_hash *hs, int do_rehash); +void cfs_hash_rehash_key(struct cfs_hash *hs, const void *old_key, void *new_key, struct hlist_node *hnode); #if CFS_HASH_DEBUG_LEVEL > CFS_HASH_DEBUG_1 /* Validate hnode references the correct key */ static inline void -cfs_hash_key_validate(cfs_hash_t *hs, const void *key, +cfs_hash_key_validate(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) { LASSERT(cfs_hash_keycmp(hs, key, hnode)); @@ -739,10 +739,10 @@ cfs_hash_key_validate(cfs_hash_t *hs, const void *key, /* Validate hnode is in the correct bucket */ static inline void -cfs_hash_bucket_validate(cfs_hash_t *hs, cfs_hash_bd_t *bd, +cfs_hash_bucket_validate(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *hnode) { - cfs_hash_bd_t bds[2]; + struct cfs_hash_bd bds[2]; cfs_hash_dual_bd_get(hs, cfs_hash_key(hs, hnode), bds); LASSERT(bds[0].bd_bucket == bd->bd_bucket || @@ -752,11 +752,11 @@ cfs_hash_bucket_validate(cfs_hash_t *hs, cfs_hash_bd_t *bd, #else /* CFS_HASH_DEBUG_LEVEL > CFS_HASH_DEBUG_1 */ static inline void -cfs_hash_key_validate(cfs_hash_t *hs, const void *key, +cfs_hash_key_validate(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) {} static inline void -cfs_hash_bucket_validate(cfs_hash_t *hs, cfs_hash_bd_t *bd, +cfs_hash_bucket_validate(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *hnode) {} #endif /* CFS_HASH_DEBUG_LEVEL */ @@ -778,13 +778,13 @@ static inline int __cfs_hash_theta_frac(int theta) (__cfs_hash_theta_int(theta) * 1000); } -static inline int __cfs_hash_theta(cfs_hash_t *hs) +static inline int __cfs_hash_theta(struct cfs_hash *hs) { return (atomic_read(&hs->hs_count) << CFS_HASH_THETA_BITS) >> hs->hs_cur_bits; } -static inline void __cfs_hash_set_theta(cfs_hash_t *hs, int min, int max) +static inline void __cfs_hash_set_theta(struct cfs_hash *hs, int min, int max) { LASSERT(min < max); hs->hs_min_theta = (__u16)min; @@ -794,7 +794,7 @@ static inline void __cfs_hash_set_theta(cfs_hash_t *hs, int min, int max) /* Generic debug formatting routines mainly for proc handler */ struct seq_file; int cfs_hash_debug_header(struct seq_file *m); -int cfs_hash_debug_str(cfs_hash_t *hs, struct seq_file *m); +int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m); /* * Generic djb2 hash algorithm for character arrays. @@ -830,7 +830,7 @@ cfs_hash_u64_hash(const __u64 key, unsigned mask) return ((unsigned)(key * CFS_GOLDEN_RATIO_PRIME_64) & mask); } -/** iterate over all buckets in @bds (array of cfs_hash_bd_t) */ +/** iterate over all buckets in @bds (array of struct cfs_hash_bd) */ #define cfs_hash_for_each_bd(bds, n, i) \ for (i = 0; i < n && (bds)[i].bd_bucket != NULL; i++) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 59bff0b..bf30104 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -79,20 +79,20 @@ extern lnet_t the_lnet; /* THE network */ /** exclusive lock */ #define LNET_LOCK_EX CFS_PERCPT_LOCK_EX -static inline int lnet_is_wire_handle_none (lnet_handle_wire_t *wh) +static inline int lnet_is_wire_handle_none(lnet_handle_wire_t *wh) { return (wh->wh_interface_cookie == LNET_WIRE_HANDLE_COOKIE_NONE && wh->wh_object_cookie == LNET_WIRE_HANDLE_COOKIE_NONE); } -static inline int lnet_md_exhausted (lnet_libmd_t *md) +static inline int lnet_md_exhausted(lnet_libmd_t *md) { return (md->md_threshold == 0 || ((md->md_options & LNET_MD_MAX_SIZE) != 0 && md->md_offset + md->md_max_size > md->md_length)); } -static inline int lnet_md_unlinkable (lnet_libmd_t *md) +static inline int lnet_md_unlinkable(lnet_libmd_t *md) { /* Should unlink md when its refcount is 0 and either: * - md has been flagged for deletion (by auto unlink or LNetM[DE]Unlink, @@ -193,31 +193,31 @@ int lnet_freelist_init(lnet_freelist_t *fl, int n, int size); void lnet_freelist_fini(lnet_freelist_t *fl); static inline void * -lnet_freelist_alloc (lnet_freelist_t *fl) +lnet_freelist_alloc(lnet_freelist_t *fl) { /* ALWAYS called with liblock held */ lnet_freeobj_t *o; - if (list_empty (&fl->fl_list)) - return (NULL); + if (list_empty(&fl->fl_list)) + return NULL; - o = list_entry (fl->fl_list.next, lnet_freeobj_t, fo_list); - list_del (&o->fo_list); - return ((void *)&o->fo_contents); + o = list_entry(fl->fl_list.next, lnet_freeobj_t, fo_list); + list_del(&o->fo_list); + return (void *)&o->fo_contents; } static inline void -lnet_freelist_free (lnet_freelist_t *fl, void *obj) +lnet_freelist_free(lnet_freelist_t *fl, void *obj) { /* ALWAYS called with liblock held */ - lnet_freeobj_t *o = list_entry (obj, lnet_freeobj_t, fo_contents); + lnet_freeobj_t *o = list_entry(obj, lnet_freeobj_t, fo_contents); - list_add (&o->fo_list, &fl->fl_list); + list_add(&o->fo_list, &fl->fl_list); } static inline lnet_eq_t * -lnet_eq_alloc (void) +lnet_eq_alloc(void) { /* NEVER called with resource lock held */ struct lnet_res_container *rec = &the_lnet.ln_eq_container; @@ -251,7 +251,7 @@ lnet_eq_free(lnet_eq_t *eq) } static inline lnet_libmd_t * -lnet_md_alloc (lnet_md_t *umd) +lnet_md_alloc(lnet_md_t *umd) { /* NEVER called with resource lock held */ struct lnet_res_container *rec = the_lnet.ln_md_containers[0]; @@ -322,7 +322,7 @@ lnet_me_free(lnet_me_t *me) } static inline lnet_msg_t * -lnet_msg_alloc (void) +lnet_msg_alloc(void) { /* NEVER called with network lock held */ struct lnet_msg_container *msc = the_lnet.ln_msg_containers[0]; @@ -353,7 +353,7 @@ lnet_msg_free_locked(lnet_msg_t *msg) } static inline void -lnet_msg_free (lnet_msg_t *msg) +lnet_msg_free(lnet_msg_t *msg) { lnet_net_lock(0); lnet_msg_free_locked(msg); @@ -363,13 +363,13 @@ lnet_msg_free (lnet_msg_t *msg) #else /* !LNET_USE_LIB_FREELIST */ static inline lnet_eq_t * -lnet_eq_alloc (void) +lnet_eq_alloc(void) { /* NEVER called with liblock held */ lnet_eq_t *eq; LIBCFS_ALLOC(eq, sizeof(*eq)); - return (eq); + return eq; } static inline void @@ -380,7 +380,7 @@ lnet_eq_free(lnet_eq_t *eq) } static inline lnet_libmd_t * -lnet_md_alloc (lnet_md_t *umd) +lnet_md_alloc(lnet_md_t *umd) { /* NEVER called with liblock held */ lnet_libmd_t *md; @@ -405,7 +405,7 @@ lnet_md_alloc (lnet_md_t *umd) INIT_LIST_HEAD(&md->md_list); } - return (md); + return md; } static inline void @@ -423,13 +423,13 @@ lnet_md_free(lnet_libmd_t *md) } static inline lnet_me_t * -lnet_me_alloc (void) +lnet_me_alloc(void) { /* NEVER called with liblock held */ lnet_me_t *me; LIBCFS_ALLOC(me, sizeof(*me)); - return (me); + return me; } static inline void @@ -448,7 +448,7 @@ lnet_msg_alloc(void) LIBCFS_ALLOC(msg, sizeof(*msg)); /* no need to zero, LIBCFS_ALLOC does for us */ - return (msg); + return msg; } static inline void @@ -479,7 +479,7 @@ lnet_res_lh_invalidate(lnet_libhandle_t *lh) } static inline void -lnet_eq2handle (lnet_handle_eq_t *handle, lnet_eq_t *eq) +lnet_eq2handle(lnet_handle_eq_t *handle, lnet_eq_t *eq) { if (eq == NULL) { LNetInvalidateHandle(handle); @@ -503,7 +503,7 @@ lnet_handle2eq(lnet_handle_eq_t *handle) } static inline void -lnet_md2handle (lnet_handle_md_t *handle, lnet_libmd_t *md) +lnet_md2handle(lnet_handle_md_t *handle, lnet_libmd_t *md) { handle->cookie = md->md_lh.lh_cookie; } @@ -544,7 +544,7 @@ lnet_wire_handle2md(lnet_handle_wire_t *wh) } static inline void -lnet_me2handle (lnet_handle_me_t *handle, lnet_me_t *me) +lnet_me2handle(lnet_handle_me_t *handle, lnet_me_t *me) { handle->cookie = me->me_lh.lh_cookie; } @@ -568,7 +568,7 @@ lnet_handle2me(lnet_handle_me_t *handle) static inline void lnet_peer_addref_locked(lnet_peer_t *lp) { - LASSERT (lp->lp_refcount > 0); + LASSERT(lp->lp_refcount > 0); lp->lp_refcount++; } @@ -577,7 +577,7 @@ extern void lnet_destroy_peer_locked(lnet_peer_t *lp); static inline void lnet_peer_decref_locked(lnet_peer_t *lp) { - LASSERT (lp->lp_refcount > 0); + LASSERT(lp->lp_refcount > 0); lp->lp_refcount--; if (lp->lp_refcount == 0) lnet_destroy_peer_locked(lp); @@ -660,7 +660,7 @@ void lnet_proc_init(void); void lnet_proc_fini(void); int lnet_rtrpools_alloc(int im_a_router); void lnet_rtrpools_free(void); -lnet_remotenet_t *lnet_find_net_locked (__u32 net); +lnet_remotenet_t *lnet_find_net_locked(__u32 net); int lnet_islocalnid(lnet_nid_t nid); int lnet_islocalnet(__u32 net); @@ -733,11 +733,11 @@ int lnet_portals_create(void); void lnet_portals_destroy(void); /* message functions */ -int lnet_parse (lnet_ni_t *ni, lnet_hdr_t *hdr, +int lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, 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); +lnet_msg_t *lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *get_msg); void lnet_set_reply_msg_len(lnet_ni_t *ni, lnet_msg_t *msg, unsigned int len); void lnet_finalize(lnet_ni_t *ni, lnet_msg_t *msg, int rc); void lnet_drop_delayed_msg_list(struct list_head *head, char *reason); @@ -748,36 +748,36 @@ void lnet_msg_container_cleanup(struct lnet_msg_container *container); void lnet_msg_containers_destroy(void); int lnet_msg_containers_create(void); -char *lnet_msgtyp2str (int type); -void lnet_print_hdr (lnet_hdr_t * hdr); +char *lnet_msgtyp2str(int type); +void lnet_print_hdr(lnet_hdr_t *hdr); int lnet_fail_nid(lnet_nid_t nid, unsigned int threshold); void lnet_counters_get(lnet_counters_t *counters); 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, +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, unsigned int offset, unsigned int len); -unsigned int lnet_kiov_nob (unsigned int niov, lnet_kiov_t *iov); -int lnet_extract_kiov (int dst_niov, lnet_kiov_t *dst, +unsigned int lnet_kiov_nob(unsigned int niov, lnet_kiov_t *iov); +int lnet_extract_kiov(int dst_niov, lnet_kiov_t *dst, int src_niov, lnet_kiov_t *src, unsigned int offset, unsigned int len); -void lnet_copy_iov2iov (unsigned int ndiov, struct iovec *diov, +void lnet_copy_iov2iov(unsigned int ndiov, struct iovec *diov, 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, +void lnet_copy_kiov2iov(unsigned int niov, struct iovec *iov, 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, +void lnet_copy_iov2kiov(unsigned int nkiov, lnet_kiov_t *kiov, 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, +void lnet_copy_kiov2kiov(unsigned int ndkiov, lnet_kiov_t *dkiov, unsigned int doffset, unsigned int nskiov, lnet_kiov_t *skiov, unsigned int soffset, unsigned int nob); @@ -829,7 +829,7 @@ void lnet_md_deconstruct(lnet_libmd_t *lmd, lnet_md_t *umd); 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_set_ip_niaddr(lnet_ni_t *ni); int lnet_connect(socket_t **sockp, lnet_nid_t peer_nid, __u32 local_ip, __u32 peer_ip, int peer_port); @@ -858,9 +858,9 @@ void lnet_ping_target_fini(void); int lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_ids); -int lnet_parse_ip2nets (char **networksp, char *ip2nets); -int lnet_parse_routes (char *route_str, int *im_a_router); -int lnet_parse_networks (struct list_head *nilist, char *networks); +int lnet_parse_ip2nets(char **networksp, char *ip2nets); +int lnet_parse_routes(char *route_str, int *im_a_router); +int lnet_parse_networks(struct list_head *nilist, char *networks); int lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid, int cpt); lnet_peer_t *lnet_find_peer_locked(struct lnet_peer_table *ptable, |