aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/dlmglue.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 7eb40a02c5af..7532f80b87bc 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -96,9 +96,6 @@ struct ocfs2_unblock_ctl {
96 enum ocfs2_unblock_action unblock_action; 96 enum ocfs2_unblock_action unblock_action;
97}; 97};
98 98
99/* so far, all locks have gotten along with the same unlock ast */
100static void ocfs2_unlock_ast_func(void *opaque,
101 enum dlm_status status);
102static int ocfs2_unblock_meta(struct ocfs2_lock_res *lockres, 99static int ocfs2_unblock_meta(struct ocfs2_lock_res *lockres,
103 struct ocfs2_unblock_ctl *ctl); 100 struct ocfs2_unblock_ctl *ctl);
104static int ocfs2_unblock_data(struct ocfs2_lock_res *lockres, 101static int ocfs2_unblock_data(struct ocfs2_lock_res *lockres,
@@ -120,7 +117,6 @@ static void ocfs2_dentry_post_unlock(struct ocfs2_super *osb,
120 */ 117 */
121struct ocfs2_lock_res_ops { 118struct ocfs2_lock_res_ops {
122 void (*bast)(void *, int); 119 void (*bast)(void *, int);
123 void (*unlock_ast)(void *, enum dlm_status);
124 int (*unblock)(struct ocfs2_lock_res *, struct ocfs2_unblock_ctl *); 120 int (*unblock)(struct ocfs2_lock_res *, struct ocfs2_unblock_ctl *);
125 void (*post_unlock)(struct ocfs2_super *, struct ocfs2_lock_res *); 121 void (*post_unlock)(struct ocfs2_super *, struct ocfs2_lock_res *);
126 122
@@ -149,42 +145,36 @@ static int ocfs2_generic_unblock_lock(struct ocfs2_super *osb,
149 145
150static struct ocfs2_lock_res_ops ocfs2_inode_rw_lops = { 146static struct ocfs2_lock_res_ops ocfs2_inode_rw_lops = {
151 .bast = ocfs2_inode_bast_func, 147 .bast = ocfs2_inode_bast_func,
152 .unlock_ast = ocfs2_unlock_ast_func,
153 .unblock = ocfs2_unblock_inode_lock, 148 .unblock = ocfs2_unblock_inode_lock,
154 .flags = 0, 149 .flags = 0,
155}; 150};
156 151
157static struct ocfs2_lock_res_ops ocfs2_inode_meta_lops = { 152static struct ocfs2_lock_res_ops ocfs2_inode_meta_lops = {
158 .bast = ocfs2_inode_bast_func, 153 .bast = ocfs2_inode_bast_func,
159 .unlock_ast = ocfs2_unlock_ast_func,
160 .unblock = ocfs2_unblock_meta, 154 .unblock = ocfs2_unblock_meta,
161 .flags = LOCK_TYPE_REQUIRES_REFRESH, 155 .flags = LOCK_TYPE_REQUIRES_REFRESH,
162}; 156};
163 157
164static struct ocfs2_lock_res_ops ocfs2_inode_data_lops = { 158static struct ocfs2_lock_res_ops ocfs2_inode_data_lops = {
165 .bast = ocfs2_inode_bast_func, 159 .bast = ocfs2_inode_bast_func,
166 .unlock_ast = ocfs2_unlock_ast_func,
167 .unblock = ocfs2_unblock_data, 160 .unblock = ocfs2_unblock_data,
168 .flags = 0, 161 .flags = 0,
169}; 162};
170 163
171static struct ocfs2_lock_res_ops ocfs2_super_lops = { 164static struct ocfs2_lock_res_ops ocfs2_super_lops = {
172 .bast = ocfs2_super_bast_func, 165 .bast = ocfs2_super_bast_func,
173 .unlock_ast = ocfs2_unlock_ast_func,
174 .unblock = ocfs2_unblock_osb_lock, 166 .unblock = ocfs2_unblock_osb_lock,
175 .flags = LOCK_TYPE_REQUIRES_REFRESH, 167 .flags = LOCK_TYPE_REQUIRES_REFRESH,
176}; 168};
177 169
178static struct ocfs2_lock_res_ops ocfs2_rename_lops = { 170static struct ocfs2_lock_res_ops ocfs2_rename_lops = {
179 .bast = ocfs2_rename_bast_func, 171 .bast = ocfs2_rename_bast_func,
180 .unlock_ast = ocfs2_unlock_ast_func,
181 .unblock = ocfs2_unblock_osb_lock, 172 .unblock = ocfs2_unblock_osb_lock,
182 .flags = 0, 173 .flags = 0,
183}; 174};
184 175
185static struct ocfs2_lock_res_ops ocfs2_dentry_lops = { 176static struct ocfs2_lock_res_ops ocfs2_dentry_lops = {
186 .bast = ocfs2_dentry_bast_func, 177 .bast = ocfs2_dentry_bast_func,
187 .unlock_ast = ocfs2_unlock_ast_func,
188 .unblock = ocfs2_unblock_dentry_lock, 178 .unblock = ocfs2_unblock_dentry_lock,
189 .post_unlock = ocfs2_dentry_post_unlock, 179 .post_unlock = ocfs2_dentry_post_unlock,
190 .flags = 0, 180 .flags = 0,
@@ -2221,7 +2211,7 @@ void ocfs2_dlm_shutdown(struct ocfs2_super *osb)
2221 mlog_exit_void(); 2211 mlog_exit_void();
2222} 2212}
2223 2213
2224static void ocfs2_unlock_ast_func(void *opaque, enum dlm_status status) 2214static void ocfs2_unlock_ast(void *opaque, enum dlm_status status)
2225{ 2215{
2226 struct ocfs2_lock_res *lockres = opaque; 2216 struct ocfs2_lock_res *lockres = opaque;
2227 unsigned long flags; 2217 unsigned long flags;
@@ -2345,7 +2335,7 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
2345 mlog(0, "lock %s\n", lockres->l_name); 2335 mlog(0, "lock %s\n", lockres->l_name);
2346 2336
2347 status = dlmunlock(osb->dlm, &lockres->l_lksb, LKM_VALBLK, 2337 status = dlmunlock(osb->dlm, &lockres->l_lksb, LKM_VALBLK,
2348 lockres->l_ops->unlock_ast, lockres); 2338 ocfs2_unlock_ast, lockres);
2349 if (status != DLM_NORMAL) { 2339 if (status != DLM_NORMAL) {
2350 ocfs2_log_dlm_error("dlmunlock", status, lockres); 2340 ocfs2_log_dlm_error("dlmunlock", status, lockres);
2351 mlog(ML_ERROR, "lockres flags: %lu\n", lockres->l_flags); 2341 mlog(ML_ERROR, "lockres flags: %lu\n", lockres->l_flags);
@@ -2560,7 +2550,7 @@ static int ocfs2_cancel_convert(struct ocfs2_super *osb,
2560 status = dlmunlock(osb->dlm, 2550 status = dlmunlock(osb->dlm,
2561 &lockres->l_lksb, 2551 &lockres->l_lksb,
2562 LKM_CANCEL, 2552 LKM_CANCEL,
2563 lockres->l_ops->unlock_ast, 2553 ocfs2_unlock_ast,
2564 lockres); 2554 lockres);
2565 if (status != DLM_NORMAL) { 2555 if (status != DLM_NORMAL) {
2566 ocfs2_log_dlm_error("dlmunlock", status, lockres); 2556 ocfs2_log_dlm_error("dlmunlock", status, lockres);