nfs_clsubs.c (198291) | nfs_clsubs.c (203119) |
---|---|
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 --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_subs.c 8.8 (Berkeley) 5/22/95 33 */ 34 35#include <sys/cdefs.h> | 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 --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_subs.c 8.8 (Berkeley) 5/22/95 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clsubs.c 198291 2009-10-20 15:06:18Z jh $"); | 36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clsubs.c 203119 2010-01-28 16:17:24Z rmacklem $"); |
37 38/* 39 * These functions support the macros and help fiddle mbuf chains for 40 * the nfs op functions. They do things like create the rpc header and 41 * copy data between mbuf chains and uio lists. 42 */ 43 44#include <sys/param.h> --- 28 unchanged lines hidden (view full) --- 73 74/* 75 * Note that stdarg.h and the ANSI style va_start macro is used for both 76 * ANSI and traditional C compilers. 77 */ 78#include <machine/stdarg.h> 79 80extern struct mtx ncl_iod_mutex; | 37 38/* 39 * These functions support the macros and help fiddle mbuf chains for 40 * the nfs op functions. They do things like create the rpc header and 41 * copy data between mbuf chains and uio lists. 42 */ 43 44#include <sys/param.h> --- 28 unchanged lines hidden (view full) --- 73 74/* 75 * Note that stdarg.h and the ANSI style va_start macro is used for both 76 * ANSI and traditional C compilers. 77 */ 78#include <machine/stdarg.h> 79 80extern struct mtx ncl_iod_mutex; |
81extern struct proc *ncl_iodwant[NFS_MAXRAHEAD]; | 81extern enum nfsiod_state ncl_iodwant[NFS_MAXRAHEAD]; |
82extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; 83extern int ncl_numasync; 84extern unsigned int ncl_iodmax; 85extern struct nfsstats newnfsstats; 86 87int 88ncl_uninit(struct vfsconf *vfsp) 89{ --- 5 unchanged lines hidden (view full) --- 95 96 /* 97 * Tell all nfsiod processes to exit. Clear ncl_iodmax, and wakeup 98 * any sleeping nfsiods so they check ncl_iodmax and exit. 99 */ 100 mtx_lock(&ncl_iod_mutex); 101 ncl_iodmax = 0; 102 for (i = 0; i < ncl_numasync; i++) | 82extern struct nfsmount *ncl_iodmount[NFS_MAXRAHEAD]; 83extern int ncl_numasync; 84extern unsigned int ncl_iodmax; 85extern struct nfsstats newnfsstats; 86 87int 88ncl_uninit(struct vfsconf *vfsp) 89{ --- 5 unchanged lines hidden (view full) --- 95 96 /* 97 * Tell all nfsiod processes to exit. Clear ncl_iodmax, and wakeup 98 * any sleeping nfsiods so they check ncl_iodmax and exit. 99 */ 100 mtx_lock(&ncl_iod_mutex); 101 ncl_iodmax = 0; 102 for (i = 0; i < ncl_numasync; i++) |
103 if (ncl_iodwant[i]) | 103 if (ncl_iodwant[i] == NFSIOD_AVAILABLE) |
104 wakeup(&ncl_iodwant[i]); 105 /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ 106 while (ncl_numasync) 107 msleep(&ncl_numasync, &ncl_iod_mutex, PWAIT, "ioddie", 0); 108 mtx_unlock(&ncl_iod_mutex); 109 ncl_nhuninit(); 110 return (0); 111#else --- 279 unchanged lines hidden (view full) --- 391 */ 392int 393ncl_init(struct vfsconf *vfsp) 394{ 395 int i; 396 397 /* Ensure async daemons disabled */ 398 for (i = 0; i < NFS_MAXRAHEAD; i++) { | 104 wakeup(&ncl_iodwant[i]); 105 /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ 106 while (ncl_numasync) 107 msleep(&ncl_numasync, &ncl_iod_mutex, PWAIT, "ioddie", 0); 108 mtx_unlock(&ncl_iod_mutex); 109 ncl_nhuninit(); 110 return (0); 111#else --- 279 unchanged lines hidden (view full) --- 391 */ 392int 393ncl_init(struct vfsconf *vfsp) 394{ 395 int i; 396 397 /* Ensure async daemons disabled */ 398 for (i = 0; i < NFS_MAXRAHEAD; i++) { |
399 ncl_iodwant[i] = NULL; | 399 ncl_iodwant[i] = NFSIOD_NOT_AVAILABLE; |
400 ncl_iodmount[i] = NULL; 401 } 402 ncl_nhinit(); /* Init the nfsnode table */ 403 404 return (0); 405} 406 | 400 ncl_iodmount[i] = NULL; 401 } 402 ncl_nhinit(); /* Init the nfsnode table */ 403 404 return (0); 405} 406 |