diff --git a/modules/cas_cache/ocf_env.h b/modules/cas_cache/ocf_env.h index 21a6b81..f14a474 100644 --- a/modules/cas_cache/ocf_env.h +++ b/modules/cas_cache/ocf_env.h @@ -431,6 +431,11 @@ static inline void env_spinlock_lock(env_spinlock *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) { 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_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__ */ diff --git a/ocf b/ocf index 43e8905..9a46c40 160000 --- a/ocf +++ b/ocf @@ -1 +1 @@ -Subproject commit 43e8905456aa0bd4fdf12c3e8aa374c641684471 +Subproject commit 9a46c402b2e8398da7a3ee212faf041b3f01f958