diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2009-02-26 15:00:45 -0800 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-04-03 11:39:21 -0700 |
commit | 7d62a978a8c85cd82301615840d744f0d83b87e7 (patch) | |
tree | c8e3e59f85ddbfef31a41e8f966e6e88e9d4890b /fs/ocfs2/dlm/dlmcommon.h | |
parent | 6800791ab773453bdec337efb3f0cec6557f3bb3 (diff) | |
download | op-kernel-dev-7d62a978a8c85cd82301615840d744f0d83b87e7.zip op-kernel-dev-7d62a978a8c85cd82301615840d744f0d83b87e7.tar.gz |
ocfs2/dlm: dlm_set_lockres_owner() and dlm_change_lockres_owner() inlined
This patch inlines dlm_set_lockres_owner() and dlm_change_lockres_owner().
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmcommon.h')
-rw-r--r-- | fs/ocfs2/dlm/dlmcommon.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index e5026ce..266fde9 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h @@ -858,9 +858,7 @@ struct dlm_lock_resource * dlm_lookup_lockres(struct dlm_ctxt *dlm, unsigned int len); int dlm_is_host_down(int errno); -void dlm_change_lockres_owner(struct dlm_ctxt *dlm, - struct dlm_lock_resource *res, - u8 owner); + struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm, const char *lockid, int namelen, @@ -1123,6 +1121,23 @@ static inline int dlm_node_iter_next(struct dlm_node_iter *iter) return bit; } +static inline void dlm_set_lockres_owner(struct dlm_ctxt *dlm, + struct dlm_lock_resource *res, + u8 owner) +{ + assert_spin_locked(&res->spinlock); + + res->owner = owner; +} +static inline void dlm_change_lockres_owner(struct dlm_ctxt *dlm, + struct dlm_lock_resource *res, + u8 owner) +{ + assert_spin_locked(&res->spinlock); + + if (owner != res->owner) + dlm_set_lockres_owner(dlm, res, owner); +} #endif /* DLMCOMMON_H */ |