nfsport.h (6a068746777241722b2b32c5d0bc443a2a64d80b) nfsport.h (1f60bfd8227f0972d61f5977ba62452335b757e0)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 214 unchanged lines hidden (view full) ---

223#define NFSV4OP_WRITE 38
224#define NFSV4OP_RELEASELCKOWN 39
225
226/*
227 * Must be one greater than the last Operation#.
228 */
229#define NFSV4OP_NOPS 40
230
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 214 unchanged lines hidden (view full) ---

223#define NFSV4OP_WRITE 38
224#define NFSV4OP_RELEASELCKOWN 39
225
226/*
227 * Must be one greater than the last Operation#.
228 */
229#define NFSV4OP_NOPS 40
230
231/*
232 * Additional Ops for NFSv4.1.
233 */
234#define NFSV4OP_BACKCHANNELCTL 40
235#define NFSV4OP_BINDCONNTOSESS 41
236#define NFSV4OP_EXCHANGEID 42
237#define NFSV4OP_CREATESESSION 43
238#define NFSV4OP_DESTROYSESSION 44
239#define NFSV4OP_FREESTATEID 45
240#define NFSV4OP_GETDIRDELEG 46
241#define NFSV4OP_GETDEVINFO 47
242#define NFSV4OP_GETDEVLIST 48
243#define NFSV4OP_LAYOUTCOMMIT 49
244#define NFSV4OP_LAYOUTGET 50
245#define NFSV4OP_LAYOUTRETURN 51
246#define NFSV4OP_SECINFONONAME 52
247#define NFSV4OP_SEQUENCE 53
248#define NFSV4OP_SETSSV 54
249#define NFSV4OP_TESTSTATEID 55
250#define NFSV4OP_WANTDELEG 56
251#define NFSV4OP_DESTROYCLIENTID 57
252#define NFSV4OP_RECLAIMCOMPL 58
253
254/*
255 * Must be one more than last op#.
256 */
257#define NFSV41_NOPS 59
258
231/* Quirky case if the illegal op code */
232#define NFSV4OP_OPILLEGAL 10044
233
234/*
235 * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV4OP_NOPS.
236 */
237#define NFSV4OP_SYMLINK (NFSV4OP_NOPS)
238#define NFSV4OP_MKDIR (NFSV4OP_NOPS + 1)

--- 17 unchanged lines hidden (view full) ---

256#define NFSV4OP_CBRECALL 4
257
258/*
259 * Must be one greater than the last Callback Operation#.
260 */
261#define NFSV4OP_CBNOPS 5
262
263/*
259/* Quirky case if the illegal op code */
260#define NFSV4OP_OPILLEGAL 10044
261
262/*
263 * Fake NFSV4OP_xxx used for nfsstat. Start at NFSV4OP_NOPS.
264 */
265#define NFSV4OP_SYMLINK (NFSV4OP_NOPS)
266#define NFSV4OP_MKDIR (NFSV4OP_NOPS + 1)

--- 17 unchanged lines hidden (view full) ---

284#define NFSV4OP_CBRECALL 4
285
286/*
287 * Must be one greater than the last Callback Operation#.
288 */
289#define NFSV4OP_CBNOPS 5
290
291/*
292 * Additional Callback Ops for NFSv4.1 only. Not yet in nfsstats.
293 */
294#define NFSV4OP_CBLAYOUTRECALL 5
295#define NFSV4OP_CBNOTIFY 6
296#define NFSV4OP_CBPUSHDELEG 7
297#define NFSV4OP_CBRECALLANY 8
298#define NFSV4OP_CBRECALLOBJAVAIL 9
299#define NFSV4OP_CBRECALLSLOT 10
300#define NFSV4OP_CBSEQUENCE 11
301#define NFSV4OP_CBWANTCANCELLED 12
302#define NFSV4OP_CBNOTIFYLOCK 13
303#define NFSV4OP_CBNOTIFYDEVID 14
304
305/*
264 * The lower numbers -> 21 are used by NFSv2 and v3. These define higher
265 * numbers used by NFSv4.
266 * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
267 * one greater than the last number.
268 */
269#ifndef NFS_V3NPROCS
270#define NFS_V3NPROCS 22
271

--- 16 unchanged lines hidden (view full) ---

