Commit a59e5747 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: libcfs: fixup all header block comments

Properly format the incorrect comments sections
that were reported by checkpatch.
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ab16bdd8
...@@ -29,10 +29,12 @@ ...@@ -29,10 +29,12 @@
#define _LIBCFS_CRYPTO_H #define _LIBCFS_CRYPTO_H
struct cfs_crypto_hash_type { struct cfs_crypto_hash_type {
char *cht_name; /**< hash algorithm name, equal to char *cht_name; /*< hash algorithm name, equal to
* format name for crypto api */ * format name for crypto api
unsigned int cht_key; /**< init key by default (valid for */
* 4 bytes context like crc32, adler */ unsigned int cht_key; /*< init key by default (valid for
* 4 bytes context like crc32, adler
*/
unsigned int cht_size; /**< hash digest size */ unsigned int cht_size; /**< hash digest size */
}; };
......
...@@ -103,22 +103,28 @@ static inline int cfs_fail_check_set(__u32 id, __u32 value, ...@@ -103,22 +103,28 @@ static inline int cfs_fail_check_set(__u32 id, __u32 value,
#define CFS_FAIL_CHECK_QUIET(id) \ #define CFS_FAIL_CHECK_QUIET(id) \
cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET, 1) cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET, 1)
/* If id hit cfs_fail_loc and cfs_fail_val == (-1 or value) return 1, /*
* otherwise return 0 */ * If id hit cfs_fail_loc and cfs_fail_val == (-1 or value) return 1,
* otherwise return 0
*/
#define CFS_FAIL_CHECK_VALUE(id, value) \ #define CFS_FAIL_CHECK_VALUE(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 0) cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 0)
#define CFS_FAIL_CHECK_VALUE_QUIET(id, value) \ #define CFS_FAIL_CHECK_VALUE_QUIET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 1) cfs_fail_check_set(id, value, CFS_FAIL_LOC_VALUE, 1)
/* If id hit cfs_fail_loc, cfs_fail_loc |= value and return 1, /*
* otherwise return 0 */ * If id hit cfs_fail_loc, cfs_fail_loc |= value and return 1,
* otherwise return 0
*/
#define CFS_FAIL_CHECK_ORSET(id, value) \ #define CFS_FAIL_CHECK_ORSET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 0) cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 0)
#define CFS_FAIL_CHECK_ORSET_QUIET(id, value) \ #define CFS_FAIL_CHECK_ORSET_QUIET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 1) cfs_fail_check_set(id, value, CFS_FAIL_LOC_ORSET, 1)
/* If id hit cfs_fail_loc, cfs_fail_loc = value and return 1, /*
* otherwise return 0 */ * If id hit cfs_fail_loc, cfs_fail_loc = value and return 1,
* otherwise return 0
*/
#define CFS_FAIL_CHECK_RESET(id, value) \ #define CFS_FAIL_CHECK_RESET(id, value) \
cfs_fail_check_set(id, value, CFS_FAIL_LOC_RESET, 0) cfs_fail_check_set(id, value, CFS_FAIL_LOC_RESET, 0)
#define CFS_FAIL_CHECK_RESET_QUIET(id, value) \ #define CFS_FAIL_CHECK_RESET_QUIET(id, value) \
...@@ -138,8 +144,10 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) ...@@ -138,8 +144,10 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
#define CFS_FAIL_TIMEOUT_MS(id, ms) \ #define CFS_FAIL_TIMEOUT_MS(id, ms) \
cfs_fail_timeout_set(id, 0, ms, CFS_FAIL_LOC_NOSET) cfs_fail_timeout_set(id, 0, ms, CFS_FAIL_LOC_NOSET)
/* If id hit cfs_fail_loc, cfs_fail_loc |= value and /*
* sleep seconds or milliseconds */ * If id hit cfs_fail_loc, cfs_fail_loc |= value and
* sleep seconds or milliseconds
*/
#define CFS_FAIL_TIMEOUT_ORSET(id, value, secs) \ #define CFS_FAIL_TIMEOUT_ORSET(id, value, secs) \
cfs_fail_timeout_set(id, value, secs * 1000, CFS_FAIL_LOC_ORSET) cfs_fail_timeout_set(id, value, secs * 1000, CFS_FAIL_LOC_ORSET)
...@@ -152,10 +160,12 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) ...@@ -152,10 +160,12 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set)
#define CFS_FAULT_CHECK(id) \ #define CFS_FAULT_CHECK(id) \
CFS_FAIL_CHECK(CFS_FAULT | (id)) CFS_FAIL_CHECK(CFS_FAULT | (id))
/* The idea here is to synchronise two threads to force a race. The /*
* The idea here is to synchronise two threads to force a race. The
* first thread that calls this with a matching fail_loc is put to * first thread that calls this with a matching fail_loc is put to
* sleep. The next thread that calls with the same fail_loc wakes up * sleep. The next thread that calls with the same fail_loc wakes up
* the first and continues. */ * the first and continues.
*/
static inline void cfs_race(__u32 id) static inline void cfs_race(__u32 id)
{ {
......
...@@ -57,8 +57,10 @@ ...@@ -57,8 +57,10 @@
/** disable debug */ /** disable debug */
#define CFS_HASH_DEBUG_NONE 0 #define CFS_HASH_DEBUG_NONE 0
/** record hash depth and output to console when it's too deep, /*
* computing overhead is low but consume more memory */ * record hash depth and output to console when it's too deep,
* computing overhead is low but consume more memory
*/
#define CFS_HASH_DEBUG_1 1 #define CFS_HASH_DEBUG_1 1
/** expensive, check key validation */ /** expensive, check key validation */
#define CFS_HASH_DEBUG_2 2 #define CFS_HASH_DEBUG_2 2
...@@ -153,8 +155,10 @@ enum cfs_hash_tag { ...@@ -153,8 +155,10 @@ enum cfs_hash_tag {
* change on hash table is non-blocking * change on hash table is non-blocking
*/ */
CFS_HASH_NBLK_CHANGE = 1 << 13, CFS_HASH_NBLK_CHANGE = 1 << 13,
/** NB, we typed hs_flags as __u16, please change it /**
* if you need to extend >=16 flags */ * NB, we typed hs_flags as __u16, please change it
* if you need to extend >=16 flags
*/
}; };
/** most used attributes */ /** most used attributes */
...@@ -201,8 +205,10 @@ enum cfs_hash_tag { ...@@ -201,8 +205,10 @@ enum cfs_hash_tag {
*/ */
struct cfs_hash { struct cfs_hash {
/** serialize with rehash, or serialize all operations if /**
* the hash-table has CFS_HASH_NO_BKTLOCK */ * serialize with rehash, or serialize all operations if
* the hash-table has CFS_HASH_NO_BKTLOCK
*/
union cfs_hash_lock hs_lock; union cfs_hash_lock hs_lock;
/** hash operations */ /** hash operations */
struct cfs_hash_ops *hs_ops; struct cfs_hash_ops *hs_ops;
...@@ -369,9 +375,11 @@ cfs_hash_with_add_tail(struct cfs_hash *hs) ...@@ -369,9 +375,11 @@ cfs_hash_with_add_tail(struct cfs_hash *hs)
static inline int static inline int
cfs_hash_with_no_itemref(struct cfs_hash *hs) cfs_hash_with_no_itemref(struct cfs_hash *hs)
{ {
/* hash-table doesn't keep refcount on item, /*
* hash-table doesn't keep refcount on item,
* item can't be removed from hash unless it's * item can't be removed from hash unless it's
* ZERO refcount */ * ZERO refcount
*/
return (hs->hs_flags & CFS_HASH_NO_ITEMREF) != 0; return (hs->hs_flags & CFS_HASH_NO_ITEMREF) != 0;
} }
......
...@@ -280,7 +280,7 @@ do { \ ...@@ -280,7 +280,7 @@ do { \
#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof(*(ptr))) #define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof(*(ptr)))
/** Compile-time assertion. /** Compile-time assertion.
*
* Check an invariant described by a constant expression at compile time by * Check an invariant described by a constant expression at compile time by
* forcing a compiler error if it does not hold. \a cond must be a constant * forcing a compiler error if it does not hold. \a cond must be a constant
* expression as defined by the ISO C Standard: * expression as defined by the ISO C Standard:
...@@ -306,7 +306,8 @@ do { \ ...@@ -306,7 +306,8 @@ do { \
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Light-weight trace * Light-weight trace
* Support for temporary event tracing with minimal Heisenberg effect. * Support for temporary event tracing with minimal Heisenberg effect.
* -------------------------------------------------------------------- */ * --------------------------------------------------------------------
*/
#define MKSTR(ptr) ((ptr)) ? (ptr) : "" #define MKSTR(ptr) ((ptr)) ? (ptr) : ""
......
...@@ -84,9 +84,11 @@ int cfs_expr_list_values(struct cfs_expr_list *expr_list, ...@@ -84,9 +84,11 @@ int cfs_expr_list_values(struct cfs_expr_list *expr_list,
static inline void static inline void
cfs_expr_list_values_free(__u32 *values, int num) cfs_expr_list_values_free(__u32 *values, int num)
{ {
/* This array is allocated by LIBCFS_ALLOC(), so it shouldn't be freed /*
* This array is allocated by LIBCFS_ALLOC(), so it shouldn't be freed
* by OBD_FREE() if it's called by module other than libcfs & LNet, * by OBD_FREE() if it's called by module other than libcfs & LNet,
* otherwise we will see fake memory leak */ * otherwise we will see fake memory leak
*/
LIBCFS_FREE(values, num * sizeof(values[0])); LIBCFS_FREE(values, num * sizeof(values[0]));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment