Print this page
basic fsh prototype (no comments yet)

@@ -63,10 +63,11 @@
 #include <sys/nbmlock.h>
 #include <sys/fcntl.h>
 #include <fs/fs_subr.h>
 #include <sys/taskq.h>
 #include <fs/fs_reparse.h>
+#include <sys/fsh_impl.h>
 
 /* Determine if this vnode is a file that is read-only */
 #define ISROFILE(vp)    \
         ((vp)->v_type != VCHR && (vp)->v_type != VBLK && \
             (vp)->v_type != VFIFO && vn_is_readonly(vp))

@@ -3140,11 +3141,15 @@
                         atomic_add_32(&((*vpp)->v_wrcnt), 1);
         }
 
         VOPXID_MAP_CR(vp, cr);
 
-        ret = (*(*(vpp))->v_op->vop_open)(vpp, mode, cr, ct);
+        /*
+         * Control is passed to fsh. In the end, underlying vop_vopen()
+         * is called.
+         */
+        ret = fsh_open(vpp, mode, cr, ct);
 
         if (ret) {
                 /*
                  * Use the saved vp just in case the vnode ptr got trashed
                  * by the error.

@@ -3191,11 +3196,11 @@
 {
         int err;
 
         VOPXID_MAP_CR(vp, cr);
 
-        err = (*(vp)->v_op->vop_close)(vp, flag, count, offset, cr, ct);
+        err = fsh_close(vp, flag, count, offset, cr, ct);
         VOPSTATS_UPDATE(vp, close);
         /*
          * Check passed in count to handle possible dups. Vnode counts are only
          * kept on regular files
          */

@@ -3223,11 +3228,11 @@
         int     err;
         ssize_t resid_start = uiop->uio_resid;
 
         VOPXID_MAP_CR(vp, cr);
 
-        err = (*(vp)->v_op->vop_read)(vp, uiop, ioflag, cr, ct);
+        err = fsh_read(vp, uiop, ioflag, cr, ct);
         VOPSTATS_UPDATE_IO(vp, read,
             read_bytes, (resid_start - uiop->uio_resid));
         return (err);
 }
 

@@ -3242,11 +3247,11 @@
         int     err;
         ssize_t resid_start = uiop->uio_resid;
 
         VOPXID_MAP_CR(vp, cr);
 
-        err = (*(vp)->v_op->vop_write)(vp, uiop, ioflag, cr, ct);
+        err = fsh_write(vp, uiop, ioflag, cr, ct);
         VOPSTATS_UPDATE_IO(vp, write,
             write_bytes, (resid_start - uiop->uio_resid));
         return (err);
 }