diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2009-02-26 18:00:45 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-04-03 14:39:21 -0400 |
commit | 7d62a978a8c85cd82301615840d744f0d83b87e7 (patch) | |
tree | c8e3e59f85ddbfef31a41e8f966e6e88e9d4890b /fs/ocfs2/dlm | |
parent | 6800791ab773453bdec337efb3f0cec6557f3bb3 (diff) |
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')
-rw-r--r-- | fs/ocfs2/dlm/dlmcommon.h | 21 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 19 |
2 files changed, 18 insertions, 22 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index e5026ce862ad..266fde9354bd 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, | |||
858 | unsigned int len); | 858 | unsigned int len); |
859 | 859 | ||
860 | int dlm_is_host_down(int errno); | 860 | int dlm_is_host_down(int errno); |
861 | void dlm_change_lockres_owner(struct dlm_ctxt *dlm, | 861 | |
862 | struct dlm_lock_resource *res, | ||
863 | u8 owner); | ||
864 | struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm, | 862 | struct dlm_lock_resource * dlm_get_lock_resource(struct dlm_ctxt *dlm, |
865 | const char *lockid, | 863 | const char *lockid, |
866 | int namelen, | 864 | int namelen, |
@@ -1123,6 +1121,23 @@ static inline int dlm_node_iter_next(struct dlm_node_iter *iter) | |||
1123 | return bit; | 1121 | return bit; |
1124 | } | 1122 | } |
1125 | 1123 | ||
1124 | static inline void dlm_set_lockres_owner(struct dlm_ctxt *dlm, | ||
1125 | struct dlm_lock_resource *res, | ||
1126 | u8 owner) | ||
1127 | { | ||
1128 | assert_spin_locked(&res->spinlock); | ||
1129 | |||
1130 | res->owner = owner; | ||
1131 | } | ||
1126 | 1132 | ||
1133 | static inline void dlm_change_lockres_owner(struct dlm_ctxt *dlm, | ||
1134 | struct dlm_lock_resource *res, | ||
1135 | u8 owner) | ||
1136 | { | ||
1137 | assert_spin_locked(&res->spinlock); | ||
1138 | |||
1139 | if (owner != res->owner) | ||
1140 | dlm_set_lockres_owner(dlm, res, owner); | ||
1141 | } | ||
1127 | 1142 | ||
1128 | #endif /* DLMCOMMON_H */ | 1143 | #endif /* DLMCOMMON_H */ |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index d70cdd51de0f..d9c5c5a34007 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -511,25 +511,6 @@ void dlm_destroy_master_caches(void) | |||
511 | kmem_cache_destroy(dlm_lockres_cache); | 511 | kmem_cache_destroy(dlm_lockres_cache); |
512 | } | 512 | } |
513 | 513 | ||
514 | static void dlm_set_lockres_owner(struct dlm_ctxt *dlm, | ||
515 | struct dlm_lock_resource *res, | ||
516 | u8 owner) | ||
517 | { | ||
518 | assert_spin_locked(&res->spinlock); | ||
519 | |||
520 | res->owner = owner; | ||
521 | } | ||
522 | |||
523 | void dlm_change_lockres_owner(struct dlm_ctxt *dlm, | ||
524 | struct dlm_lock_resource *res, u8 owner) | ||
525 | { | ||
526 | assert_spin_locked(&res->spinlock); | ||
527 | |||
528 | if (owner != res->owner) | ||
529 | dlm_set_lockres_owner(dlm, res, owner); | ||
530 | } | ||
531 | |||
532 | |||
533 | static void dlm_lockres_release(struct kref *kref) | 514 | static void dlm_lockres_release(struct kref *kref) |
534 | { | 515 | { |
535 | struct dlm_lock_resource *res; | 516 | struct dlm_lock_resource *res; |