Changeset View
Changeset View
Standalone View
Standalone View
fs/nfsclient/nfs_clsubs.c
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
/* | /* | ||||
* Note that stdarg.h and the ANSI style va_start macro is used for both | * Note that stdarg.h and the ANSI style va_start macro is used for both | ||||
* ANSI and traditional C compilers. | * ANSI and traditional C compilers. | ||||
*/ | */ | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
extern struct mtx ncl_iod_mutex; | extern struct sx ncl_iod_sx; | ||||
extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; | extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; | ||||
extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON]; | extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON]; | ||||
extern int ncl_numasync; | extern int ncl_numasync; | ||||
extern unsigned int ncl_iodmax; | extern unsigned int ncl_iodmax; | ||||
extern struct nfsstatsv1 nfsstatsv1; | extern struct nfsstatsv1 nfsstatsv1; | ||||
struct task ncl_nfsiodnew_task; | struct task ncl_nfsiodnew_task; | ||||
Show All 12 Lines | #if 0 | ||||
*/ | */ | ||||
NFSLOCKIOD(); | NFSLOCKIOD(); | ||||
ncl_iodmax = 0; | ncl_iodmax = 0; | ||||
for (i = 0; i < ncl_numasync; i++) | for (i = 0; i < ncl_numasync; i++) | ||||
if (ncl_iodwant[i] == NFSIOD_AVAILABLE) | if (ncl_iodwant[i] == NFSIOD_AVAILABLE) | ||||
wakeup(&ncl_iodwant[i]); | wakeup(&ncl_iodwant[i]); | ||||
/* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ | /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ | ||||
while (ncl_numasync) | while (ncl_numasync) | ||||
msleep(&ncl_numasync, &ncl_iod_mutex, PWAIT, "ioddie", 0); | sx_sleep(&ncl_numasync, &ncl_iod_sx, PWAIT, "ioddie", 0); | ||||
NFSUNLOCKIOD(); | NFSUNLOCKIOD(); | ||||
ncl_nhuninit(); | ncl_nhuninit(); | ||||
return (0); | return (0); | ||||
#else | #else | ||||
return (EOPNOTSUPP); | return (EOPNOTSUPP); | ||||
#endif | #endif | ||||
} | } | ||||
void | void | ||||
ncl_dircookie_lock(struct nfsnode *np) | ncl_dircookie_lock(struct nfsnode *np) | ||||
{ | { | ||||
NFSLOCKNODE(np); | NFSLOCKNODE(np); | ||||
while (np->n_flag & NDIRCOOKIELK) | while (np->n_flag & NDIRCOOKIELK) | ||||
(void) msleep(&np->n_flag, &np->n_mtx, PZERO, "nfsdirlk", 0); | sx_sleep(&np->n_flag, &np->n_sx, PZERO, "nfsdirlk", 0); | ||||
np->n_flag |= NDIRCOOKIELK; | np->n_flag |= NDIRCOOKIELK; | ||||
NFSUNLOCKNODE(np); | NFSUNLOCKNODE(np); | ||||
} | } | ||||
void | void | ||||
ncl_dircookie_unlock(struct nfsnode *np) | ncl_dircookie_unlock(struct nfsnode *np) | ||||
{ | { | ||||
NFSLOCKNODE(np); | NFSLOCKNODE(np); | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |