Merge pull request #100 from arutk/env_exec_ctx_trylock
Enabling per-CPU freelists
This commit is contained in:
@@ -431,6 +431,11 @@ static inline void env_spinlock_lock(env_spinlock *l)
|
|||||||
spin_lock(l);
|
spin_lock(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int env_spinlock_trylock(env_spinlock *l)
|
||||||
|
{
|
||||||
|
return spin_trylock(l) ? 0 : -OCF_ERR_NO_LOCK;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void env_spinlock_unlock(env_spinlock *l)
|
static inline void env_spinlock_unlock(env_spinlock *l)
|
||||||
{
|
{
|
||||||
spin_unlock(l);
|
spin_unlock(l);
|
||||||
@@ -616,4 +621,21 @@ static inline uint32_t env_crc32(uint32_t crc, uint8_t const *data, size_t len)
|
|||||||
#define ENV_BUG() BUG()
|
#define ENV_BUG() BUG()
|
||||||
#define ENV_BUG_ON(cond) BUG_ON(cond)
|
#define ENV_BUG_ON(cond) BUG_ON(cond)
|
||||||
|
|
||||||
|
|
||||||
|
/* *** EXECUTION COTNEXT *** */
|
||||||
|
static inline unsigned env_get_execution_context(void)
|
||||||
|
{
|
||||||
|
return get_cpu();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void env_put_execution_context(unsigned ctx)
|
||||||
|
{
|
||||||
|
put_cpu();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline unsigned env_get_execution_context_count(void)
|
||||||
|
{
|
||||||
|
return num_online_cpus();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __OCF_ENV_H__ */
|
#endif /* __OCF_ENV_H__ */
|
||||||
|
|||||||
2
ocf
2
ocf
Submodule ocf updated: 43e8905456...9a46c402b2
Reference in New Issue
Block a user