/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: */ #ifndef _GKS_INTERNAL_H #define _GKS_INTERNAL_H #define GKS_SERVICE_WATCHDOG_TIMEOUT 30000 struct mdc_rpc_lock { struct semaphore rpcl_sem; struct lookup_intent *rpcl_it; }; static inline void gkc_init_rpc_lock(struct mdc_rpc_lock *lck) { sema_init(&lck->rpcl_sem, 1); lck->rpcl_it = NULL; } static inline void gkc_get_rpc_lock(struct mdc_rpc_lock *lck, struct lookup_intent *it) { ENTRY; down(&lck->rpcl_sem); if (it) { lck->rpcl_it = it; } } static inline void gkc_put_rpc_lock(struct mdc_rpc_lock *lck, struct lookup_intent *it) { EXIT; if (it == NULL) { LASSERT(it == lck->rpcl_it); up(&lck->rpcl_sem); return; } if (it) { LASSERT(it == lck->rpcl_it); lck->rpcl_it = NULL; up(&lck->rpcl_sem); } } #endif /* _GKS_INTERNAL_H */