ocfs2: replace obsoleted LKM_* dlm level with DLM_LOCK_* constants
PATCH 1/1 ocfs2: replace obsoleted LKM_* dlm level with DLM_LOCK_* constants
Current code still contains obsoleted LKM_* constants for dlm levels, the patch tries to replace the obsoleted ones with DLM_LOCK_* constants which are from <linux/dlmconstants.h>.
Signed-off-by Coly Li <[email protected]>
--- fs/ocfs2/dlm/dlmapi.h | 11 ------- fs/ocfs2/dlm/dlmast.c | 16 +++++----- fs/ocfs2/dlm/dlmcommon.h | 15 +++++---- fs/ocfs2/dlm/dlmconvert.c | 18 ++++++------ fs/ocfs2/dlm/dlmfs.c | 7 ++-- fs/ocfs2/dlm/dlmlock.c | 8 ++-- fs/ocfs2/dlm/dlmrecovery.c | 38 ++++++++++++------------ fs/ocfs2/dlm/dlmthread.c | 20 ++++++------ fs/ocfs2/dlm/dlmunlock.c | 12 ++++---- fs/ocfs2/dlm/userdlm.c | 64 +++++++++++++++++++++--------------------- fs/ocfs2/dlmglue.c | 4 +- fs/ocfs2/locks.c | 4 +- fs/ocfs2/stack_o2cb.c | 24 +--------------- include/linux/dlmconstants.h | 1 + 14 files changed, 106 insertions(+), 136 deletions(-)
fs/ocfs2/dlm/dlmapi.h +0 -11
@@ -115,17 +115,6 @@ struct dlm_lockstatus {char lvb[DLM_LVB_LEN ]; }; -/* Valid lock modes. */ -#define LKM_IVMODE (-1)/* invalid mode */ -#define LKM_NLMODE 0/* null lock */ -#define LKM_CRMODE 1/* concurrent read unsupported */ -#define LKM_CWMODE 2/* concurrent write unsupported */ -#define LKM_PRMODE 3/* protected read */ -#define LKM_PWMODE 4/* protected write unsupported */ -#define LKM_EXMODE 5/* exclusive */ -#define LKM_MAXMODE 5 -#define LKM_MODEMASK 0xff -/* Flags passed to dlmlock and dlmunlock: * reserved: flags used by the "real" dlm * only a few are supported by this dlm
fs/ocfs2/dlm/dlmast.c +8 -8
@@ -68,22 +68,22 @@ static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)assert_spin_locked (&dlm->ast_lock);assert_spin_locked (&lock->spinlock); -if (lock->ml.highest_blocked ==LKM_IVMODE ) +if (lock->ml.highest_blocked ==DLM_LOCK_IV )return 0 ; -BUG_ON (lock->ml.highest_blocked ==LKM_NLMODE ); +BUG_ON (lock->ml.highest_blocked ==DLM_LOCK_NL );if (lock->bast_pending &&list_empty (&lock->bast_list))/* old bast already sent, ok */ return 0 ; -if (lock->ml.type ==LKM_EXMODE ) +if (lock->ml.type ==DLM_LOCK_EX )/* EX blocks anything left, any bast still valid */ return 0 ; -else if (lock->ml.type ==LKM_NLMODE ) +else if (lock->ml.type ==DLM_LOCK_NL )/* NL blocks nothing, no reason to send any bast, cancel it */ return 1 ; -else if (lock->ml.highest_blocked !=LKM_EXMODE ) +else if (lock->ml.highest_blocked !=DLM_LOCK_EX )/* PR only blocks EX */ return 1 ;
@@ -118,7 +118,7 @@ static void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) dlm->name, res->lockname.len, res->lockname.name); lock->bast_pending =0 ;list_del_init (&lock->bast_list); - lock->ml.highest_blocked =LKM_IVMODE ; + lock->ml.highest_blocked =DLM_LOCK_IV ;/* removing lock from list, remove a ref. guaranteed * this won't be the last ref because of the get above, * so res->spinlock will not be taken here */
@@ -385,9 +385,9 @@ do_ast:list_move_tail (&lock->list, &res->granted);mlog (0 ,"ast: adding to granted list... type=%d, " "convert_type=%d\n" , lock->ml.type, lock->ml.convert_type); -if (lock->ml.convert_type !=LKM_IVMODE ) { +if (lock->ml.convert_type !=DLM_LOCK_IV ) { lock->ml.type = lock->ml.convert_type; - lock->ml.convert_type =LKM_IVMODE ; + lock->ml.convert_type =DLM_LOCK_IV ; }else {// should already be there.... }
fs/ocfs2/dlm/dlmcommon.h +8 -7
@@ -26,6 +26,7 @@#define DLMCOMMON_H #include <linux/kref.h> +#include <linux/dlmconstants.h> #define DLM_HB_NODE_DOWN_PRI (0xf000000)#define DLM_HB_NODE_UP_PRI (0x8000000)
@@ -1027,11 +1028,11 @@ int __dlm_lockres_unused(struct dlm_lock_resource *res);static inline const char *dlm_lock_mode_name (int mode) {switch (mode) { -case LKM_EXMODE : +case DLM_LOCK_EX :return "EX" ; -case LKM_PRMODE : +case DLM_LOCK_PR :return "PR" ; -case LKM_NLMODE : +case DLM_LOCK_NL :return "NL" ; }return "UNKNOWN" ;
@@ -1041,16 +1042,16 @@ static inline const char * dlm_lock_mode_name(int mode)static inline int dlm_lock_compatible (int existing,int request) {/* NO_LOCK compatible with all */ -if (request ==LKM_NLMODE || - existing ==LKM_NLMODE ) +if (request ==DLM_LOCK_NL || + existing ==DLM_LOCK_NL )return 1 ;/* EX incompatible with all non-NO_LOCK */ -if (request ==LKM_EXMODE ) +if (request ==DLM_LOCK_EX )return 0 ;/* request must be PR, which is compatible with PR */ -if (existing ==LKM_PRMODE ) +if (existing ==DLM_LOCK_PR )return 1 ;return 0 ;
fs/ocfs2/dlm/dlmconvert.c +9 -9
@@ -136,7 +136,7 @@ static enum dlm_status __dlmconvert_master(struct dlm_ctxt *dlm,spin_lock (&lock->spinlock);/* already converting? */ -if (lock->ml.convert_type !=LKM_IVMODE ) { +if (lock->ml.convert_type !=DLM_LOCK_IV ) {mlog (ML_ERROR ,"attempted to convert a lock with a lock " "conversion pending\n" ); status =DLM_DENIED ;
@@ -153,17 +153,17 @@ static enum dlm_status __dlmconvert_master(struct dlm_ctxt *dlm,if (flags &LKM_VALBLK ) {switch (lock->ml.type) { -case LKM_EXMODE : +case DLM_LOCK_EX :/* EX + LKM_VALBLK + convert == set lvb */ mlog (0 ,"will set lvb: converting %s->%s\n" ,dlm_lock_mode_name (lock->ml.type),dlm_lock_mode_name (type)); lock->lksb->flags |=DLM_LKSB_PUT_LVB ;break ; -case LKM_PRMODE : -case LKM_NLMODE : +case DLM_LOCK_PR : +case DLM_LOCK_NL :/* refetch if new level is not NL */ -if (type >LKM_NLMODE ) { +if (type >DLM_LOCK_NL ) { mlog(0, "will fetch new value into " "lvb: converting %s->%s\n", dlm_lock_mode_name(lock->ml.type),
@@ -251,7 +251,7 @@ void dlm_revert_pending_convert(struct dlm_lock_resource *res, {/* do not alter lock refcount. switching lists. */ list_move_tail (&lock->list, &res->granted); - lock->ml.convert_type =LKM_IVMODE ; + lock->ml.convert_type =DLM_LOCK_IV ; lock->lksb->flags &= ~(DLM_LKSB_GET_LVB |DLM_LKSB_PUT_LVB ); }
@@ -282,7 +282,7 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm,/* will exit this call with spinlock held */ __dlm_wait_on_lockres (res); -if (lock->ml.convert_type !=LKM_IVMODE ) { +if (lock->ml.convert_type !=DLM_LOCK_IV ) {__dlm_print_one_lock_resource (res); mlog(ML_ERROR, "converting a remote lock that is already " "converting! (cookie=%u:%llu, conv=%d)\n",
@@ -300,11 +300,11 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, lock->ml.convert_type = type;if (flags &LKM_VALBLK ) { -if (lock->ml.type ==LKM_EXMODE ) { +if (lock->ml.type ==DLM_LOCK_EX ) { flags |=LKM_PUT_LVB ; lock->lksb->flags |=DLM_LKSB_PUT_LVB ; }else { -if (lock->ml.convert_type ==LKM_NLMODE ) +if (lock->ml.convert_type ==DLM_LOCK_NL ) flags &= ~LKM_VALBLK ;else { flags |=LKM_GET_LVB ;
fs/ocfs2/dlm/dlmfs.c +4 -3
@@ -43,6 +43,7 @@#include <linux/init.h> #include <linux/string.h> #include <linux/backing-dev.h> +#include <linux/dlmconstants.h> #include <asm/uaccess.h>
@@ -95,9 +96,9 @@ static int dlmfs_decode_open_flags(int open_flags, int *flags) {if (open_flags & (O_WRONLY |O_RDWR )) - *level =LKM_EXMODE ; + *level =DLM_LOCK_EX ;else - *level =LKM_PRMODE ; + *level =DLM_LOCK_PR ; *flags =0 ;if (open_flags &O_NONBLOCK )
@@ -169,7 +170,7 @@ static int dlmfs_file_release(struct inode *inode, status =0 ;if (fp) { level = fp->fp_lock_level; -if (level !=LKM_IVMODE ) +if (level !=DLM_LOCK_IV )user_dlm_cluster_unlock (&ip->ip_lockres, level);kfree (fp);
fs/ocfs2/dlm/dlmlock.c +4 -4
@@ -403,8 +403,8 @@ static void dlm_init_lock(struct dlm_lock *newlock, int type,INIT_LIST_HEAD (&newlock->bast_list);spin_lock_init (&newlock->spinlock); newlock->ml.type = type; - newlock->ml.convert_type =LKM_IVMODE ; - newlock->ml.highest_blocked =LKM_IVMODE ; + newlock->ml.convert_type =DLM_LOCK_IV ; + newlock->ml.highest_blocked =DLM_LOCK_IV ; newlock->ml.node = node; newlock->ml.pad1 =0 ; newlock->ml.list =0 ;
@@ -580,7 +580,7 @@ enum dlm_status dlmlock(struct dlm_ctxt *dlm, int mode, } status =DLM_BADPARAM ; -if (mode !=LKM_EXMODE && mode !=LKM_PRMODE && mode !=LKM_NLMODE ) { +if (mode !=DLM_LOCK_EX && mode !=DLM_LOCK_PR && mode !=DLM_LOCK_NL ) {dlm_error (status); goto error; }
@@ -703,7 +703,7 @@ retry_lock:/* LVB requests for non PR, PW or EX locks are * ignored. */ -if (mode <LKM_PRMODE ) +if (mode <DLM_LOCK_PR ) flags &= ~LKM_VALBLK ;else { flags |=LKM_GET_LVB ;
fs/ocfs2/dlm/dlmrecovery.c +19 -19
@@ -1183,12 +1183,12 @@ static int dlm_add_lock_to_array(struct dlm_lock *lock,if (lock->lksb) { ml->flags = lock->lksb->flags;/* send our current lvb */ -if (ml->type ==LKM_EXMODE || - ml->type ==LKM_PRMODE ) { +if (ml->type ==DLM_LOCK_EX || + ml->type ==DLM_LOCK_PR ) {/* if it is already set, this had better be a PR * and it has to match */ if (!dlm_lvb_is_empty (mres->lvb) && - (ml->type ==LKM_EXMODE || + (ml->type ==DLM_LOCK_EX ||memcmp (mres->lvb, lock->lksb->lvb,DLM_LVB_LEN ))) {mlog (ML_ERROR ,"mismatched lvbs!\n" );dlm_print_one_lock_resource (lock->lockres);
@@ -1211,9 +1211,9 @@ static void dlm_add_dummy_lock(struct dlm_ctxt *dlm,struct dlm_lock dummy;memset (&dummy,0 ,sizeof (dummy)); dummy.ml.cookie =0 ; - dummy.ml.type =LKM_IVMODE ; - dummy.ml.convert_type =LKM_IVMODE ; - dummy.ml.highest_blocked =LKM_IVMODE ; + dummy.ml.type =DLM_LOCK_IV ; + dummy.ml.convert_type =DLM_LOCK_IV ; + dummy.ml.highest_blocked =DLM_LOCK_IV ; dummy.lksb =NULL ; dummy.ml.node = dlm->node_num;dlm_add_lock_to_array (&dummy, mres,DLM_BLOCKED_LIST );
@@ -1224,9 +1224,9 @@ static inline int dlm_is_dummy_lock(struct dlm_ctxt *dlm, u8 *nodenum) {if (unlikely (ml->cookie ==0 && - ml->type ==LKM_IVMODE && - ml->convert_type ==LKM_IVMODE && - ml->highest_blocked ==LKM_IVMODE && + ml->type ==DLM_LOCK_IV && + ml->convert_type ==DLM_LOCK_IV && + ml->highest_blocked ==DLM_LOCK_IV && ml->list ==DLM_BLOCKED_LIST )) { *nodenum = ml->node;return 1 ;
@@ -1748,7 +1748,7 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, added++;break ; } -BUG_ON (ml->highest_blocked !=LKM_IVMODE ); +BUG_ON (ml->highest_blocked !=DLM_LOCK_IV ); newlock =NULL ; lksb =NULL ;
@@ -1818,14 +1818,14 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, lksb = newlock->lksb;dlm_lock_attach_lockres (newlock, res); -if (ml->convert_type !=LKM_IVMODE ) { +if (ml->convert_type !=DLM_LOCK_IV ) {BUG_ON (queue != &res->converting); newlock->ml.convert_type = ml->convert_type; } lksb->flags |= (ml->flags & (DLM_LKSB_PUT_LVB |DLM_LKSB_GET_LVB )); -if (ml->type ==LKM_NLMODE ) +if (ml->type ==DLM_LOCK_NL ) goto skip_lvb;if (!dlm_lvb_is_empty (mres->lvb)) {
@@ -1842,10 +1842,10 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, }else {/* otherwise, the node is sending its * most recent valid lvb info */ -BUG_ON (ml->type !=LKM_EXMODE && - ml->type !=LKM_PRMODE ); +BUG_ON (ml->type !=DLM_LOCK_EX && + ml->type !=DLM_LOCK_PR );if (!dlm_lvb_is_empty (res->lvb) && - (ml->type ==LKM_EXMODE || + (ml->type ==DLM_LOCK_EX ||memcmp (res->lvb, mres->lvb,DLM_LVB_LEN ))) {int i; mlog(ML_ERROR, "%s:%.*s: received bad "
@@ -2094,10 +2094,10 @@ static void dlm_finish_local_lockres_recovery(struct dlm_ctxt *dlm,static inline int dlm_lvb_needs_invalidation (struct dlm_lock *lock,int local) {if (local) { -if (lock->ml.type !=LKM_EXMODE && - lock->ml.type !=LKM_PRMODE ) +if (lock->ml.type !=DLM_LOCK_EX && + lock->ml.type !=DLM_LOCK_PR )return 1 ; - }else if (lock->ml.type ==LKM_EXMODE ) + }else if (lock->ml.type ==DLM_LOCK_EX )return 1 ;return 0 ; }
@@ -2428,7 +2428,7 @@ static int dlm_pick_recovery_master(struct dlm_ctxt *dlm) again:memset (&lksb,0 ,sizeof (lksb)); - ret =dlmlock (dlm,LKM_EXMODE , &lksb,LKM_NOQUEUE |LKM_RECOVERY , + ret =dlmlock (dlm,DLM_LOCK_EX , &lksb,LKM_NOQUEUE |LKM_RECOVERY ,DLM_RECOVERY_LOCK_NAME ,DLM_RECOVERY_LOCK_NAME_LEN , dlm_reco_ast, dlm, dlm_reco_bast);
fs/ocfs2/dlm/dlmthread.c +10 -10
@@ -303,7 +303,7 @@ converting: res->lockname.name); target = list_entry(res->converting.next, struct dlm_lock, list); -if (target->ml.convert_type ==LKM_IVMODE ) { +if (target->ml.convert_type ==DLM_LOCK_IV ) {mlog (ML_ERROR ,"%.*s: converting a lock with no " "convert_type!\n" , res->lockname.len, res->lockname.name);BUG ();
@@ -317,7 +317,7 @@ converting: target->ml.convert_type)) { can_grant =0 ;/* queue the BAST if not already */ -if (lock->ml.highest_blocked ==LKM_IVMODE ) { +if (lock->ml.highest_blocked ==DLM_LOCK_IV ) {__dlm_lockres_reserve_ast (res);dlm_queue_bast (dlm, lock); }
@@ -335,7 +335,7 @@ converting:if (!dlm_lock_compatible (lock->ml.type, target->ml.convert_type)) { can_grant =0 ; -if (lock->ml.highest_blocked ==LKM_IVMODE ) { +if (lock->ml.highest_blocked ==DLM_LOCK_IV ) {__dlm_lockres_reserve_ast (res);dlm_queue_bast (dlm, lock); }
@@ -348,7 +348,7 @@ converting:/* we can convert the lock */ if (can_grant) {spin_lock (&target->spinlock); -BUG_ON (target->ml.highest_blocked !=LKM_IVMODE ); +BUG_ON (target->ml.highest_blocked !=DLM_LOCK_IV ); mlog(0, "calling ast for converting lock: %.*s, have: %d, " "granting: %d, node: %u\n", res->lockname.len,
@@ -356,7 +356,7 @@ converting: target->ml.convert_type, target->ml.node); target->ml.type = target->ml.convert_type; - target->ml.convert_type =LKM_IVMODE ; + target->ml.convert_type =DLM_LOCK_IV ;list_move_tail (&target->list, &res->granted);BUG_ON (!target->lksb);
@@ -382,7 +382,7 @@ blocked:continue ;if (!dlm_lock_compatible (lock->ml.type, target->ml.type)) { can_grant =0 ; -if (lock->ml.highest_blocked ==LKM_IVMODE ) { +if (lock->ml.highest_blocked ==DLM_LOCK_IV ) {__dlm_lockres_reserve_ast (res);dlm_queue_bast (dlm, lock); }
@@ -398,7 +398,7 @@ blocked:continue ;if (!dlm_lock_compatible (lock->ml.type, target->ml.type)) { can_grant =0 ; -if (lock->ml.highest_blocked ==LKM_IVMODE ) { +if (lock->ml.highest_blocked ==DLM_LOCK_IV ) {__dlm_lockres_reserve_ast (res);dlm_queue_bast (dlm, lock); }
@@ -411,7 +411,7 @@ blocked:* possible if converting list empty) */ if (can_grant) {spin_lock (&target->spinlock); -BUG_ON (target->ml.highest_blocked !=LKM_IVMODE ); +BUG_ON (target->ml.highest_blocked !=DLM_LOCK_IV ); mlog(0, "calling ast for blocked lock: %.*s, granting: %d, " "node: %u\n", res->lockname.len, res->lockname.name,
@@ -565,9 +565,9 @@ static void dlm_flush_asts(struct dlm_ctxt *dlm)/* get the highest blocked lock, and reset */ spin_lock (&lock->spinlock); -BUG_ON (lock->ml.highest_blocked <=LKM_IVMODE ); +BUG_ON (lock->ml.highest_blocked <=DLM_LOCK_IV ); hi = lock->ml.highest_blocked; - lock->ml.highest_blocked =LKM_IVMODE ; + lock->ml.highest_blocked =DLM_LOCK_IV ;spin_unlock (&lock->spinlock);/* remove from list (including ref) */
fs/ocfs2/dlm/dlmunlock.c +6 -6
@@ -227,7 +227,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,if (actions &DLM_UNLOCK_CLEAR_CONVERT_TYPE ) {mlog (0 ,"clearing convert_type at %smaster node\n" , master_node ?"" :"non-" ); - lock->ml.convert_type =LKM_IVMODE ; + lock->ml.convert_type =DLM_LOCK_IV ; }/* remove the extra ref on lock */
@@ -236,9 +236,9 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, leave: res->state &= ~DLM_LOCK_RES_IN_PROGRESS ;if (!dlm_lock_on_list (&res->converting, lock)) -BUG_ON (lock->ml.convert_type !=LKM_IVMODE ); +BUG_ON (lock->ml.convert_type !=DLM_LOCK_IV );else -BUG_ON (lock->ml.convert_type ==LKM_IVMODE ); +BUG_ON (lock->ml.convert_type ==DLM_LOCK_IV );spin_unlock (&lock->spinlock);spin_unlock (&res->spinlock);wake_up (&res->wq);
@@ -275,7 +275,7 @@ void dlm_commit_pending_cancel(struct dlm_lock_resource *res, struct dlm_lock *lock) {list_move_tail (&lock->list, &res->granted); - lock->ml.convert_type =LKM_IVMODE ; + lock->ml.convert_type =DLM_LOCK_IV ; }
@@ -482,7 +482,7 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data,/* lock was found on queue */ lksb = lock->lksb;if (flags & (LKM_VALBLK |LKM_PUT_LVB ) && - lock->ml.type !=LKM_EXMODE ) + lock->ml.type !=DLM_LOCK_EX ) flags &= ~(LKM_VALBLK |LKM_PUT_LVB );/* unlockast only called on originating node */
@@ -625,7 +625,7 @@ retry:spin_lock (&res->spinlock); is_master = (res->owner == dlm->node_num); -if (flags &LKM_VALBLK && lock->ml.type !=LKM_EXMODE ) +if (flags &LKM_VALBLK && lock->ml.type !=DLM_LOCK_EX ) flags &= ~LKM_VALBLK ;spin_unlock (&res->spinlock);
fs/ocfs2/dlm/userdlm.c +32 -32
192 lines not on this page · raw message
fs/ocfs2/dlmglue.c +2 -2
@@ -392,12 +392,12 @@ static void ocfs2_update_lock_stats(struct ocfs2_lock_res *res, int level,struct timespec ts =current_kernel_time ();unsigned long long time =timespec_to_ns (&ts) - mw->mw_lock_start; -if (level ==LKM_PRMODE ) { +if (level ==DLM_LOCK_PR ) { num = &res->l_lock_num_prmode; sum = &res->l_lock_total_prmode; max = &res->l_lock_max_prmode; failed = &res->l_lock_num_prmode_failed; - }else if (level ==LKM_EXMODE ) { + }else if (level ==DLM_LOCK_EX ) { num = &res->l_lock_num_exmode; sum = &res->l_lock_total_exmode; max = &res->l_lock_max_exmode;
fs/ocfs2/locks.c +2 -2
@@ -51,10 +51,10 @@ static int ocfs2_do_flock(struct file *file, struct inode *inode,mutex_lock (&fp->fp_mutex);if (lockres->l_flags &OCFS2_LOCK_ATTACHED && - lockres->l_level >LKM_NLMODE ) { + lockres->l_level >DLM_LOCK_NL ) {int old_level =0 ; -if (lockres->l_level ==LKM_EXMODE ) +if (lockres->l_level ==DLM_LOCK_EX ) old_level =1 ;if (level == old_level)
fs/ocfs2/stack_o2cb.c +1 -23
@@ -35,31 +35,9 @@ struct o2dlm_private {static struct ocfs2_stack_plugin o2cb_stack; -/* These should be identical */ -#if (DLM_LOCK_IV !=LKM_IVMODE ) -# error Lock modes do not match -#endif -#if (DLM_LOCK_NL !=LKM_NLMODE ) -# error Lock modes do not match -#endif -#if (DLM_LOCK_CR !=LKM_CRMODE ) -# error Lock modes do not match -#endif -#if (DLM_LOCK_CW !=LKM_CWMODE ) -# error Lock modes do not match -#endif -#if (DLM_LOCK_PR !=LKM_PRMODE ) -# error Lock modes do not match -#endif -#if (DLM_LOCK_PW !=LKM_PWMODE ) -# error Lock modes do not match -#endif -#if (DLM_LOCK_EX !=LKM_EXMODE ) -# error Lock modes do not match -#endif static inline int mode_to_o2dlm (int mode) { -BUG_ON (mode >LKM_MAXMODE ); +BUG_ON (mode >DLM_LOCK_MAX );return mode; }
include/linux/dlmconstants.h +1 -0
@@ -33,6 +33,7 @@#define DLM_LOCK_PR 3/* protected read */ #define DLM_LOCK_PW 4/* protected write */ #define DLM_LOCK_EX 5/* exclusive */ +#define DLM_LOCK_MAX 5/*
Signature · 2 lines
Coly Li SuSE PRC Labs