Lines Matching defs:nx

2414 nfsrv_hang_addrlist(struct nfs_export *nx, struct user_nfs_export_args *unxa)
2449 if (nx->nx_flags & NX_DEFAULTEXPORT) {
2454 nx->nx_flags |= NX_DEFAULTEXPORT;
2455 nx->nx_defopt.nxo_flags = nxna.nxna_flags;
2456 nx->nx_defopt.nxo_cred = cred;
2457 bcopy(&nxna.nxna_sec, &nx->nx_defopt.nxo_sec, sizeof(struct nfs_sec));
2458 nx->nx_expcnt++;
2484 if ((rnh = nx->nx_rtable[i]) == 0) {
2491 dom->dom_rtattach((void **)&nx->nx_rtable[i],
2495 if ((rnh = nx->nx_rtable[i]) == 0) {
2559 nx->nx_expcnt++;
2595 nfsrv_free_addrlist(struct nfs_export *nx, struct user_nfs_export_args *unxa)
2609 if ( (rnh = nx->nx_rtable[i]) ) {
2611 fna.cnt = &nx->nx_expcnt;
2614 nx->nx_rtable[i] = 0;
2628 if (nx->nx_flags & NX_DEFAULTEXPORT) {
2629 nx->nx_flags &= ~NX_DEFAULTEXPORT;
2630 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
2631 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
2633 nx->nx_expcnt--;
2638 if ((rnh = nx->nx_rtable[nxna.nxna_addr.ss_family]) == 0) {
2659 nx->nx_expcnt--;
2660 if (nx->nx_expcnt == ((nx->nx_flags & NX_DEFAULTEXPORT) ? 1 : 0)) {
2663 nx->nx_rtable[nxna.nxna_addr.ss_family] = 0;
2678 struct nfs_export *nx, *nx2, *nx3;
2730 while ((nx = LIST_FIRST(&nxfs->nxfs_exports))) {
2731 LIST_REMOVE(nx, nx_next);
2732 LIST_REMOVE(nx, nx_hash);
2734 nfsrv_free_addrlist(nx, NULL);
2735 nx->nx_flags &= ~NX_DEFAULTEXPORT;
2736 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
2737 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
2740 nfsrv_free_user_list(&nx->nx_user_list);
2741 FREE(nx->nx_path, M_TEMP);
2742 FREE(nx, M_TEMP);
2886 LIST_FOREACH(nx, &nxfs->nxfs_exports, nx_next) {
2887 if (nx->nx_id == unxa->nxa_expid)
2890 if (nx) {
2892 if (strncmp(path, nx->nx_path, MAXPATHLEN)) {
2903 MALLOC(nx, struct nfs_export *, sizeof(struct nfs_export), M_TEMP, M_WAITOK);
2904 if (!nx) {
2908 bzero(nx, sizeof(struct nfs_export));
2909 nx->nx_id = unxa->nxa_expid;
2910 nx->nx_fs = nxfs;
2911 microtime(&nx->nx_exptime);
2912 MALLOC(nx->nx_path, char*, pathlen, M_TEMP, M_WAITOK);
2913 if (!nx->nx_path) {
2915 FREE(nx, M_TEMP);
2916 nx = NULL;
2919 bcopy(path, nx->nx_path, pathlen);
2921 nfsrv_init_user_list(&nx->nx_user_list);
2925 if (strncmp(nx->nx_path, nx2->nx_path, MAXPATHLEN) > 0)
2930 LIST_INSERT_BEFORE(nx2, nx, nx_next);
2932 LIST_INSERT_AFTER(nx3, nx, nx_next);
2934 LIST_INSERT_HEAD(&nxfs->nxfs_exports, nx, nx_next);
2936 LIST_INSERT_HEAD(NFSRVEXPHASH(nxfs->nxfs_id, nx->nx_id), nx, nx_hash);
2944 if ((nx3 && !strncmp(nx3->nx_path, nx->nx_path, pathlen - 1) &&
2946 (nx2 && !strncmp(nx2->nx_path, nx->nx_path, strlen(nx2->nx_path)) &&
2947 (nx->nx_path[strlen(nx2->nx_path)] == '/')))
2951 expisroot = !nx->nx_path[0] ||
2952 ((nx->nx_path[0] == '.') && !nx->nx_path[1]);
2955 if (nx2 != nx)
2976 nxfs->nxfs_path, nx->nx_path);
2979 nx->nx_fh.nfh_xh.nxh_flags = NXHF_INVALIDFH;
2982 if ((nx->nx_fh.nfh_xh.nxh_version != htonl(NFS_FH_VERSION)) ||
2983 (nx->nx_fh.nfh_xh.nxh_flags & NXHF_INVALIDFH)) {
2985 nx->nx_fh.nfh_xh.nxh_version = htonl(NFS_FH_VERSION);
2986 nx->nx_fh.nfh_xh.nxh_fsid = htonl(nx->nx_fs->nxfs_id);
2987 nx->nx_fh.nfh_xh.nxh_expid = htonl(nx->nx_id);
2988 nx->nx_fh.nfh_xh.nxh_flags = 0;
2989 nx->nx_fh.nfh_xh.nxh_reserved = 0;
2990 nx->nx_fh.nfh_fhp = (u_char*)&nx->nx_fh.nfh_xh;
2991 bzero(&nx->nx_fh.nfh_fid[0], NFSV2_MAX_FID_SIZE);
2994 if (!nx->nx_path[0] || ((nx->nx_path[0] == '.') && !nx->nx_path[1])) {
3026 nx->nx_fh.nfh_len = NFSV3_MAX_FID_SIZE;
3027 error = VFS_VPTOFH(xvp, (int*)&nx->nx_fh.nfh_len, &nx->nx_fh.nfh_fid[0], NULL);
3028 if (!error && (nx->nx_fh.nfh_len > (int)NFSV3_MAX_FID_SIZE)) {
3031 nx->nx_fh.nfh_xh.nxh_fidlen = nx->nx_fh.nfh_len;
3032 nx->nx_fh.nfh_len += sizeof(nx->nx_fh.nfh_xh);
3039 nx->nx_fh.nfh_xh.nxh_flags = NXHF_INVALIDFH;
3040 nx->nx_fh.nfh_xh.nxh_fidlen = 0;
3041 nx->nx_fh.nfh_len = sizeof(nx->nx_fh.nfh_xh);
3045 nx = NULL;
3050 if (!nx) {
3052 while ((nx = LIST_FIRST(&nxfs->nxfs_exports))) {
3053 LIST_REMOVE(nx, nx_next);
3054 LIST_REMOVE(nx, nx_hash);
3056 nfsrv_free_addrlist(nx, NULL);
3057 nx->nx_flags &= ~NX_DEFAULTEXPORT;
3058 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
3059 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
3062 nfsrv_free_user_list(&nx->nx_user_list);
3063 FREE(nx->nx_path, M_TEMP);
3064 FREE(nx, M_TEMP);
3069 nfsrv_free_addrlist(nx, NULL);
3070 nx->nx_flags &= ~NX_DEFAULTEXPORT;
3071 if (IS_VALID_CRED(nx->nx_defopt.nxo_cred)) {
3072 kauth_cred_unref(&nx->nx_defopt.nxo_cred);
3076 error = nfsrv_free_addrlist(nx, unxa);
3088 microtime(&nx->nx_exptime);
3090 error = nfsrv_hang_addrlist(nx, unxa);
3096 if (nx && !nx->nx_expcnt) {
3098 LIST_REMOVE(nx, nx_next);
3099 LIST_REMOVE(nx, nx_hash);
3101 nfsrv_free_user_list(&nx->nx_user_list);
3102 FREE(nx->nx_path, M_TEMP);
3103 FREE(nx, M_TEMP);
3127 nfsrv_export_lookup(struct nfs_export *nx, mbuf_t nam)
3137 rnh = nx->nx_rtable[saddr->sa_family];
3148 if ((nxo == NULL) && (nx->nx_flags & NX_DEFAULTEXPORT))
3149 nxo = &nx->nx_defopt;
3158 struct nfs_export *nx;
3165 nx = NFSRVEXPHASH(fsid, expid)->lh_first;
3166 for (; nx; nx = LIST_NEXT(nx, nx_hash)) {
3167 if (nx->nx_fs->nxfs_id != fsid)
3169 if (nx->nx_id != expid)
3173 return (nx);
3291 __unused struct nfs_export *nx,
3316 struct nfs_export *nx,
3328 nfhp->nfh_xh.nxh_fsid = htonl(nx->nx_fs->nxfs_id);
3329 nfhp->nfh_xh.nxh_expid = htonl(nx->nx_id);
3337 if (dnfhp && nfsrv_fhmatch(dnfhp, &nx->nx_fh)) {
3469 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)
3475 if ((!nfsrv_user_stat_enabled) || (!nx) || (!nd) || (!nd->nd_nam))
3484 ulist = &nx->nx_user_list;
3551 struct nfs_export *nx;
3564 LIST_FOREACH(nx, &nxfs->nxfs_exports, nx_next) {
3566 ulist = &nx->nx_user_list;