288#define NFSPROC_RETDELEGRENAME2 38
289#define NFSPROC_GETACL 39
290#define NFSPROC_SETACL 40
291
292/*
293 * Must be defined as one higher than the last Proc# above.
294 */
295#define NFSV4_NPROCS 41
306 * The lower numbers -> 21 are used by NFSv2 and v3. These define higher
307 * numbers used by NFSv4.
308 * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is
309 * one greater than the last number.
310 */
311#ifndef NFS_V3NPROCS
312#define NFS_V3NPROCS 22
313

--- 16 unchanged lines hidden (view full) ---

330#define NFSPROC_RETDELEGRENAME2 38
331#define NFSPROC_GETACL 39
332#define NFSPROC_SETACL 40
333
334/*
335 * Must be defined as one higher than the last Proc# above.
336 */
337#define NFSV4_NPROCS 41
338
339/* Additional procedures for NFSv4.1. */
340#define NFSPROC_EXCHANGEID 41
341#define NFSPROC_CREATESESSION 42
342#define NFSPROC_DESTROYSESSION 43
343#define NFSPROC_DESTROYCLIENT 44
344#define NFSPROC_FREESTATEID 45
345#define NFSPROC_LAYOUTGET 46
346#define NFSPROC_GETDEVICEINFO 47
347#define NFSPROC_LAYOUTCOMMIT 48
348#define NFSPROC_LAYOUTRETURN 49
349#define NFSPROC_RECLAIMCOMPL 50
350#define NFSPROC_WRITEDS 51
351#define NFSPROC_READDS 52
352#define NFSPROC_COMMITDS 53
353
354/*
355 * Must be defined as one higher than the last NFSv4.1 Proc# above.
356 */
357#define NFSV41_NPROCS 54
358
296#endif /* NFS_V3NPROCS */
297
298/*
299 * Stats structure
300 */
301struct ext_nfsstats {
302 int attrcache_hits;
303 int attrcache_misses;

--- 59 unchanged lines hidden (view full) ---

363#define NFS_NPROCS NFSV4_NPROCS
364#endif
365
366#include <fs/nfs/nfskpiport.h>
367#include <fs/nfs/nfsdport.h>
368#include <fs/nfs/rpcv2.h>
369#include <fs/nfs/nfsproto.h>
370#include <fs/nfs/nfs.h>
359#endif /* NFS_V3NPROCS */
360
361/*
362 * Stats structure
363 */
364struct ext_nfsstats {
365 int attrcache_hits;
366 int attrcache_misses;

--- 59 unchanged lines hidden (view full) ---

426#define NFS_NPROCS NFSV4_NPROCS
427#endif
428
429#include <fs/nfs/nfskpiport.h>
430#include <fs/nfs/nfsdport.h>
431#include <fs/nfs/rpcv2.h>
432#include <fs/nfs/nfsproto.h>
433#include <fs/nfs/nfs.h>
434#include <fs/nfs/nfsclstate.h>
371#include <fs/nfs/nfs_var.h>
372#include <fs/nfs/nfsm_subs.h>
373#include <fs/nfs/nfsrvcache.h>
374#include <fs/nfs/nfsrvstate.h>
375#include <fs/nfs/xdr_subs.h>
376#include <fs/nfs/nfscl.h>
435#include <fs/nfs/nfs_var.h>
436#include <fs/nfs/nfsm_subs.h>
437#include <fs/nfs/nfsrvcache.h>
438#include <fs/nfs/nfsrvstate.h>
439#include <fs/nfs/xdr_subs.h>
440#include <fs/nfs/nfscl.h>
377#include <fs/nfs/nfsclstate.h>
378#include <nfsclient/nfsargs.h>
379#include <fs/nfsclient/nfsmount.h>
380
381/*
382 * Just to keep nfs_var.h happy.
383 */
384struct nfs_vattr {
385 int junk;

--- 192 unchanged lines hidden (view full) ---

578#define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx))
579#define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx))
580#define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx))
581#define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx))
582#define NFSPROCLISTLOCK() sx_slock(&allproc_lock)
583#define NFSPROCLISTUNLOCK() sx_sunlock(&allproc_lock)
584#define NFSLOCKSOCKREQ(r) mtx_lock(&((r)->nr_mtx))
585#define NFSUNLOCKSOCKREQ(r) mtx_unlock(&((r)->nr_mtx))
441#include <nfsclient/nfsargs.h>
442#include <fs/nfsclient/nfsmount.h>
443
444/*
445 * Just to keep nfs_var.h happy.
446 */
447struct nfs_vattr {
448 int junk;

--- 192 unchanged lines hidden (view full) ---

641#define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx))
642#define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx))
643#define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx))
644#define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx))
645#define NFSPROCLISTLOCK() sx_slock(&allproc_lock)
646#define NFSPROCLISTUNLOCK() sx_sunlock(&allproc_lock)
647#define NFSLOCKSOCKREQ(r) mtx_lock(&((r)->nr_mtx))
648#define NFSUNLOCKSOCKREQ(r) mtx_unlock(&((r)->nr_mtx))
649#define NFSLOCKDS(d) mtx_lock(&((d)->nfsclds_mtx))
650#define NFSUNLOCKDS(d) mtx_unlock(&((d)->nfsclds_mtx))
586
587/*
588 * Use these macros to initialize/free a mutex.
589 */
590#define NFSINITSOCKMUTEX(m) mtx_init((m), "nfssock", NULL, MTX_DEF)
591#define NFSFREEMUTEX(m) mtx_destroy((m))
592
593int nfsmsleep(void *, void *, int, const char *, struct timespec *);

--- 73 unchanged lines hidden (view full) ---

667MALLOC_DECLARE(M_NEWNFSCLCLIENT);
668MALLOC_DECLARE(M_NEWNFSCLLOCKOWNER);
669MALLOC_DECLARE(M_NEWNFSCLLOCK);
670MALLOC_DECLARE(M_NEWNFSDIROFF);
671MALLOC_DECLARE(M_NEWNFSV4NODE);
672MALLOC_DECLARE(M_NEWNFSDIRECTIO);
673MALLOC_DECLARE(M_NEWNFSMNT);
674MALLOC_DECLARE(M_NEWNFSDROLLBACK);
651
652/*
653 * Use these macros to initialize/free a mutex.
654 */
655#define NFSINITSOCKMUTEX(m) mtx_init((m), "nfssock", NULL, MTX_DEF)
656#define NFSFREEMUTEX(m) mtx_destroy((m))
657
658int nfsmsleep(void *, void *, int, const char *, struct timespec *);

--- 73 unchanged lines hidden (view full) ---

732MALLOC_DECLARE(M_NEWNFSCLCLIENT);
733MALLOC_DECLARE(M_NEWNFSCLLOCKOWNER);
734MALLOC_DECLARE(M_NEWNFSCLLOCK);
735MALLOC_DECLARE(M_NEWNFSDIROFF);
736MALLOC_DECLARE(M_NEWNFSV4NODE);
737MALLOC_DECLARE(M_NEWNFSDIRECTIO);
738MALLOC_DECLARE(M_NEWNFSMNT);
739MALLOC_DECLARE(M_NEWNFSDROLLBACK);
740MALLOC_DECLARE(M_NEWNFSLAYOUT);
741MALLOC_DECLARE(M_NEWNFSFLAYOUT);
742MALLOC_DECLARE(M_NEWNFSDEVINFO);
743MALLOC_DECLARE(M_NEWNFSSOCKREQ);
744MALLOC_DECLARE(M_NEWNFSCLDS);
745MALLOC_DECLARE(M_NEWNFSLAYRECALL);
675#define M_NFSRVCACHE M_NEWNFSRVCACHE
676#define M_NFSDCLIENT M_NEWNFSDCLIENT
677#define M_NFSDSTATE M_NEWNFSDSTATE
678#define M_NFSDLOCK M_NEWNFSDLOCK
679#define M_NFSDLOCKFILE M_NEWNFSDLOCKFILE
680#define M_NFSSTRING M_NEWNFSSTRING
681#define M_NFSUSERGROUP M_NEWNFSUSERGROUP
682#define M_NFSDREQ M_NEWNFSDREQ
683#define M_NFSFH M_NEWNFSFH
684#define M_NFSCLOWNER M_NEWNFSCLOWNER
685#define M_NFSCLOPEN M_NEWNFSCLOPEN
686#define M_NFSCLDELEG M_NEWNFSCLDELEG
687#define M_NFSCLCLIENT M_NEWNFSCLCLIENT
688#define M_NFSCLLOCKOWNER M_NEWNFSCLLOCKOWNER
689#define M_NFSCLLOCK M_NEWNFSCLLOCK
690#define M_NFSDIROFF M_NEWNFSDIROFF
691#define M_NFSV4NODE M_NEWNFSV4NODE
692#define M_NFSDIRECTIO M_NEWNFSDIRECTIO
693#define M_NFSDROLLBACK M_NEWNFSDROLLBACK
746#define M_NFSRVCACHE M_NEWNFSRVCACHE
747#define M_NFSDCLIENT M_NEWNFSDCLIENT
748#define M_NFSDSTATE M_NEWNFSDSTATE
749#define M_NFSDLOCK M_NEWNFSDLOCK
750#define M_NFSDLOCKFILE M_NEWNFSDLOCKFILE
751#define M_NFSSTRING M_NEWNFSSTRING
752#define M_NFSUSERGROUP M_NEWNFSUSERGROUP
753#define M_NFSDREQ M_NEWNFSDREQ
754#define M_NFSFH M_NEWNFSFH
755#define M_NFSCLOWNER M_NEWNFSCLOWNER
756#define M_NFSCLOPEN M_NEWNFSCLOPEN
757#define M_NFSCLDELEG M_NEWNFSCLDELEG
758#define M_NFSCLCLIENT M_NEWNFSCLCLIENT
759#define M_NFSCLLOCKOWNER M_NEWNFSCLLOCKOWNER
760#define M_NFSCLLOCK M_NEWNFSCLLOCK
761#define M_NFSDIROFF M_NEWNFSDIROFF
762#define M_NFSV4NODE M_NEWNFSV4NODE
763#define M_NFSDIRECTIO M_NEWNFSDIRECTIO
764#define M_NFSDROLLBACK M_NEWNFSDROLLBACK
765#define M_NFSLAYOUT M_NEWNFSLAYOUT
766#define M_NFSFLAYOUT M_NEWNFSFLAYOUT
767#define M_NFSDEVINFO M_NEWNFSDEVINFO
768#define M_NFSSOCKREQ M_NEWNFSSOCKREQ
769#define M_NFSCLDS M_NEWNFSCLDS
770#define M_NFSLAYRECALL M_NEWNFSLAYRECALL
694
695#define NFSINT_SIGMASK(set) \
696 (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \
697 SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \
698 SIGISMEMBER(set, SIGQUIT))
699
700/*
701 * Convert a quota block count to byte count.

--- 52 unchanged lines hidden (view full) ---

754#define NFSATTRISSET(t, v, a) ((v)->a != (t)VNOVAL)
755#define NFSATTRISSETTIME(v, a) ((v)->a.tv_sec != VNOVAL)
756
757/*
758 * Manipulate mount flags.
759 */
760#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier */
761#define NFSSTA_GOTFSINFO 0x00100000 /* Got the fsinfo */
771
772#define NFSINT_SIGMASK(set) \
773 (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \
774 SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \
775 SIGISMEMBER(set, SIGQUIT))
776
777/*
778 * Convert a quota block count to byte count.

--- 52 unchanged lines hidden (view full) ---

831#define NFSATTRISSET(t, v, a) ((v)->a != (t)VNOVAL)
832#define NFSATTRISSETTIME(v, a) ((v)->a.tv_sec != VNOVAL)
833
834/*
835 * Manipulate mount flags.
836 */
837#define NFSSTA_HASWRITEVERF 0x00040000 /* Has write verifier */
838#define NFSSTA_GOTFSINFO 0x00100000 /* Got the fsinfo */
839#define NFSSTA_NOLAYOUTCOMMIT 0x04000000 /* Don't do LayoutCommit */
840#define NFSSTA_SESSPERSIST 0x08000000 /* Has a persistent session */
762#define NFSSTA_TIMEO 0x10000000 /* Experiencing a timeout */
763#define NFSSTA_LOCKTIMEO 0x20000000 /* Experiencing a lockd timeout */
764#define NFSSTA_HASSETFSID 0x40000000 /* Has set the fsid */
841#define NFSSTA_TIMEO 0x10000000 /* Experiencing a timeout */
842#define NFSSTA_LOCKTIMEO 0x20000000 /* Experiencing a lockd timeout */
843#define NFSSTA_HASSETFSID 0x40000000 /* Has set the fsid */
844#define NFSSTA_PNFS 0x80000000 /* pNFS is enabled */
765
766#define NFSHASNFSV3(n) ((n)->nm_flag & NFSMNT_NFSV3)
767#define NFSHASNFSV4(n) ((n)->nm_flag & NFSMNT_NFSV4)
845
846#define NFSHASNFSV3(n) ((n)->nm_flag & NFSMNT_NFSV3)
847#define NFSHASNFSV4(n) ((n)->nm_flag & NFSMNT_NFSV4)
848#define NFSHASNFSV4N(n) ((n)->nm_minorvers > 0)
768#define NFSHASNFSV3OR4(n) ((n)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4))
769#define NFSHASGOTFSINFO(n) ((n)->nm_state & NFSSTA_GOTFSINFO)
770#define NFSHASHASSETFSID(n) ((n)->nm_state & NFSSTA_HASSETFSID)
771#define NFSHASSTRICT3530(n) ((n)->nm_flag & NFSMNT_STRICT3530)
772#define NFSHASWRITEVERF(n) ((n)->nm_state & NFSSTA_HASWRITEVERF)
773#define NFSHASINT(n) ((n)->nm_flag & NFSMNT_INT)
774#define NFSHASSOFT(n) ((n)->nm_flag & NFSMNT_SOFT)
775#define NFSHASINTORSOFT(n) ((n)->nm_flag & (NFSMNT_INT | NFSMNT_SOFT))
776#define NFSHASDUMBTIMR(n) ((n)->nm_flag & NFSMNT_DUMBTIMR)
777#define NFSHASNOCONN(n) ((n)->nm_flag & NFSMNT_MNTD)
778#define NFSHASKERB(n) ((n)->nm_flag & NFSMNT_KERB)
779#define NFSHASALLGSSNAME(n) ((n)->nm_flag & NFSMNT_ALLGSSNAME)
780#define NFSHASINTEGRITY(n) ((n)->nm_flag & NFSMNT_INTEGRITY)
781#define NFSHASPRIVACY(n) ((n)->nm_flag & NFSMNT_PRIVACY)
782#define NFSSETWRITEVERF(n) ((n)->nm_state |= NFSSTA_HASWRITEVERF)
783#define NFSSETHASSETFSID(n) ((n)->nm_state |= NFSSTA_HASSETFSID)
849#define NFSHASNFSV3OR4(n) ((n)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4))
850#define NFSHASGOTFSINFO(n) ((n)->nm_state & NFSSTA_GOTFSINFO)
851#define NFSHASHASSETFSID(n) ((n)->nm_state & NFSSTA_HASSETFSID)
852#define NFSHASSTRICT3530(n) ((n)->nm_flag & NFSMNT_STRICT3530)
853#define NFSHASWRITEVERF(n) ((n)->nm_state & NFSSTA_HASWRITEVERF)
854#define NFSHASINT(n) ((n)->nm_flag & NFSMNT_INT)
855#define NFSHASSOFT(n) ((n)->nm_flag & NFSMNT_SOFT)
856#define NFSHASINTORSOFT(n) ((n)->nm_flag & (NFSMNT_INT | NFSMNT_SOFT))
857#define NFSHASDUMBTIMR(n) ((n)->nm_flag & NFSMNT_DUMBTIMR)
858#define NFSHASNOCONN(n) ((n)->nm_flag & NFSMNT_MNTD)
859#define NFSHASKERB(n) ((n)->nm_flag & NFSMNT_KERB)
860#define NFSHASALLGSSNAME(n) ((n)->nm_flag & NFSMNT_ALLGSSNAME)
861#define NFSHASINTEGRITY(n) ((n)->nm_flag & NFSMNT_INTEGRITY)
862#define NFSHASPRIVACY(n) ((n)->nm_flag & NFSMNT_PRIVACY)
863#define NFSSETWRITEVERF(n) ((n)->nm_state |= NFSSTA_HASWRITEVERF)
864#define NFSSETHASSETFSID(n) ((n)->nm_state |= NFSSTA_HASSETFSID)
865#define NFSHASPNFSOPT(n) ((n)->nm_flag & NFSMNT_PNFS)
866#define NFSHASNOLAYOUTCOMMIT(n) ((n)->nm_state & NFSSTA_NOLAYOUTCOMMIT)
867#define NFSHASSESSPERSIST(n) ((n)->nm_state & NFSSTA_SESSPERSIST)
868#define NFSHASPNFS(n) ((n)->nm_state & NFSSTA_PNFS)
784
785/*
786 * Gets the stats field out of the mount structure.
787 */
788#define vfs_statfs(m) (&((m)->mnt_stat))
789
790/*
791 * Set boottime.

--- 123 unchanged lines hidden ---
869
870/*
871 * Gets the stats field out of the mount structure.
872 */
873#define vfs_statfs(m) (&((m)->mnt_stat))
874
875/*
876 * Set boottime.

--- 123 unchanged lines hidden ---