Print this page
re #13613 rb4516 Tunables needs volatile keyword
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/nfs/rnode4.h
+++ new/usr/src/uts/common/nfs/rnode4.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 +/*
26 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
27 + */
25 28
26 29 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 30 /* All Rights Reserved */
28 31
29 32 #ifndef _NFS_RNODE4_H
30 33 #define _NFS_RNODE4_H
31 34
32 35 #ifdef __cplusplus
33 36 extern "C" {
34 37 #endif
35 38
36 39 #include <nfs/rnode.h> /* for symlink_cache, nfs_rwlock_t, etc. */
37 40 #include <nfs/nfs4.h>
38 41 #include <nfs/nfs4_clnt.h>
39 42 #include <sys/thread.h>
40 43 #include <sys/sysmacros.h> /* for offsetof */
41 44
42 45 typedef enum nfs4_stub_type {
43 46 NFS4_STUB_NONE,
44 47 NFS4_STUB_MIRRORMOUNT,
45 48 NFS4_STUB_REFERRAL
46 49 } nfs4_stub_type_t;
47 50
48 51 typedef enum nfs4_access_type {
49 52 NFS4_ACCESS_UNKNOWN,
50 53 NFS4_ACCESS_ALLOWED,
51 54 NFS4_ACCESS_DENIED
52 55 } nfs4_access_type_t;
53 56
54 57 /*
55 58 * Access cache
56 59 */
57 60 typedef struct acache4_hash {
58 61 struct acache4 *next;
59 62 struct acache4 *prev;
60 63 krwlock_t lock;
61 64 } acache4_hash_t;
62 65
63 66 typedef struct acache4 {
64 67 struct acache4 *next; /* next and prev must be first */
65 68 struct acache4 *prev;
66 69 uint32_t known;
67 70 uint32_t allowed;
68 71 struct rnode4 *rnode;
69 72 cred_t *cred;
70 73 struct acache4 *list;
71 74 struct acache4_hash *hashq;
72 75 } acache4_t;
73 76
74 77 /*
75 78 * Note on the different buffer sizes in rddir4_cache:
76 79 * There seems to be some discrepancy between the intended and actual
77 80 * use of entlen and buflen, which does not correspond to the comment below.
78 81 * entlen - nfsv2/3 used as both alloc'd size of entries buffer and
79 82 * as the actual size of the entries (XXX is this correct?).
80 83 * nfsv4 will use it only as the alloc'd size.
81 84 * buflen - used for calculations of readahead.
82 85 * actlen - added for nfsv4 to serve as the size of the useful
83 86 * portion of the entries buffer. That is because in
84 87 * nfsv4, the otw entries are converted to system entries,
85 88 * and may not be the same size - thus buffer may not be full.
86 89 */
87 90 typedef struct rddir4_cache {
88 91 lloff_t _cookie; /* cookie used to find this cache entry */
89 92 lloff_t _ncookie; /* cookie used to find the next cache entry */
90 93 char *entries; /* buffer containing dirent entries */
91 94 int eof; /* EOF reached after this request */
92 95 int entlen; /* size of dirent entries in buf */
93 96 int buflen; /* size of the buffer used to store entries */
94 97 int actlen; /* size of the actual entries (nfsv4 only) */
95 98 int flags; /* control flags, see below */
96 99 kcondvar_t cv; /* cv for blocking */
97 100 int error; /* error from RPC operation */
98 101 void *data; /* private data */
99 102 } rddir4_cache;
100 103
101 104 #define nfs4_cookie _cookie._f
102 105 #define nfs4_ncookie _ncookie._f
103 106
104 107 /*
105 108 * Shadow vnode, v4 only.
106 109 *
107 110 * A file's shadow vnode list is protected by its hash bucket lock,
108 111 * r_hashq->r_lock.
109 112 *
110 113 * sv_r_vnode is protected by the appropriate vnode locks.
111 114 *
112 115 * sv_dfh, sv_name, sv_dfileid, and sv_dfileid_valid are protected
113 116 * by rp->r_svlock.
114 117 */
115 118
116 119 typedef struct insq_link {
117 120 void *forw;
118 121 void *back;
119 122 } insq_link_t;
120 123
121 124 typedef struct svnode {
122 125 insq_link_t sv_link; /* must be first for insque */
123 126 vnode_t *sv_r_vnode; /* vnode for this shadow */
124 127 nfs4_fname_t *sv_name; /* component name */
125 128 nfs4_sharedfh_t *sv_dfh; /* directory file handle */
126 129 } svnode_t;
127 130
128 131 #define sv_forw sv_link.forw
129 132 #define sv_back sv_link.back
130 133 extern svnode_t *vtosv(vnode_t *);
131 134 #define VTOSV(vp) vtosv(vp)
132 135 #define SVTOV(svp) (((svp)->sv_r_vnode))
133 136 #define IS_SHADOW(vp, rp) ((vp) != (rp)->r_vnode)
134 137
135 138 /*
136 139 * The format of the hash bucket used to lookup rnodes from a file handle.
137 140 */
138 141 typedef struct r4hashq {
139 142 struct rnode4 *r_hashf;
140 143 struct rnode4 *r_hashb;
141 144 krwlock_t r_lock;
142 145 } r4hashq_t;
143 146
144 147 /*
145 148 * Remote file information structure.
146 149 *
147 150 * The rnode is the "inode" for remote files. It contains all the
148 151 * information necessary to handle remote file on the client side.
149 152 *
150 153 * Note on file sizes: we keep two file sizes in the rnode: the size
151 154 * according to the client (r_size) and the size according to the server
152 155 * (r_attr.va_size). They can differ because we modify r_size during a
153 156 * write system call (nfs_rdwr), before the write request goes over the
154 157 * wire (before the file is actually modified on the server). If an OTW
155 158 * request occurs before the cached data is written to the server the file
156 159 * size returned from the server (r_attr.va_size) may not match r_size.
157 160 * r_size is the one we use, in general. r_attr.va_size is only used to
158 161 * determine whether or not our cached data is valid.
159 162 *
160 163 * Each rnode has 5 locks associated with it (not including the rnode
161 164 * hash table and free list locks):
162 165 *
163 166 * r_rwlock: Serializes nfs_write and nfs_setattr requests
164 167 * and allows nfs_read requests to proceed in parallel.
165 168 * Serializes reads/updates to directories.
166 169 *
167 170 * r_lkserlock: Serializes lock requests with map, write, and
168 171 * readahead operations.
169 172 *
170 173 * r_statelock: Protects all fields in the rnode except for
171 174 * those listed below. This lock is intented
172 175 * to be held for relatively short periods of
173 176 * time (not accross entire putpage operations,
174 177 * for example).
175 178 *
176 179 * r_statev4_lock: Protects the created_v4 flag, the lock_owners list,
177 180 * and all the delegation fields except r_deleg_list.
178 181 *
179 182 * r_os_lock: Protects r_open_streams.
180 183 *
181 184 *
182 185 * The following members are protected by the mutex rp4freelist_lock:
183 186 * r_freef
184 187 * r_freeb
185 188 *
186 189 * The following members are protected by the hash bucket rwlock:
187 190 * r_hashf
188 191 * r_hashb
189 192 *
190 193 * r_fh is read-only except when an rnode is created (or recycled from the
191 194 * free list).
192 195 *
193 196 * The following members are protected by nfs4_server_t::s_lock:
194 197 * r_deleg_list
195 198 *
196 199 * Note: r_modaddr is only accessed when the r_statelock mutex is held.
197 200 * Its value is also controlled via r_rwlock. It is assumed that
198 201 * there will be only 1 writer active at a time, so it safe to
199 202 * set r_modaddr and release r_statelock as long as the r_rwlock
200 203 * writer lock is held.
201 204 *
202 205 * r_inmap informs nfs4_read()/write() that there is a call to nfs4_map()
203 206 * in progress. nfs4_read()/write() check r_inmap to decide whether
204 207 * to perform directio on the file or not. r_inmap is atomically
205 208 * incremented in nfs4_map() before the address space routines are
206 209 * called and atomically decremented just before nfs4_map() exits.
207 210 * r_inmap is not protected by any lock.
208 211 *
209 212 * r_mapcnt tells that the rnode has mapped pages. r_inmap can be 0
210 213 * while the rnode has mapped pages.
211 214 *
212 215 * 64-bit offsets: the code formerly assumed that atomic reads of
213 216 * r_size were safe and reliable; on 32-bit architectures, this is
214 217 * not true since an intervening bus cycle from another processor
215 218 * could update half of the size field. The r_statelock must now
216 219 * be held whenever any kind of access of r_size is made.
217 220 *
218 221 * Lock ordering:
219 222 * r_rwlock > r_lkserlock > r_os_lock > r_statelock > r_statev4_lock
220 223 * vnode_t::v_lock > r_os_lock
221 224 */
222 225 struct exportinfo; /* defined in nfs/export.h */
223 226 struct servinfo4; /* defined in nfs/nfs4_clnt.h */
224 227 struct failinfo; /* defined in nfs/nfs_clnt.h */
225 228 struct mntinfo4; /* defined in nfs/nfs4_clnt.h */
226 229
227 230 typedef struct rnode4 {
228 231 /* the hash fields must be first to match the rhashq_t */
229 232 struct rnode4 *r_hashf; /* hash queue forward pointer */
230 233 struct rnode4 *r_hashb; /* hash queue back pointer */
231 234 struct rnode4 *r_freef; /* free list forward pointer */
232 235 struct rnode4 *r_freeb; /* free list back pointer */
233 236 r4hashq_t *r_hashq; /* pointer to the hash bucket */
234 237
235 238 svnode_t r_svnode; /* "master" shadow vnode for file */
236 239 kmutex_t r_svlock; /* serializes access to svnode list */
237 240 nfs_rwlock_t r_rwlock; /* serializes write/setattr requests */
238 241 nfs_rwlock_t r_lkserlock; /* serialize lock with other ops */
239 242 kmutex_t r_statelock; /* protects (most of) rnode contents */
240 243 nfs4_sharedfh_t *r_fh; /* file handle */
241 244 struct servinfo4
242 245 *r_server; /* current server */
243 246 u_offset_t r_nextr; /* next byte read offset (read-ahead) */
244 247 uint_t r_flags; /* flags, see below */
245 248 short r_error; /* async write error */
246 249 cred_t *r_unlcred; /* unlinked credentials */
247 250 char *r_unlname; /* unlinked file name */
248 251 vnode_t *r_unldvp; /* parent dir of unlinked file */
249 252 vnode_t *r_xattr_dir; /* cached xattr dir vnode */
250 253 len_t r_size; /* client's view of file size */
251 254 vattr_t r_attr; /* cached vnode attributes */
252 255 hrtime_t r_time_attr_saved; /* time attributes were cached */
253 256 hrtime_t r_time_attr_inval; /* time attributes become invalid */
254 257 hrtime_t r_time_cache_inval; /* time caches become invalid */
255 258 time_t r_delay_wait; /* future time for DELAY handling */
256 259 int r_delay_interval; /* Number of Secs of last DELAY */
257 260 time_t r_last_recov; /* time of last recovery operation */
258 261 nfs4_recov_t r_recov_act; /* action from last recovery op */
259 262 long r_mapcnt; /* count of mmapped pages */
260 263 uint_t r_count; /* # of refs not reflect in v_count */
261 264 uint_t r_awcount; /* # of outstanding async write */
262 265 uint_t r_gcount; /* getattrs waiting to flush pages */
263 266 kcondvar_t r_cv; /* condvar for blocked threads */
264 267 int (*r_putapage) /* address of putapage routine */
265 268 (vnode_t *, page_t *, u_offset_t *, size_t *, int, cred_t *);
266 269 void *r_dir; /* cache of readdir responses */
267 270 rddir4_cache *r_direof; /* pointer to the EOF entry */
268 271 symlink_cache r_symlink; /* cached readlink response */
269 272 verifier4 r_writeverf; /* file data write verifier */
270 273 u_offset_t r_modaddr; /* address for page in writerp */
271 274 commit_t r_commit; /* commit information */
272 275 u_offset_t r_truncaddr; /* base for truncate operation */
273 276 vsecattr_t *r_secattr; /* cached security attributes (acls) */
274 277 verifier4 r_cookieverf4; /* version 4 readdir cookie verifier */
275 278 nfs4_pathconf_info_t r_pathconf; /* cached pathconf info */
276 279 acache4_t *r_acache; /* list of access cache entries */
277 280 list_t r_open_streams; /* open streams list */
278 281 kmutex_t r_os_lock; /* protects r_open_streams */
279 282 nfs4_lock_owner_t
280 283 r_lo_head; /* lock owners list head */
281 284 int created_v4; /* 1 if file has been created in v4 */
282 285 kmutex_t r_statev4_lock; /* protects created_v4, state4ptr */
283 286
284 287 list_node_t r_deleg_link; /* linkage into list of */
285 288 /* delegated rnodes for this server */
286 289 open_delegation_type4
287 290 r_deleg_type; /* type of delegation granted */
288 291 stateid4 r_deleg_stateid;
289 292 /* delegation state id */
290 293 nfs_space_limit4
291 294 r_deleg_limit; /* file limits returned from */
292 295 /* server on delegated open */
293 296 nfsace4 r_deleg_perms; /* file permissions returned from */
294 297 /* server on delegated open */
295 298 fattr4_change r_deleg_change; /* current deleg change attr */
296 299 fattr4_change r_deleg_change_grant;
297 300 /* change @ write deleg grant */
298 301 cred_t *r_deleg_cred; /* credential in force when the */
299 302 /* delegation was granted */
300 303 open_delegation_type4
301 304 r_deleg_needs_recovery;
302 305 /* delegation needs recovery */
303 306 /* This contains the delegation type */
304 307 /* for use with CLAIM_PREVIOUS. */
305 308 /* OPEN_DELEGATE_NONE means recovery */
306 309 /* is not needed. */
307 310 unsigned r_deleg_needs_recall:1;
308 311 /* delegation has been recalled by */
309 312 /* the server during open with */
310 313 /* CLAIM_PREVIOUS */
311 314 unsigned r_deleg_return_pending:1;
312 315 /* delegreturn is pending, don't use */
313 316 /* the delegation stateid, set in */
314 317 /* nfs4_dlistadd */
315 318 unsigned r_deleg_return_inprog:1;
316 319 /* delegreturn is in progress, may */
317 320 /* only be set by nfs4delegreturn. */
318 321 nfs_rwlock_t r_deleg_recall_lock;
319 322 /* lock for synchronizing delegreturn */
320 323 /* with in other operations, acquired */
321 324 /* in read mode by nfs4_start_fop, */
322 325 /* acquired in write mode in */
323 326 /* nfs4delegreturn */
324 327 fattr4_change r_change; /* GETATTR4 change attr; client */
325 328 /* should always request change */
326 329 /* when c/mtime requested to keep */
327 330 /* change and c/mtime in sync */
328 331 fattr4_fileid r_mntd_fid; /* mounted on fileid attr */
329 332 kthread_t *r_serial; /* attrcache validation thread */
330 333 kthread_t *r_pgflush; /* thread flushing page cache */
331 334 list_t r_indelmap; /* list of delmap callers */
332 335 fattr4_fsid r_srv_fsid; /* fsid of srv fs containing object */
333 336 /* when rnode created; compare with */
334 337 /* sv_fsid (servinfo4_t) to see why */
335 338 /* stub type was set */
336 339 nfs4_stub_type_t r_stub_type;
337 340 /* e.g. mirror-mount or referral */
338 341 uint_t r_inmap; /* to serialize read/write and mmap */
339 342 } rnode4_t;
340 343
341 344 #define r_vnode r_svnode.sv_r_vnode
342 345
343 346 /*
344 347 * Flags
345 348 */
346 349 #define R4READDIRWATTR 0x1 /* Use READDIR with attributes */
347 350 #define R4DIRTY 0x2 /* dirty pages from write operation */
348 351 #define R4STALE 0x4 /* stale, don't even attempt to write */
349 352 #define R4MODINPROGRESS 0x8 /* page modification happening */
350 353 #define R4TRUNCATE 0x10 /* truncating, don't commit */
351 354 #define R4HAVEVERF 0x20 /* have a write verifier to compare against */
352 355 #define R4COMMIT 0x40 /* commit in progress */
353 356 #define R4COMMITWAIT 0x80 /* someone is waiting to do a commit */
354 357 #define R4HASHED 0x100 /* rnode is in hash queues */
355 358 #define R4OUTOFSPACE 0x200 /* an out of space error has happened */
356 359 #define R4LODANGLERS 0x400 /* rnode has dangling lock_owners to cleanup */
357 360 #define R4WRITEMODIFIED 0x800 /* file data has been modified by write */
358 361 #define R4DIRECTIO 0x1000 /* bypass the buffer cache */
359 362 #define R4RECOVERR 0x2000 /* couldn't recover */
360 363 #define R4RECEXPFH 0x4000 /* recovering expired filehandle */
361 364 #define R4RECOVERRP 0x8000 /* R4RECOVERR pending, but not set (yet) */
362 365 #define R4ISXATTR 0x20000 /* rnode is a named attribute */
363 366 #define R4DELMAPLIST 0x40000 /* delmap callers tracked for as callback */
364 367 #define R4PGFLUSH 0x80000 /* page flush thread active */
365 368 #define R4INCACHEPURGE 0x100000 /* purging caches due to file size change */
366 369 #define R4LOOKUP 0x200000 /* a lookup has been done in the directory */
367 370 /*
368 371 * Convert between vnode and rnode
369 372 */
370 373 #define RTOV4(rp) ((rp)->r_vnode)
371 374 #define VTOR4(vp) ((rnode4_t *)((vp)->v_data))
372 375
373 376 #define RP_ISSTUB(rp) (((rp)->r_stub_type != NFS4_STUB_NONE))
374 377 #define RP_ISSTUB_MIRRORMOUNT(rp) ((rp)->r_stub_type == NFS4_STUB_MIRRORMOUNT)
375 378 #define RP_ISSTUB_REFERRAL(rp) ((rp)->r_stub_type == NFS4_STUB_REFERRAL)
376 379
377 380 /*
378 381 * Open file instances.
379 382 */
|
↓ open down ↓ |
345 lines elided |
↑ open up ↑ |
380 383
381 384 typedef struct nfs4_opinst {
382 385 struct nfs4_opinst *re_next; /* next in list */
383 386 vnode_t *re_vp; /* held reference */
384 387 uint32_t re_numosp; /* number of valid open streams */
385 388 nfs4_open_stream_t **re_osp; /* held reference */
386 389 } nfs4_opinst_t;
387 390
388 391 #ifdef _KERNEL
389 392
390 -extern long nrnode;
393 +extern volatile long nrnode;
391 394
392 395 /* Used for r_delay_interval */
393 396 #define NFS4_INITIAL_DELAY_INTERVAL 1
394 397 #define NFS4_MAX_DELAY_INTERVAL 20
395 398
396 399 /* Used for check_rtable4 */
397 400 #define NFSV4_RTABLE4_OK 0
398 401 #define NFSV4_RTABLE4_NOT_FREE_LIST 1
399 402 #define NFSV4_RTABLE4_DIRTY_PAGES 2
400 403 #define NFSV4_RTABLE4_POS_R_COUNT 3
401 404
402 405 extern rnode4_t *r4find(r4hashq_t *, nfs4_sharedfh_t *, struct vfs *);
403 406 extern rnode4_t *r4find_unlocked(nfs4_sharedfh_t *, struct vfs *);
404 407 extern void r4flush(struct vfs *, cred_t *);
405 408 extern void destroy_rtable4(struct vfs *, cred_t *);
406 409 extern int check_rtable4(struct vfs *);
407 410 extern void rp4_addfree(rnode4_t *, cred_t *);
408 411 extern void rp4_addhash(rnode4_t *);
409 412 extern void rp4_rmhash(rnode4_t *);
410 413 extern void rp4_rmhash_locked(rnode4_t *);
411 414 extern int rtable4hash(nfs4_sharedfh_t *);
412 415
413 416 extern vnode_t *makenfs4node(nfs4_sharedfh_t *, nfs4_ga_res_t *, struct vfs *,
414 417 hrtime_t, cred_t *, vnode_t *, nfs4_fname_t *);
415 418 extern vnode_t *makenfs4node_by_fh(nfs4_sharedfh_t *, nfs4_sharedfh_t *,
416 419 nfs4_fname_t **, nfs4_ga_res_t *, mntinfo4_t *, cred_t *, hrtime_t);
417 420
418 421 extern nfs4_opinst_t *r4mkopenlist(struct mntinfo4 *);
419 422 extern void r4releopenlist(nfs4_opinst_t *);
420 423 extern int r4find_by_fsid(mntinfo4_t *, fattr4_fsid *);
421 424
422 425 /* Access cache calls */
423 426 extern nfs4_access_type_t nfs4_access_check(rnode4_t *, uint32_t, cred_t *);
424 427 extern void nfs4_access_cache(rnode4_t *rp, uint32_t, uint32_t, cred_t *);
425 428 extern int nfs4_access_purge_rp(rnode4_t *);
426 429
427 430 extern int nfs4_free_data_reclaim(rnode4_t *);
428 431 extern void nfs4_rnode_invalidate(struct vfs *);
429 432
430 433 extern time_t r2lease_time(rnode4_t *);
431 434 extern int nfs4_directio(vnode_t *, int, cred_t *);
432 435
433 436 /* shadow vnode functions */
434 437 extern void sv_activate(vnode_t **, vnode_t *, nfs4_fname_t **, int);
435 438 extern vnode_t *sv_find(vnode_t *, vnode_t *, nfs4_fname_t **);
436 439 extern void sv_update_path(vnode_t *, char *, char *);
437 440 extern void sv_inactive(vnode_t *);
438 441 extern void sv_exchange(vnode_t **);
439 442 extern void sv_uninit(svnode_t *);
440 443 extern void nfs4_clear_open_streams(rnode4_t *);
441 444
442 445 /*
443 446 * Mark cached attributes as timed out
444 447 *
445 448 * The caller must not be holding the rnode r_statelock mutex.
446 449 */
447 450 #define PURGE_ATTRCACHE4_LOCKED(rp) \
448 451 rp->r_time_attr_inval = gethrtime(); \
449 452 rp->r_time_attr_saved = rp->r_time_attr_inval; \
450 453 rp->r_pathconf.pc4_xattr_valid = 0; \
451 454 rp->r_pathconf.pc4_cache_valid = 0;
452 455
453 456 #define PURGE_ATTRCACHE4(vp) { \
454 457 rnode4_t *rp = VTOR4(vp); \
455 458 mutex_enter(&rp->r_statelock); \
456 459 PURGE_ATTRCACHE4_LOCKED(rp); \
457 460 mutex_exit(&rp->r_statelock); \
458 461 }
459 462
460 463
461 464 extern void nfs4_async_readdir(vnode_t *, rddir4_cache *,
462 465 cred_t *, int (*)(vnode_t *, rddir4_cache *, cred_t *));
463 466 extern char *rnode4info(rnode4_t *rp);
464 467
465 468 extern int writerp4(rnode4_t *, caddr_t, int, struct uio *, int);
466 469 extern void nfs4_set_nonvattrs(rnode4_t *, struct nfs4attr_to_vattr *);
467 470 extern void nfs4delegabandon(rnode4_t *);
468 471 extern stateid4 nfs4_get_w_stateid(cred_t *, rnode4_t *, pid_t, mntinfo4_t *,
469 472 nfs_opnum4, nfs4_stateid_types_t *);
470 473 extern stateid4 nfs4_get_stateid(cred_t *, rnode4_t *, pid_t, mntinfo4_t *,
471 474 nfs_opnum4, nfs4_stateid_types_t *, bool_t);
472 475 extern nfsstat4 nfs4_find_or_create_lock_owner(pid_t, rnode4_t *, cred_t *,
473 476 nfs4_open_owner_t **, nfs4_open_stream_t **,
474 477 nfs4_lock_owner_t **);
475 478 extern cred_t *nfs4_get_otw_cred_by_osp(rnode4_t *, cred_t *,
476 479 nfs4_open_stream_t **, bool_t *, bool_t *);
477 480
478 481
479 482 /*
480 483 * Defines for the flag argument of nfs4delegreturn
481 484 */
482 485 #define NFS4_DR_FORCE 0x1 /* discard even if start_op fails */
483 486 #define NFS4_DR_PUSH 0x2 /* push modified data back to the server */
484 487 #define NFS4_DR_DISCARD 0x4 /* discard the delegation w/o delegreturn */
485 488 #define NFS4_DR_DID_OP 0x8 /* calling function did nfs4_start_op */
486 489 #define NFS4_DR_RECALL 0x10 /* delegreturn done in response to CB_RECALL */
487 490 #define NFS4_DR_REOPEN 0x20 /* perform file reopens, if applicable */
488 491
489 492 extern int nfs4delegreturn(rnode4_t *, int);
490 493 extern void nfs4_delegreturn_all(nfs4_server_t *);
491 494 extern void nfs4delegreturn_cleanup(rnode4_t *, nfs4_server_t *);
492 495 extern void nfs4_delegation_accept(rnode4_t *, open_claim_type4, OPEN4res *,
493 496 nfs4_ga_res_t *, cred_t *);
494 497
495 498 extern void nfs4_dlistclean(void);
496 499 extern void nfs4_deleg_discard(mntinfo4_t *, nfs4_server_t *);
497 500
498 501 extern void rddir4_cache_create(rnode4_t *);
499 502 extern void rddir4_cache_purge(rnode4_t *);
500 503 extern void rddir4_cache_destroy(rnode4_t *);
501 504 extern rddir4_cache *rddir4_cache_lookup(rnode4_t *, offset_t, int);
502 505 extern void rddir4_cache_rele(rnode4_t *, rddir4_cache *);
503 506
504 507 extern void r4_stub_mirrormount(rnode4_t *);
505 508 extern void r4_stub_referral(rnode4_t *);
506 509 extern void r4_stub_none(rnode4_t *);
507 510
508 511 #ifdef DEBUG
509 512 extern char *rddir4_cache_buf_alloc(size_t, int);
510 513 extern void rddir4_cache_buf_free(void *, size_t);
511 514 #endif
512 515
513 516
514 517
515 518 #endif /* _KERNEL */
516 519
517 520 #ifdef __cplusplus
518 521 }
519 522 #endif
520 523
521 524 #endif /* _NFS_RNODE4_H */
|
↓ open down ↓ |
121 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX