2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  23 /*        All Rights Reserved   */
  24 
  25 
  26 /*
  27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28  * Use is subject to license terms.
  29  */
  30 /*
  31  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  32  * Copyright 2015 Joyent, Inc.
  33  */
  34 
  35 #ifndef _SYS_FLOCK_H
  36 #define _SYS_FLOCK_H
  37 
  38 #include <sys/types.h>
  39 #include <sys/fcntl.h>
  40 #include <sys/vnode.h>
  41 #include <sys/t_lock.h>           /* for <sys/callb.h> */
 
 
 251 void    flk_init_callback(flk_callback_t *,
 252                 callb_cpr_t *(*)(flk_cb_when_t, void *), void *);
 253 void    flk_add_callback(flk_callback_t *,
 254                 callb_cpr_t *(*)(flk_cb_when_t, void *), void *,
 255                 flk_callback_t *);
 256 void    flk_del_callback(flk_callback_t *);
 257 callb_cpr_t *flk_invoke_callbacks(flk_callback_t *, flk_cb_when_t);
 258 
 259 /* Zones hooks */
 260 extern  zone_key_t flock_zone_key;
 261 
 262 void    *flk_zone_init(zoneid_t);
 263 void    flk_zone_fini(zoneid_t, void *);
 264 
 265 /* Clustering hooks */
 266 void    cl_flk_set_nlm_status(int nlmid, flk_nlm_status_t nlm_state);
 267 void    cl_flk_remove_locks_by_sysid(int sysid);
 268 int     cl_flk_has_remote_locks_for_nlmid(struct vnode *vp, int nlmid);
 269 void    cl_flk_change_nlm_state_to_unknown(int nlmid);
 270 void    cl_flk_delete_pxfs_locks(struct vfs *vfsp, int pxfsid);
 271 #endif /* _KERNEL */
 272 
 273 #ifdef  __cplusplus
 274 }
 275 #endif
 276 
 277 #endif  /* _SYS_FLOCK_H */
  | 
 
 
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 
  23 /*
  24  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  25  */
  26 
  27 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  28 /*        All Rights Reserved   */
  29 
  30 
  31 /*
  32  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  33  * Use is subject to license terms.
  34  */
  35 /*
  36  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  37  * Copyright 2015 Joyent, Inc.
  38  */
  39 
  40 #ifndef _SYS_FLOCK_H
  41 #define _SYS_FLOCK_H
  42 
  43 #include <sys/types.h>
  44 #include <sys/fcntl.h>
  45 #include <sys/vnode.h>
  46 #include <sys/t_lock.h>           /* for <sys/callb.h> */
 
 
 256 void    flk_init_callback(flk_callback_t *,
 257                 callb_cpr_t *(*)(flk_cb_when_t, void *), void *);
 258 void    flk_add_callback(flk_callback_t *,
 259                 callb_cpr_t *(*)(flk_cb_when_t, void *), void *,
 260                 flk_callback_t *);
 261 void    flk_del_callback(flk_callback_t *);
 262 callb_cpr_t *flk_invoke_callbacks(flk_callback_t *, flk_cb_when_t);
 263 
 264 /* Zones hooks */
 265 extern  zone_key_t flock_zone_key;
 266 
 267 void    *flk_zone_init(zoneid_t);
 268 void    flk_zone_fini(zoneid_t, void *);
 269 
 270 /* Clustering hooks */
 271 void    cl_flk_set_nlm_status(int nlmid, flk_nlm_status_t nlm_state);
 272 void    cl_flk_remove_locks_by_sysid(int sysid);
 273 int     cl_flk_has_remote_locks_for_nlmid(struct vnode *vp, int nlmid);
 274 void    cl_flk_change_nlm_state_to_unknown(int nlmid);
 275 void    cl_flk_delete_pxfs_locks(struct vfs *vfsp, int pxfsid);
 276 
 277 /* Support for the remote stale lock detection */
 278 struct sockaddr;
 279 
 280 typedef int (*sysid_to_host_translator_t)(zoneid_t, sysid_t, struct sockaddr *,
 281     const char **);
 282 
 283 void    flk_add_sysid_to_host_translator(sysid_to_host_translator_t);
 284 #endif /* _KERNEL */
 285 
 286 #ifdef  __cplusplus
 287 }
 288 #endif
 289 
 290 #endif  /* _SYS_FLOCK_H */
  |