5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
28
29 #ifndef _NFS_RNODE4_H
30 #define _NFS_RNODE4_H
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #include <nfs/rnode.h> /* for symlink_cache, nfs_rwlock_t, etc. */
37 #include <nfs/nfs4.h>
38 #include <nfs/nfs4_clnt.h>
39 #include <sys/thread.h>
40 #include <sys/sysmacros.h> /* for offsetof */
41
42 typedef enum nfs4_stub_type {
43 NFS4_STUB_NONE,
44 NFS4_STUB_MIRRORMOUNT,
370 #define RTOV4(rp) ((rp)->r_vnode)
371 #define VTOR4(vp) ((rnode4_t *)((vp)->v_data))
372
373 #define RP_ISSTUB(rp) (((rp)->r_stub_type != NFS4_STUB_NONE))
374 #define RP_ISSTUB_MIRRORMOUNT(rp) ((rp)->r_stub_type == NFS4_STUB_MIRRORMOUNT)
375 #define RP_ISSTUB_REFERRAL(rp) ((rp)->r_stub_type == NFS4_STUB_REFERRAL)
376
377 /*
378 * Open file instances.
379 */
380
381 typedef struct nfs4_opinst {
382 struct nfs4_opinst *re_next; /* next in list */
383 vnode_t *re_vp; /* held reference */
384 uint32_t re_numosp; /* number of valid open streams */
385 nfs4_open_stream_t **re_osp; /* held reference */
386 } nfs4_opinst_t;
387
388 #ifdef _KERNEL
389
390 extern long nrnode;
391
392 /* Used for r_delay_interval */
393 #define NFS4_INITIAL_DELAY_INTERVAL 1
394 #define NFS4_MAX_DELAY_INTERVAL 20
395
396 /* Used for check_rtable4 */
397 #define NFSV4_RTABLE4_OK 0
398 #define NFSV4_RTABLE4_NOT_FREE_LIST 1
399 #define NFSV4_RTABLE4_DIRTY_PAGES 2
400 #define NFSV4_RTABLE4_POS_R_COUNT 3
401
402 extern rnode4_t *r4find(r4hashq_t *, nfs4_sharedfh_t *, struct vfs *);
403 extern rnode4_t *r4find_unlocked(nfs4_sharedfh_t *, struct vfs *);
404 extern void r4flush(struct vfs *, cred_t *);
405 extern void destroy_rtable4(struct vfs *, cred_t *);
406 extern int check_rtable4(struct vfs *);
407 extern void rp4_addfree(rnode4_t *, cred_t *);
408 extern void rp4_addhash(rnode4_t *);
409 extern void rp4_rmhash(rnode4_t *);
410 extern void rp4_rmhash_locked(rnode4_t *);
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25 /*
26 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
27 */
28
29 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
30 /* All Rights Reserved */
31
32 #ifndef _NFS_RNODE4_H
33 #define _NFS_RNODE4_H
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #include <nfs/rnode.h> /* for symlink_cache, nfs_rwlock_t, etc. */
40 #include <nfs/nfs4.h>
41 #include <nfs/nfs4_clnt.h>
42 #include <sys/thread.h>
43 #include <sys/sysmacros.h> /* for offsetof */
44
45 typedef enum nfs4_stub_type {
46 NFS4_STUB_NONE,
47 NFS4_STUB_MIRRORMOUNT,
373 #define RTOV4(rp) ((rp)->r_vnode)
374 #define VTOR4(vp) ((rnode4_t *)((vp)->v_data))
375
376 #define RP_ISSTUB(rp) (((rp)->r_stub_type != NFS4_STUB_NONE))
377 #define RP_ISSTUB_MIRRORMOUNT(rp) ((rp)->r_stub_type == NFS4_STUB_MIRRORMOUNT)
378 #define RP_ISSTUB_REFERRAL(rp) ((rp)->r_stub_type == NFS4_STUB_REFERRAL)
379
380 /*
381 * Open file instances.
382 */
383
384 typedef struct nfs4_opinst {
385 struct nfs4_opinst *re_next; /* next in list */
386 vnode_t *re_vp; /* held reference */
387 uint32_t re_numosp; /* number of valid open streams */
388 nfs4_open_stream_t **re_osp; /* held reference */
389 } nfs4_opinst_t;
390
391 #ifdef _KERNEL
392
393 extern volatile long nrnode;
394
395 /* Used for r_delay_interval */
396 #define NFS4_INITIAL_DELAY_INTERVAL 1
397 #define NFS4_MAX_DELAY_INTERVAL 20
398
399 /* Used for check_rtable4 */
400 #define NFSV4_RTABLE4_OK 0
401 #define NFSV4_RTABLE4_NOT_FREE_LIST 1
402 #define NFSV4_RTABLE4_DIRTY_PAGES 2
403 #define NFSV4_RTABLE4_POS_R_COUNT 3
404
405 extern rnode4_t *r4find(r4hashq_t *, nfs4_sharedfh_t *, struct vfs *);
406 extern rnode4_t *r4find_unlocked(nfs4_sharedfh_t *, struct vfs *);
407 extern void r4flush(struct vfs *, cred_t *);
408 extern void destroy_rtable4(struct vfs *, cred_t *);
409 extern int check_rtable4(struct vfs *);
410 extern void rp4_addfree(rnode4_t *, cred_t *);
411 extern void rp4_addhash(rnode4_t *);
412 extern void rp4_rmhash(rnode4_t *);
413 extern void rp4_rmhash_locked(rnode4_t *);
|