aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/dlm/mount.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2008-03-14 16:09:15 -0400
committerDavid Teigland <teigland@redhat.com>2008-04-21 12:22:28 -0400
commit2402211a8389282fd2942fad4511f02c0eeeffc5 (patch)
tree853e5818a29816e642689d7e793a845d2519711b /fs/gfs2/locking/dlm/mount.c
parentd44e0fc704143624b3e88fbf8fbcfda7a83fd299 (diff)
dlm: move plock code from gfs2
Move the code that handles cluster posix locks from gfs2 into the dlm so that it can be used by both gfs2 and ocfs2. Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/gfs2/locking/dlm/mount.c')
-rw-r--r--fs/gfs2/locking/dlm/mount.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c
index f2efff424224..470bdf650b50 100644
--- a/fs/gfs2/locking/dlm/mount.c
+++ b/fs/gfs2/locking/dlm/mount.c
@@ -236,6 +236,27 @@ static void gdlm_withdraw(void *lockspace)
236 gdlm_kobject_release(ls); 236 gdlm_kobject_release(ls);
237} 237}
238 238
239static int gdlm_plock(void *lockspace, struct lm_lockname *name,
240 struct file *file, int cmd, struct file_lock *fl)
241{
242 struct gdlm_ls *ls = lockspace;
243 return dlm_posix_lock(ls->dlm_lockspace, name->ln_number, file, cmd, fl);
244}
245
246static int gdlm_punlock(void *lockspace, struct lm_lockname *name,
247 struct file *file, struct file_lock *fl)
248{
249 struct gdlm_ls *ls = lockspace;
250 return dlm_posix_unlock(ls->dlm_lockspace, name->ln_number, file, fl);
251}
252
253static int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
254 struct file *file, struct file_lock *fl)
255{
256 struct gdlm_ls *ls = lockspace;
257 return dlm_posix_get(ls->dlm_lockspace, name->ln_number, file, fl);
258}
259
239const struct lm_lockops gdlm_ops = { 260const struct lm_lockops gdlm_ops = {
240 .lm_proto_name = "lock_dlm", 261 .lm_proto_name = "lock_dlm",
241 .lm_mount = gdlm_mount, 262 .lm_mount = gdlm_mount,