nfsmount.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* $OpenBSD: nfsmount.h,v 1.25 2012/09/10 11:10:59 jsing Exp $ */
  2. /* $NetBSD: nfsmount.h,v 1.10 1996/02/18 11:54:03 fvdl Exp $ */
  3. /*
  4. * Copyright (c) 1989, 1993
  5. * The Regents of the University of California. All rights reserved.
  6. *
  7. * This code is derived from software contributed to Berkeley by
  8. * Rick Macklem at The University of Guelph.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. * 3. Neither the name of the University nor the names of its contributors
  19. * may be used to endorse or promote products derived from this software
  20. * without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  23. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  26. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * @(#)nfsmount.h 8.3 (Berkeley) 3/30/95
  35. */
  36. #ifndef _NFS_NFSMOUNT_H_
  37. #define _NFS_NFSMOUNT_H_
  38. /*
  39. * Mount structure.
  40. * One allocated on every NFS mount.
  41. * Holds NFS specific information for mount.
  42. */
  43. struct nfsmount {
  44. RB_HEAD(nfs_nodetree, nfsnode)
  45. nm_ntree; /* filehandle/node tree */
  46. TAILQ_HEAD(reqs, nfsreq)
  47. nm_reqsq; /* request queue for this mount. */
  48. struct timeout nm_rtimeout; /* timeout (scans/resends nm_reqsq). */
  49. int nm_flag; /* Flags for soft/hard... */
  50. struct mount *nm_mountp; /* Vfs structure for this filesystem */
  51. int nm_numgrps; /* Max. size of groupslist */
  52. u_char nm_fh[NFSX_V3FHMAX]; /* File handle of root dir */
  53. int nm_fhsize; /* Size of root file handle */
  54. struct socket *nm_so; /* Rpc socket */
  55. int nm_sotype; /* Type of socket */
  56. int nm_soproto; /* and protocol */
  57. int nm_soflags; /* pr_flags for socket protocol */
  58. struct mbuf *nm_nam; /* Addr of server */
  59. int nm_timeo; /* Init timer for NFSMNT_DUMBTIMR */
  60. int nm_retry; /* Max retries */
  61. int nm_srtt[NFS_MAX_TIMER]; /* RTT Timers for RPCs */
  62. int nm_sdrtt[NFS_MAX_TIMER];
  63. int nm_sent; /* Request send count */
  64. int nm_cwnd; /* Request send window */
  65. int nm_timeouts; /* Request timeouts */
  66. int nm_rsize; /* Max size of read rpc */
  67. int nm_wsize; /* Max size of write rpc */
  68. int nm_readdirsize; /* Size of a readdir rpc */
  69. int nm_readahead; /* Num. of blocks to readahead */
  70. u_char nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
  71. u_short nm_acregmin; /* Attr cache file recently modified */
  72. u_short nm_acregmax; /* ac file not recently modified */
  73. u_short nm_acdirmin; /* ac for dir recently modified */
  74. u_short nm_acdirmax; /* ac for dir not recently modified */
  75. };
  76. #ifdef _KERNEL
  77. /* Convert mount ptr to nfsmount ptr: */
  78. #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data))
  79. /* Prototypes for NFS mount operations: */
  80. int nfs_mount(struct mount *, const char *, void *, struct nameidata *,
  81. struct proc *);
  82. int mountnfs(struct nfs_args *, struct mount *, struct mbuf *,
  83. const char *, char *);
  84. int nfs_mountroot(void);
  85. void nfs_decode_args(struct nfsmount *, struct nfs_args *,
  86. struct nfs_args *);
  87. int nfs_start(struct mount *, int, struct proc *);
  88. int nfs_unmount(struct mount *, int, struct proc *);
  89. int nfs_root(struct mount *, struct vnode **);
  90. int nfs_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *);
  91. int nfs_statfs(struct mount *, struct statfs *, struct proc *);
  92. int nfs_sync(struct mount *, int, struct ucred *, struct proc *);
  93. int nfs_vget(struct mount *, ino_t, struct vnode **);
  94. int nfs_fhtovp(struct mount *, struct fid *, struct vnode **);
  95. int nfs_vptofh(struct vnode *, struct fid *);
  96. int nfs_fsinfo(struct nfsmount *, struct vnode *, struct ucred *,
  97. struct proc *);
  98. void nfs_init(void);
  99. #endif /* _KERNEL */
  100. #endif