Freelist test
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -150,28 +150,25 @@ void env_completion_complete(env_completion *completion)
|
||||
|
||||
int env_mutex_init(env_mutex *mutex)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(mutex);
|
||||
return mock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int env_mutex_destroy(env_mutex *mutex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void env_mutex_lock(env_mutex *mutex)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(mutex);
|
||||
}
|
||||
|
||||
int env_mutex_lock_interruptible(env_mutex *mutex)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(mutex);
|
||||
return mock();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void env_mutex_unlock(env_mutex *mutex)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(mutex);
|
||||
}
|
||||
|
||||
int env_rmutex_init(env_rmutex *rmutex)
|
||||
@@ -361,22 +358,27 @@ long env_atomic64_cmpxchg(env_atomic64 *a, long old, long new)
|
||||
return oldval;
|
||||
}
|
||||
|
||||
void env_spinlock_init(env_spinlock *l)
|
||||
int env_spinlock_init(env_spinlock *l)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(l);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int env_spinlock_destroy(env_spinlock *l)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void env_spinlock_lock(env_spinlock *l)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(l);
|
||||
}
|
||||
|
||||
int env_spinlock_trylock(env_spinlock *l)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void env_spinlock_unlock(env_spinlock *l)
|
||||
{
|
||||
function_called();
|
||||
check_expected_ptr(l);
|
||||
}
|
||||
|
||||
void env_rwlock_init(env_rwlock *l)
|
||||
@@ -535,3 +537,7 @@ uint32_t env_crc32(uint32_t crc, uint8_t const *data, size_t len)
|
||||
check_expected_ptr(data);
|
||||
return mock();
|
||||
}
|
||||
|
||||
void env_cond_resched(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -71,7 +71,13 @@ typedef uint64_t sector_t;
|
||||
abort(); \
|
||||
})
|
||||
|
||||
#define ENV_BUG_ON(cond) bug_on((int)cond);
|
||||
#define ENV_BUG_ON(cond) ({ \
|
||||
int eval = cond; \
|
||||
if (eval) { \
|
||||
print_message("%s:%u BUG: %s\n", __FILE__, __LINE__, #cond); \
|
||||
bug_on(eval); \
|
||||
} \
|
||||
})
|
||||
|
||||
#define container_of(ptr, type, member) ({ \
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
@@ -128,6 +134,8 @@ typedef struct {
|
||||
|
||||
int env_mutex_init(env_mutex *mutex);
|
||||
|
||||
int env_mutex_destroy(env_mutex *mutex);
|
||||
|
||||
void env_mutex_lock(env_mutex *mutex);
|
||||
|
||||
int env_mutex_lock_interruptible(env_mutex *mutex);
|
||||
@@ -231,10 +239,14 @@ void env_completion_complete(env_completion *completion);
|
||||
typedef struct {
|
||||
} env_spinlock;
|
||||
|
||||
void env_spinlock_init(env_spinlock *l);
|
||||
int env_spinlock_init(env_spinlock *l);
|
||||
|
||||
int env_spinlock_destroy(env_spinlock *l);
|
||||
|
||||
void env_spinlock_lock(env_spinlock *l);
|
||||
|
||||
int env_spinlock_trylock(env_spinlock *l);
|
||||
|
||||
void env_spinlock_unlock(env_spinlock *l);
|
||||
|
||||
#define env_spinlock_lock_irqsave(l, flags) \
|
||||
@@ -327,4 +339,6 @@ void env_msleep(uint64_t n);
|
||||
|
||||
uint32_t env_crc32(uint32_t crc, uint8_t const *data, size_t len);
|
||||
|
||||
void env_cond_resched(void);
|
||||
|
||||
#endif /* __OCF_ENV_H__ */
|
||||
|
||||
Reference in New Issue
Block a user