diff options
Diffstat (limited to 'fs/ocfs2/stackglue.c')
-rw-r--r-- | fs/ocfs2/stackglue.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 07f348b8d721..7150f5dce957 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c | |||
@@ -288,6 +288,26 @@ void ocfs2_dlm_dump_lksb(union ocfs2_dlm_lksb *lksb) | |||
288 | } | 288 | } |
289 | EXPORT_SYMBOL_GPL(ocfs2_dlm_dump_lksb); | 289 | EXPORT_SYMBOL_GPL(ocfs2_dlm_dump_lksb); |
290 | 290 | ||
291 | int ocfs2_stack_supports_plocks(void) | ||
292 | { | ||
293 | return !!(active_stack && active_stack->sp_ops->plock); | ||
294 | } | ||
295 | EXPORT_SYMBOL_GPL(ocfs2_stack_supports_plocks); | ||
296 | |||
297 | /* | ||
298 | * ocfs2_plock() can only be safely called if | ||
299 | * ocfs2_stack_supports_plocks() returned true | ||
300 | */ | ||
301 | int ocfs2_plock(struct ocfs2_cluster_connection *conn, u64 ino, | ||
302 | struct file *file, int cmd, struct file_lock *fl) | ||
303 | { | ||
304 | WARN_ON_ONCE(active_stack->sp_ops->plock == NULL); | ||
305 | if (active_stack->sp_ops->plock) | ||
306 | return active_stack->sp_ops->plock(conn, ino, file, cmd, fl); | ||
307 | return -EOPNOTSUPP; | ||
308 | } | ||
309 | EXPORT_SYMBOL_GPL(ocfs2_plock); | ||
310 | |||
291 | int ocfs2_cluster_connect(const char *stack_name, | 311 | int ocfs2_cluster_connect(const char *stack_name, |
292 | const char *group, | 312 | const char *group, |
293 | int grouplen, | 313 | int grouplen, |