Print this page
NEX-16712 NFS dtrace providers do not support per-share filtering
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Yuri Pankon <yuri.pankov@nexenta.com>

@@ -21,10 +21,13 @@
 
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 #pragma D depends_on library ip.d
 #pragma D depends_on library net.d
 #pragma D depends_on module nfs
 

@@ -33,10 +36,11 @@
 
 typedef struct nfsv4opinfo {
         uint64_t noi_xid;       /* unique transation ID */
         cred_t *noi_cred;       /* credentials for operation */
         string noi_curpath;     /* current file handle path (if any) */
+        string noi_shrpath;     /* current share path */
 } nfsv4opinfo_t;
 
 typedef struct nfsv4cbinfo {
         string nci_curpath;     /* current file handle path (if any) */
 } nfsv4cbinfo_t;

@@ -99,16 +103,19 @@
 #pragma D binding "1.5" translator
 translator nfsv4opinfo_t < struct compound_state *P > {
         noi_xid = P->req->rq_xprt->xp_xid;
         noi_cred = P->basecr;
         noi_curpath = (P->vp == NULL) ? "<unknown>" : P->vp->v_path;
+        noi_shrpath = (P->exi == NULL || P->exi->exi_export.ex_path == NULL) ?
+            "<unknown>" : P->exi->exi_export.ex_path;
 };
 
 typedef struct nfsv3opinfo {
         uint64_t noi_xid;       /* unique transation ID */
         cred_t *noi_cred;       /* credentials for operation */
         string noi_curpath;     /* current file handle path (if any) */
+        string noi_shrpath;     /* current share path */
 } nfsv3opinfo_t;
 
 typedef struct nfsv3oparg nfsv3oparg_t;
 
 #pragma D binding "1.5" translator

@@ -115,6 +122,9 @@
 translator nfsv3opinfo_t < nfsv3oparg_t *P > {
         noi_xid = ((struct svc_req *)arg0)->rq_xprt->xp_xid;
         noi_cred = (cred_t *)arg1;
         noi_curpath = (arg2 == 0 || ((vnode_t *)arg2)->v_path == NULL) ?
             "<unknown>" : ((vnode_t *)arg2)->v_path;
+        noi_shrpath =
+            (arg3 == 0 || ((exportinfo_t *)arg3)->exi_export.ex_path == NULL) ?
+            "<unknown>" : ((exportinfo_t *)arg3)->exi_export.ex_path;
 };