The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/nfs/nfsmount.h

Version: -  FREEBSD  -  FREEBSD11  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: nfsmount.h,v 1.51 2011/01/22 22:26:10 matt Exp $       */
    2 
    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 
   37 
   38 #ifndef _NFS_NFSMOUNT_H_
   39 #define _NFS_NFSMOUNT_H_
   40 
   41 #if defined(_KERNEL) && !defined(NFS_ARGS_ONLY)
   42 #include <sys/condvar.h>
   43 #include <sys/rwlock.h>
   44 #include <sys/mutex.h>
   45 #include <sys/disk.h>
   46 #include <sys/rbtree.h>
   47 #endif
   48 
   49 /*
   50  * Arguments to mount NFS
   51  */
   52 #define NFS_ARGSVERSION 3               /* change when nfs_args changes */
   53 struct nfs_args {
   54         int             version;        /* args structure version number */
   55         struct sockaddr *addr;          /* file server address */
   56         int             addrlen;        /* length of address */
   57         int             sotype;         /* Socket type */
   58         int             proto;          /* and Protocol */
   59         u_char          *fh;            /* File handle to be mounted */
   60         int             fhsize;         /* Size, in bytes, of fh */
   61         int             flags;          /* flags */
   62         int             wsize;          /* write size in bytes */
   63         int             rsize;          /* read size in bytes */
   64         int             readdirsize;    /* readdir size in bytes */
   65         int             timeo;          /* initial timeout in .1 secs */
   66         int             retrans;        /* times to retry send */
   67         int             maxgrouplist;   /* Max. size of group list */
   68         int             readahead;      /* # of blocks to readahead */
   69         int             leaseterm;      /* Ignored; Term (sec) of lease */
   70         int             deadthresh;     /* Retrans threshold */
   71         char            *hostname;      /* server's name */
   72 };
   73 
   74 /*
   75  * NFS mount option flags (nm_flag)
   76  */
   77 #define NFSMNT_SOFT             0x00000001  /* soft mount (hard is default) */
   78 #define NFSMNT_WSIZE            0x00000002  /* set write size */
   79 #define NFSMNT_RSIZE            0x00000004  /* set read size */
   80 #define NFSMNT_TIMEO            0x00000008  /* set initial timeout */
   81 #define NFSMNT_RETRANS          0x00000010  /* set number of request retries */
   82 #define NFSMNT_MAXGRPS          0x00000020  /* set maximum grouplist size */
   83 #define NFSMNT_INT              0x00000040  /* allow interrupts on hard mount */
   84 #define NFSMNT_NOCONN           0x00000080  /* Don't Connect the socket */
   85 #define NFSMNT_NQNFS            0x00000100  /* Use Nqnfs protocol */
   86 #define NFSMNT_NFSV3            0x00000200  /* Use NFS Version 3 protocol */
   87 #define NFSMNT_KERB             0x00000400  /* Use Kerberos authentication */
   88 #define NFSMNT_DUMBTIMR         0x00000800  /* Don't estimate rtt dynamically */
   89 #define NFSMNT_LEASETERM        0x00001000  /* Ignored; lease term (nqnfs) */
   90 #define NFSMNT_READAHEAD        0x00002000  /* set read ahead */
   91 #define NFSMNT_DEADTHRESH       0x00004000  /* set dead server retry thresh */
   92 #define NFSMNT_RESVPORT         0x00008000  /* Allocate a reserved port */
   93 #define NFSMNT_RDIRPLUS         0x00010000  /* Use Readdirplus for V3 */
   94 #define NFSMNT_READDIRSIZE      0x00020000  /* Set readdir size */
   95 #define NFSMNT_XLATECOOKIE      0x00040000  /* 32<->64 dir cookie xlation */
   96 #define NFSMNT_NOAC             0x00080000  /* Turn off attribute cache */
   97 
   98 #define NFSMNT_BITS     "\177\2" \
   99     "b\00soft\0b\01wsize\0b\02rsize\0b\03timeo\0" \
  100     "b\04retrans\0b\05maxgrps\0b\06intr\0b\07noconn\0" \
  101     "b\10nqnfs\0b\11nfsv3\0b\12kerb\0b\13dumbtimr\0" \
  102     "b\14leaseterm\0b\15readahead\0b\16deadthresh\0b\17resvport\0" \
  103     "b\20rdirplus\0b\21readdirsize\0b\22xlatecookie\0b\23noac\0"
  104 
  105 /*
  106  * NFS internal flags (nm_iflag) */
  107 
  108 #define NFSMNT_HASWRITEVERF     0x00000001  /* Has write verifier for V3 */
  109 #define NFSMNT_GOTPATHCONF      0x00000002  /* Got the V3 pathconf info */
  110 #define NFSMNT_GOTFSINFO        0x00000004  /* Got the V3 fsinfo */
  111 #define NFSMNT_MNTD             0x00000008  /* Mnt server for mnt point */
  112 #define NFSMNT_DISMNT           0x00000020  /* Dismounted */
  113 #define NFSMNT_SNDLOCK          0x00000040  /* Send socket lock */
  114 #define NFSMNT_WANTSND          0x00000080  /* Want above */
  115 #define NFSMNT_RCVLOCK          0x00000100  /* Rcv socket lock */
  116 #define NFSMNT_WANTRCV          0x00000200  /* Want above */
  117 #define NFSMNT_WAITAUTH         0x00000400  /* Wait for authentication */
  118 #define NFSMNT_HASAUTH          0x00000800  /* Has authenticator */
  119 #define NFSMNT_WANTAUTH         0x00001000  /* Wants an authenticator */
  120 #define NFSMNT_AUTHERR          0x00002000  /* Authentication error */
  121 #define NFSMNT_SWAPCOOKIE       0x00004000  /* XDR encode dir cookies */
  122 #define NFSMNT_STALEWRITEVERF   0x00008000  /* Write verifier is changing */
  123 #define NFSMNT_WCCKLUDGE        0x00010000  /* see nfs_check_wccdata() */
  124 
  125 #if defined(_KERNEL) && !defined(NFS_ARGS_ONLY)
  126 /*
  127  * Mount structure.
  128  * One allocated on every NFS mount.
  129  * Holds NFS specific information for mount.
  130  */
  131 struct  nfsmount {
  132         kmutex_t nm_lock;               /* Lock for this structure */
  133         krwlock_t nm_rbtlock;           /* Lock for the rbtree */
  134         kcondvar_t nm_rcvcv;
  135         kcondvar_t nm_sndcv;
  136         int     nm_flag;                /* Flags for soft/hard... */
  137         struct  mount *nm_mountp;       /* Vfs structure for this filesystem */
  138         int     nm_numgrps;             /* Max. size of groupslist */
  139         struct  vnode *nm_vnode;
  140         struct  socket *nm_so;          /* Rpc socket */
  141         struct  rb_tree nm_rbtree;      /* red/black tree by fh for nfsnode */
  142         int     nm_sotype;              /* Type of socket */
  143         int     nm_soproto;             /* and protocol */
  144         int     nm_soflags;             /* pr_flags for socket protocol */
  145         struct  mbuf *nm_nam;           /* Addr of server */
  146         int     nm_timeo;               /* Init timer for NFSMNT_DUMBTIMR */
  147         int     nm_retry;               /* Max retries */
  148         int     nm_srtt[4];             /* Timers for rpcs */
  149         int     nm_sdrtt[4];
  150         int     nm_sent;                /* Request send count */
  151         int     nm_cwnd;                /* Request send window */
  152         int     nm_timeouts;            /* Request timeouts */
  153         int     nm_deadthresh;          /* Threshold of timeouts-->dead server*/
  154         int     nm_rsize;               /* Max size of read rpc */
  155         int     nm_wsize;               /* Max size of write rpc */
  156         int     nm_readdirsize;         /* Size of a readdir rpc */
  157         int     nm_readahead;           /* Num. of blocks to readahead */
  158         uid_t   nm_authuid;             /* Uid for authenticator */
  159         int     nm_authtype;            /* Authenticator type */
  160         int     nm_authlen;             /* and length */
  161         char    *nm_authstr;            /* Authenticator string */
  162         char    *nm_verfstr;            /* and the verifier */
  163         int     nm_verflen;
  164         krwlock_t nm_writeverflock;     /* lock for below */
  165         u_char  nm_writeverf[NFSX_V3WRITEVERF]; /* V3 write verifier */
  166         NFSKERBKEY_T nm_key;            /* and the session key */
  167         int     nm_numuids;             /* Number of nfsuid mappings */
  168         TAILQ_HEAD(, nfsuid) nm_uidlruhead; /* Lists of nfsuid mappings */
  169         LIST_HEAD(, nfsuid) nm_uidhashtbl[NFS_MUIDHASHSIZ];
  170         TAILQ_HEAD(, buf) nm_bufq;      /* async io buffer queue */
  171         int     nm_bufqlen;             /* number of buffers in queue */
  172         kcondvar_t nm_aiocv;
  173         int     nm_bufqiods;            /* number of iods processing queue */
  174         u_int64_t nm_maxfilesize;       /* maximum file size */
  175         int     nm_iflag;               /* internal flags */
  176         int     nm_waiters;             /* number of waiting listeners.. */
  177         kcondvar_t nm_disconcv;
  178         long    nm_wcckludgetime;       /* see nfs_check_wccdata() */
  179         struct io_stats *nm_stats;      /* per nfs mount statistics */
  180 };
  181 
  182 /*
  183  * Convert mount ptr to nfsmount ptr.
  184  */
  185 #define VFSTONFS(mp)    ((struct nfsmount *)((mp)->mnt_data))
  186 
  187 /*
  188  * Prototypes for NFS mount operations
  189  */
  190 VFS_PROTOS(nfs);
  191 
  192 int     mountnfs(struct nfs_args *argp, struct mount *mp,
  193                 struct mbuf *nam, const char *pth, const char *hst,
  194                 struct vnode **vpp, struct lwp *p);
  195 void    nfs_decode_args(struct nfsmount *, struct nfs_args *,
  196                 struct lwp *l);
  197 int     nfs_fsinfo(struct nfsmount *, struct vnode *, kauth_cred_t,
  198                         struct lwp *);
  199 
  200 void    nfs_vfs_init(void);
  201 void    nfs_vfs_done(void);
  202 
  203 #endif /* _KERNEL */
  204 
  205 #endif

Cache object: 0031d63ba92b9be6ff89d69c2bb156e2


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.