summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/fs_subr.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-02-19 09:05:18 -0800
committerRobert Mustacchi <rm@joyent.com>2015-11-24 16:26:22 -0800
commit7a5aac98bc37534537d4896efd4efd30627d221e (patch)
tree952057632cf0d7aa29610276f7b1df251d564a43 /usr/src/uts/common/fs/fs_subr.c
parent8c6ffd5964f28b15919c0a4ad3d120f84cedbc3d (diff)
downloadillumos-gate-7a5aac98bc37534537d4896efd4efd30627d221e.tar.gz
3252 Need a proper flock() implementation
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/fs/fs_subr.c')
-rw-r--r--usr/src/uts/common/fs/fs_subr.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/fs_subr.c b/usr/src/uts/common/fs/fs_subr.c
index 744d269716..ec5b145a86 100644
--- a/usr/src/uts/common/fs/fs_subr.c
+++ b/usr/src/uts/common/fs/fs_subr.c
@@ -25,6 +25,7 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Joyent, Inc.
*/
/*
@@ -246,6 +247,7 @@ fs_frlock(register vnode_t *vp, int cmd, struct flock64 *bfp, int flag,
int frcmd;
int nlmid;
int error = 0;
+ boolean_t skip_lock = B_FALSE;
flk_callback_t serialize_callback;
int serialize = 0;
v_mode_t mode;
@@ -265,6 +267,17 @@ fs_frlock(register vnode_t *vp, int cmd, struct flock64 *bfp, int flag,
}
break;
+ case F_OFD_GETLK:
+ /*
+ * TBD we do not support remote OFD locks at this time.
+ */
+ if (flag & (F_REMOTELOCK | F_PXFSLOCK)) {
+ error = EINVAL;
+ goto done;
+ }
+ skip_lock = B_TRUE;
+ break;
+
case F_SETLK_NBMAND:
/*
* Are NBMAND locks allowed on this file?
@@ -326,6 +339,20 @@ fs_frlock(register vnode_t *vp, int cmd, struct flock64 *bfp, int flag,
}
break;
+ case F_OFD_SETLK:
+ case F_OFD_SETLKW:
+ case F_FLOCK:
+ case F_FLOCKW:
+ /*
+ * TBD we do not support remote OFD locks at this time.
+ */
+ if (flag & (F_REMOTELOCK | F_PXFSLOCK)) {
+ error = EINVAL;
+ goto done;
+ }
+ skip_lock = B_TRUE;
+ break;
+
case F_HASREMOTELOCKS:
nlmid = GETNLMID(bfp->l_sysid);
if (nlmid != 0) { /* booted as a cluster */
@@ -354,7 +381,8 @@ fs_frlock(register vnode_t *vp, int cmd, struct flock64 *bfp, int flag,
flk_cbp = &serialize_callback;
}
- error = reclock(vp, bfp, frcmd, flag, offset, flk_cbp);
+ if (!skip_lock)
+ error = reclock(vp, bfp, frcmd, flag, offset, flk_cbp);
done:
if (serialize)