Print this page
NEX-3758 Support for remote stale lock detection
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>

@@ -17,11 +17,16 @@
  * fields enclosed by brackets "[]" replaced with your own identifying
  * information: Portions Copyright [yyyy] [name of copyright owner]
  *
  * CDDL HEADER END
  */
+
 /*
+ * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
+ */
+
+/*
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  * Copyright 2015 Joyent, Inc.
  */
 

@@ -41,10 +46,11 @@
 #include <sys/cmn_err.h>
 #include <sys/errno.h>
 #include <sys/systm.h>
 #include <sys/vnode.h>
 #include <sys/share.h>          /* just to get GETSYSID def */
+#include <sys/time.h>
 
 #ifdef  __cplusplus
 extern "C" {
 #endif
 

@@ -80,10 +86,13 @@
                 int             pvertex;        /* index to proc vertex */
                         int     l_status;       /* status described below */
                 flk_nlm_status_t l_nlm_state;   /* state of NLM server */
                 flk_callback_t  *l_callbacks;   /* callbacks, or NULL */
                 zoneid_t        l_zoneid;       /* zone of request */
+        hrtime_t                l_blocker;      /* time when this lock */
+                                                /* started to prevent other */
+                                                /* locks from being set */
                 file_t          *l_ofd;         /* OFD-style reference */
 };
 
 typedef struct  lock_descriptor lock_descriptor_t;
 

@@ -396,10 +405,11 @@
 (lock1)->l_start = (lock2)->l_start; \
 (lock1)->l_end = (lock2)->l_end; \
 (lock1)->l_flock = (lock2)->l_flock; \
 (lock1)->l_zoneid = (lock2)->l_zoneid; \
 (lock1)->pvertex = (lock2)->pvertex; \
+(lock1)->l_blocker = (lock2)->l_blocker; \
 }
 
 /*
  * Clustering
  */