@@ -135,6 +135,11 @@ struct ocfs2_lock_res_ops {
135
135
*/
136
136
#define LOCK_TYPE_REQUIRES_REFRESH 0x1
137
137
138
+ /*
139
+ * Indicate that a lock type makes use of the lock value block.
140
+ */
141
+ #define LOCK_TYPE_USES_LVB 0x2
142
+
138
143
typedef int (ocfs2_convert_worker_t )(struct ocfs2_lock_res * , int );
139
144
static int ocfs2_generic_unblock_lock (struct ocfs2_super * osb ,
140
145
struct ocfs2_lock_res * lockres ,
@@ -150,7 +155,7 @@ static struct ocfs2_lock_res_ops ocfs2_inode_rw_lops = {
150
155
static struct ocfs2_lock_res_ops ocfs2_inode_meta_lops = {
151
156
.get_osb = ocfs2_get_inode_osb ,
152
157
.unblock = ocfs2_unblock_meta ,
153
- .flags = LOCK_TYPE_REQUIRES_REFRESH ,
158
+ .flags = LOCK_TYPE_REQUIRES_REFRESH | LOCK_TYPE_USES_LVB ,
154
159
};
155
160
156
161
static struct ocfs2_lock_res_ops ocfs2_inode_data_lops = {
@@ -870,6 +875,9 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb,
870
875
871
876
ocfs2_init_mask_waiter (& mw );
872
877
878
+ if (lockres -> l_ops -> flags & LOCK_TYPE_USES_LVB )
879
+ lkm_flags |= LKM_VALBLK ;
880
+
873
881
again :
874
882
wait = 0 ;
875
883
@@ -937,7 +945,7 @@ static int ocfs2_cluster_lock(struct ocfs2_super *osb,
937
945
status = dlmlock (osb -> dlm ,
938
946
level ,
939
947
& lockres -> l_lksb ,
940
- lkm_flags |LKM_CONVERT | LKM_VALBLK ,
948
+ lkm_flags |LKM_CONVERT ,
941
949
lockres -> l_name ,
942
950
OCFS2_LOCK_ID_MAX_LEN - 1 ,
943
951
ocfs2_locking_ast ,
@@ -2212,11 +2220,15 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
2212
2220
{
2213
2221
enum dlm_status status ;
2214
2222
unsigned long flags ;
2223
+ int lkm_flags = 0 ;
2215
2224
2216
2225
/* We didn't get anywhere near actually using this lockres. */
2217
2226
if (!(lockres -> l_flags & OCFS2_LOCK_INITIALIZED ))
2218
2227
goto out ;
2219
2228
2229
+ if (lockres -> l_ops -> flags & LOCK_TYPE_USES_LVB )
2230
+ lkm_flags |= LKM_VALBLK ;
2231
+
2220
2232
spin_lock_irqsave (& lockres -> l_lock , flags );
2221
2233
2222
2234
mlog_bug_on_msg (!(lockres -> l_flags & OCFS2_LOCK_FREEING ),
@@ -2266,7 +2278,7 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
2266
2278
2267
2279
mlog (0 , "lock %s\n" , lockres -> l_name );
2268
2280
2269
- status = dlmunlock (osb -> dlm , & lockres -> l_lksb , LKM_VALBLK ,
2281
+ status = dlmunlock (osb -> dlm , & lockres -> l_lksb , lkm_flags ,
2270
2282
ocfs2_unlock_ast , lockres );
2271
2283
if (status != DLM_NORMAL ) {
2272
2284
ocfs2_log_dlm_error ("dlmunlock" , status , lockres );
0 commit comments