@@ -3410,7 +3410,7 @@ static void send_args(struct dlm_rsb *r, struct dlm_lkb *lkb,
34103410 ms -> m_remid = cpu_to_le32 (lkb -> lkb_remid );
34113411 ms -> m_exflags = cpu_to_le32 (lkb -> lkb_exflags );
34123412 ms -> m_sbflags = cpu_to_le32 (lkb -> lkb_sbflags );
3413- ms -> m_flags = cpu_to_le32 (lkb -> lkb_flags );
3413+ ms -> m_flags = cpu_to_le32 (dlm_dflags_val ( lkb ) );
34143414 ms -> m_lvbseq = cpu_to_le32 (lkb -> lkb_lvbseq );
34153415 ms -> m_status = cpu_to_le32 (lkb -> lkb_status );
34163416 ms -> m_grmode = cpu_to_le32 (lkb -> lkb_grmode );
@@ -3675,7 +3675,7 @@ static void receive_flags(struct dlm_lkb *lkb, struct dlm_message *ms)
36753675{
36763676 lkb -> lkb_exflags = le32_to_cpu (ms -> m_exflags );
36773677 lkb -> lkb_sbflags = le32_to_cpu (ms -> m_sbflags );
3678- lkb -> lkb_dflags = le32_to_cpu (ms -> m_flags );
3678+ dlm_set_dflags_val ( lkb , le32_to_cpu (ms -> m_flags ) );
36793679}
36803680
36813681static void receive_flags_reply (struct dlm_lkb * lkb , struct dlm_message * ms ,
@@ -3685,7 +3685,7 @@ static void receive_flags_reply(struct dlm_lkb *lkb, struct dlm_message *ms,
36853685 return ;
36863686
36873687 lkb -> lkb_sbflags = le32_to_cpu (ms -> m_sbflags );
3688- lkb -> lkb_dflags = le32_to_cpu (ms -> m_flags );
3688+ dlm_set_dflags_val ( lkb , le32_to_cpu (ms -> m_flags ) );
36893689}
36903690
36913691static int receive_extralen (struct dlm_message * ms )
@@ -3786,8 +3786,8 @@ static int validate_message(struct dlm_lkb *lkb, struct dlm_message *ms)
37863786 int error = 0 ;
37873787
37883788 /* currently mixing of user/kernel locks are not supported */
3789- if (ms -> m_flags & cpu_to_le32 (DLM_DFL_USER ) &&
3790- ~ lkb -> lkb_dflags & DLM_DFL_USER ) {
3789+ if (ms -> m_flags & cpu_to_le32 (BIT ( DLM_DFL_USER_BIT ) ) &&
3790+ ! test_bit ( DLM_DFL_USER_BIT , & lkb -> lkb_dflags ) ) {
37913791 log_error (lkb -> lkb_resource -> res_ls ,
37923792 "got user dlm message for a kernel lock" );
37933793 error = - EINVAL ;
@@ -5345,7 +5345,7 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
53455345 lkb -> lkb_ownpid = le32_to_cpu (rl -> rl_ownpid );
53465346 lkb -> lkb_remid = le32_to_cpu (rl -> rl_lkid );
53475347 lkb -> lkb_exflags = le32_to_cpu (rl -> rl_exflags );
5348- lkb -> lkb_dflags = le32_to_cpu (rl -> rl_flags );
5348+ dlm_set_dflags_val ( lkb , le32_to_cpu (rl -> rl_flags ) );
53495349 lkb -> lkb_flags |= DLM_IFL_MSTCPY ;
53505350 lkb -> lkb_lvbseq = le32_to_cpu (rl -> rl_lvbseq );
53515351 lkb -> lkb_rqmode = rl -> rl_rqmode ;
@@ -5571,9 +5571,9 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
55715571 }
55725572
55735573 /* After ua is attached to lkb it will be freed by dlm_free_lkb().
5574- When DLM_DFL_USER is set, the dlm knows that this is a userspace
5574+ When DLM_DFL_USER_BIT is set, the dlm knows that this is a userspace
55755575 lock and that lkb_astparam is the dlm_user_args structure. */
5576- lkb -> lkb_dflags |= DLM_DFL_USER ;
5576+ set_bit ( DLM_DFL_USER_BIT , & lkb -> lkb_dflags ) ;
55775577 error = request_lock (ls , lkb , name , namelen , & args );
55785578
55795579 switch (error ) {
@@ -5688,7 +5688,7 @@ int dlm_user_adopt_orphan(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
56885688
56895689 lkb = iter ;
56905690 list_del_init (& iter -> lkb_ownqueue );
5691- iter -> lkb_dflags &= ~ DLM_DFL_ORPHAN ;
5691+ clear_bit ( DLM_DFL_ORPHAN_BIT , & iter -> lkb_dflags ) ;
56925692 * lkid = iter -> lkb_id ;
56935693 break ;
56945694 }
@@ -5932,7 +5932,7 @@ static struct dlm_lkb *del_proc_lock(struct dlm_ls *ls,
59325932 list_del_init (& lkb -> lkb_ownqueue );
59335933
59345934 if (lkb -> lkb_exflags & DLM_LKF_PERSISTENT )
5935- lkb -> lkb_dflags |= DLM_DFL_ORPHAN ;
5935+ set_bit ( DLM_DFL_ORPHAN_BIT , & lkb -> lkb_dflags ) ;
59365936 else
59375937 lkb -> lkb_flags |= DLM_IFL_DEAD ;
59385938 out :
@@ -6091,7 +6091,7 @@ int dlm_debug_add_lkb(struct dlm_ls *ls, uint32_t lkb_id, char *name, int len,
60916091 int error ;
60926092
60936093 /* we currently can't set a valid user lock */
6094- if (lkb_dflags & DLM_DFL_USER )
6094+ if (lkb_dflags & BIT ( DLM_DFL_USER_BIT ) )
60956095 return - EOPNOTSUPP ;
60966096
60976097 lksb = kzalloc (sizeof (* lksb ), GFP_NOFS );
@@ -6104,11 +6104,11 @@ int dlm_debug_add_lkb(struct dlm_ls *ls, uint32_t lkb_id, char *name, int len,
61046104 return error ;
61056105 }
61066106
6107- lkb -> lkb_dflags = lkb_dflags ;
6107+ dlm_set_dflags_val ( lkb , lkb_dflags ) ;
61086108 lkb -> lkb_nodeid = lkb_nodeid ;
61096109 lkb -> lkb_lksb = lksb ;
61106110 /* user specific pointer, just don't have it NULL for kernel locks */
6111- if (~lkb_dflags & DLM_DFL_USER )
6111+ if (~lkb_dflags & BIT ( DLM_DFL_USER_BIT ) )
61126112 lkb -> lkb_astparam = (void * )0xDEADBEEF ;
61136113
61146114 error = find_rsb (ls , name , len , 0 , R_REQUEST , & r );
0 commit comments