%{ #include #include #include #include #include #include #include #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,33) #include #include #endif #include %} function nfs4_callback:string(_stp:long) %{ struct nfs4_stateid *stp = (struct nfs4_stateid *) (long) kread(&(THIS->_stp)); struct nfs4_stateowner *sop = (struct nfs4_stateowner *) (long) kread(&stp->st_stateowner); struct nfs4_client *so_client = (struct nfs4_client *) (long)kread(&sop->so_client); /* struct nfs4_callback *cb = (struct nfs4_callback *) &so_client->cl_callback; */ struct nfs4_cb_conn *cb = (struct nfs4_cb_conn *) &so_client->cl_cb_conn; char buf[MAXSTRINGLEN]; int cc=0; snprintf(buf+cc, MAXSTRINGLEN, "cb: cb_set %d sop %p so_confirmed %d", cb->cb_set.counter, sop, sop->so_confirmed); cc = strlen(buf); snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); CATCH_DEREF_FAULT(); %} function nfs4_callback_addr:string(_clp:long) %{ struct nfs4_client *clp = (struct nfs4_client *) (long)kread(&(THIS->_clp)); char buf[MAXSTRINGLEN]; int cc=0; snprintf(THIS->__retvalue, MAXSTRINGLEN, NIPQUAD_FMT, NIPQUAD(clp->cl_addr)); CATCH_DEREF_FAULT(); %} function nfs4_openconf:string(_oc:long) %{ struct nfsd4_open_confirm *oc = (struct nfsd4_open_confirm *) (long)kread(&(THIS->_oc)); struct nfs4_stateowner *sop = (struct nfs4_stateowner *) (long) kread(&oc->oc_stateowner); snprintf(THIS->__retvalue, MAXSTRINGLEN, "sop %p so_confirmed %d", sop, sop->so_confirmed); CATCH_DEREF_FAULT(); %}