Lines Matching defs:nx

2466 nfsrv_hang_addrlist(struct nfs_export *nx, struct user_nfs_export_args *unxa)
2501 if (nx->nx_flags & NX_DEFAULTEXPORT) {
2506 nx->nx_flags |= NX_DEFAULTEXPORT;
2507 nx->nx_defopt.nxo_flags = nxna.nxna_flags;
2508 nx->nx_defopt.nxo_cred = cred;
2509 bcopy(&nxna.nxna_sec, &nx->nx_defopt.nxo_sec, sizeof(struct nfs_sec));
2510 nx->nx_expcnt++;
2536 if ((rnh = nx->nx_rtable[i]) == 0) {
2543 dom->dom_rtattach((void **)&nx->nx_rtable[i],
2548 if ((rnh = nx->nx_rtable[i]) == 0) {
2612 nx->nx_expcnt++;
2648 nfsrv_free_addrlist(struct nfs_export *nx, struct user_nfs_export_args *unxa)
2662 if ( (rnh = nx->nx_rtable[i]) ) {
2664 fna.cnt = &nx->nx_expcnt;
2667 nx->nx_rtable[i] = 0;
2681 if (nx->nx_flags & NX_DEFAULTEXPORT) {
2682 nx->nx_flags &= ~NX_DEFAULTEXPORT;
2683 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
2684 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
2686 nx->nx_expcnt--;
2691 if ((rnh = nx->nx_rtable[nxna.nxna_addr.ss_family]) == 0) {
2712 nx->nx_expcnt--;
2713 if (nx->nx_expcnt == ((nx->nx_flags & NX_DEFAULTEXPORT) ? 1 : 0)) {
2716 nx->nx_rtable[nxna.nxna_addr.ss_family] = 0;
2731 struct nfs_export *nx, *nx2, *nx3;
2783 while ((nx = LIST_FIRST(&nxfs->nxfs_exports))) {
2784 LIST_REMOVE(nx, nx_next);
2785 LIST_REMOVE(nx, nx_hash);
2787 nfsrv_free_addrlist(nx, NULL);
2788 nx->nx_flags &= ~NX_DEFAULTEXPORT;
2789 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
2790 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
2793 nfsrv_free_user_list(&nx->nx_user_list);
2794 FREE(nx->nx_path, M_TEMP);
2795 FREE(nx, M_TEMP);
2939 LIST_FOREACH(nx, &nxfs->nxfs_exports, nx_next) {
2940 if (nx->nx_id == unxa->nxa_expid)
2943 if (nx) {
2945 if (strncmp(path, nx->nx_path, MAXPATHLEN)) {
2956 MALLOC(nx, struct nfs_export *, sizeof(struct nfs_export), M_TEMP, M_WAITOK);
2957 if (!nx) {
2961 bzero(nx, sizeof(struct nfs_export));
2962 nx->nx_id = unxa->nxa_expid;
2963 nx->nx_fs = nxfs;
2964 microtime(&nx->nx_exptime);
2965 MALLOC(nx->nx_path, char*, pathlen, M_TEMP, M_WAITOK);
2966 if (!nx->nx_path) {
2968 FREE(nx, M_TEMP);
2969 nx = NULL;
2972 bcopy(path, nx->nx_path, pathlen);
2974 nfsrv_init_user_list(&nx->nx_user_list);
2978 if (strncmp(nx->nx_path, nx2->nx_path, MAXPATHLEN) > 0)
2983 LIST_INSERT_BEFORE(nx2, nx, nx_next);
2985 LIST_INSERT_AFTER(nx3, nx, nx_next);
2987 LIST_INSERT_HEAD(&nxfs->nxfs_exports, nx, nx_next);
2989 LIST_INSERT_HEAD(NFSRVEXPHASH(nxfs->nxfs_id, nx->nx_id), nx, nx_hash);
2997 if ((nx3 && !strncmp(nx3->nx_path, nx->nx_path, pathlen - 1) &&
2999 (nx2 && !strncmp(nx2->nx_path, nx->nx_path, strlen(nx2->nx_path)) &&
3000 (nx->nx_path[strlen(nx2->nx_path)] == '/')))
3004 expisroot = !nx->nx_path[0] ||
3005 ((nx->nx_path[0] == '.') && !nx->nx_path[1]);
3008 if (nx2 != nx)
3029 nxfs->nxfs_path, nx->nx_path);
3032 nx->nx_fh.nfh_xh.nxh_flags = NXHF_INVALIDFH;
3035 if ((nx->nx_fh.nfh_xh.nxh_version != htonl(NFS_FH_VERSION)) ||
3036 (nx->nx_fh.nfh_xh.nxh_flags & NXHF_INVALIDFH)) {
3038 nx->nx_fh.nfh_xh.nxh_version = htonl(NFS_FH_VERSION);
3039 nx->nx_fh.nfh_xh.nxh_fsid = htonl(nx->nx_fs->nxfs_id);
3040 nx->nx_fh.nfh_xh.nxh_expid = htonl(nx->nx_id);
3041 nx->nx_fh.nfh_xh.nxh_flags = 0;
3042 nx->nx_fh.nfh_xh.nxh_reserved = 0;
3043 nx->nx_fh.nfh_fhp = (u_char*)&nx->nx_fh.nfh_xh;
3044 bzero(&nx->nx_fh.nfh_fid[0], NFSV2_MAX_FID_SIZE);
3047 if (!nx->nx_path[0] || ((nx->nx_path[0] == '.') && !nx->nx_path[1])) {
3079 nx->nx_fh.nfh_len = NFSV3_MAX_FID_SIZE;
3080 error = VFS_VPTOFH(xvp, (int*)&nx->nx_fh.nfh_len, &nx->nx_fh.nfh_fid[0], NULL);
3081 if (!error && (nx->nx_fh.nfh_len > (int)NFSV3_MAX_FID_SIZE)) {
3084 nx->nx_fh.nfh_xh.nxh_fidlen = nx->nx_fh.nfh_len;
3085 nx->nx_fh.nfh_len += sizeof(nx->nx_fh.nfh_xh);
3092 nx->nx_fh.nfh_xh.nxh_flags = NXHF_INVALIDFH;
3093 nx->nx_fh.nfh_xh.nxh_fidlen = 0;
3094 nx->nx_fh.nfh_len = sizeof(nx->nx_fh.nfh_xh);
3098 nx = NULL;
3103 if (!nx) {
3105 while ((nx = LIST_FIRST(&nxfs->nxfs_exports))) {
3106 LIST_REMOVE(nx, nx_next);
3107 LIST_REMOVE(nx, nx_hash);
3109 nfsrv_free_addrlist(nx, NULL);
3110 nx->nx_flags &= ~NX_DEFAULTEXPORT;
3111 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
3112 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
3115 nfsrv_free_user_list(&nx->nx_user_list);
3116 FREE(nx->nx_path, M_TEMP);
3117 FREE(nx, M_TEMP);
3122 nfsrv_free_addrlist(nx, NULL);
3123 nx->nx_flags &= ~NX_DEFAULTEXPORT;
3124 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
3125 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
3129 error = nfsrv_free_addrlist(nx, unxa);
3141 microtime(&nx->nx_exptime);
3143 error = nfsrv_hang_addrlist(nx, unxa);
3149 if (nx && !nx->nx_expcnt) {
3151 LIST_REMOVE(nx, nx_next);
3152 LIST_REMOVE(nx, nx_hash);
3154 nfsrv_free_user_list(&nx->nx_user_list);
3155 FREE(nx->nx_path, M_TEMP);
3156 FREE(nx, M_TEMP);
3180 nfsrv_export_lookup(struct nfs_export *nx, mbuf_t nam)
3190 rnh = nx->nx_rtable[saddr->sa_family];
3201 if ((nxo == NULL) && (nx->nx_flags & NX_DEFAULTEXPORT))
3202 nxo = &nx->nx_defopt;
3211 struct nfs_export *nx;
3218 nx = NFSRVEXPHASH(fsid, expid)->lh_first;
3219 for (; nx; nx = LIST_NEXT(nx, nx_hash)) {
3220 if (nx->nx_fs->nxfs_id != fsid)
3222 if (nx->nx_id != expid)
3226 return (nx);
3344 __unused struct nfs_export *nx,
3369 struct nfs_export *nx,
3381 nfhp->nfh_xh.nxh_fsid = htonl(nx->nx_fs->nxfs_id);
3382 nfhp->nfh_xh.nxh_expid = htonl(nx->nx_id);
3390 if (dnfhp && nfsrv_fhmatch(dnfhp, &nx->nx_fh)) {
3522 nfsrv_update_user_stat(struct nfs_export *nx, struct nfsrv_descript *nd, uid_t uid, u_int ops, u_int rd_bytes, u_int wr_bytes)
3528 if ((!nfsrv_user_stat_enabled) || (!nx) || (!nd) || (!nd->nd_nam))
3537 ulist = &nx->nx_user_list;
3604 struct nfs_export *nx;
3617 LIST_FOREACH(nx, &nxfs->nxfs_exports, nx_next) {
3619 ulist = &nx->nx_user_list;