Print this page
basic FSH

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/vnode.c
          +++ new/usr/src/uts/common/fs/vnode.c
↓ open down ↓ 57 lines elided ↑ open up ↑
  58   58  #include <sys/systm.h>
  59   59  #include <sys/kmem.h>
  60   60  #include <sys/debug.h>
  61   61  #include <c2/audit.h>
  62   62  #include <sys/acl.h>
  63   63  #include <sys/nbmlock.h>
  64   64  #include <sys/fcntl.h>
  65   65  #include <fs/fs_subr.h>
  66   66  #include <sys/taskq.h>
  67   67  #include <fs/fs_reparse.h>
       68 +#include <sys/fsh_impl.h>
  68   69  
  69   70  /* Determine if this vnode is a file that is read-only */
  70   71  #define ISROFILE(vp)    \
  71   72          ((vp)->v_type != VCHR && (vp)->v_type != VBLK && \
  72   73              (vp)->v_type != VFIFO && vn_is_readonly(vp))
  73   74  
  74   75  /* Tunable via /etc/system; used only by admin/install */
  75   76  int nfs_global_client_only;
  76   77  
  77   78  /*
↓ open down ↓ 3057 lines elided ↑ open up ↑
3135 3136           */
3136 3137          if ((*vpp)->v_type == VREG) {
3137 3138                  if (mode & FREAD)
3138 3139                          atomic_add_32(&((*vpp)->v_rdcnt), 1);
3139 3140                  if (mode & FWRITE)
3140 3141                          atomic_add_32(&((*vpp)->v_wrcnt), 1);
3141 3142          }
3142 3143  
3143 3144          VOPXID_MAP_CR(vp, cr);
3144 3145  
3145      -        ret = (*(*(vpp))->v_op->vop_open)(vpp, mode, cr, ct);
     3146 +        ret = fsh_open(vpp, mode, cr, ct);
3146 3147  
3147 3148          if (ret) {
3148 3149                  /*
3149 3150                   * Use the saved vp just in case the vnode ptr got trashed
3150 3151                   * by the error.
3151 3152                   */
3152 3153                  VOPSTATS_UPDATE(vp, open);
3153 3154                  if ((vp->v_type == VREG) && (mode & FREAD))
3154 3155                          atomic_add_32(&(vp->v_rdcnt), -1);
3155 3156                  if ((vp->v_type == VREG) && (mode & FWRITE))
↓ open down ↓ 30 lines elided ↑ open up ↑
3186 3187          int flag,
3187 3188          int count,
3188 3189          offset_t offset,
3189 3190          cred_t *cr,
3190 3191          caller_context_t *ct)
3191 3192  {
3192 3193          int err;
3193 3194  
3194 3195          VOPXID_MAP_CR(vp, cr);
3195 3196  
3196      -        err = (*(vp)->v_op->vop_close)(vp, flag, count, offset, cr, ct);
     3197 +        err = fsh_close(vp, flag, count, offset, cr, ct);
3197 3198          VOPSTATS_UPDATE(vp, close);
3198 3199          /*
3199 3200           * Check passed in count to handle possible dups. Vnode counts are only
3200 3201           * kept on regular files
3201 3202           */
3202 3203          if ((vp->v_type == VREG) && (count == 1))  {
3203 3204                  if (flag & FREAD) {
3204 3205                          ASSERT(vp->v_rdcnt > 0);
3205 3206                          atomic_add_32(&(vp->v_rdcnt), -1);
3206 3207                  }
↓ open down ↓ 11 lines elided ↑ open up ↑
3218 3219          uio_t *uiop,
3219 3220          int ioflag,
3220 3221          cred_t *cr,
3221 3222          caller_context_t *ct)
3222 3223  {
3223 3224          int     err;
3224 3225          ssize_t resid_start = uiop->uio_resid;
3225 3226  
3226 3227          VOPXID_MAP_CR(vp, cr);
3227 3228  
3228      -        err = (*(vp)->v_op->vop_read)(vp, uiop, ioflag, cr, ct);
     3229 +        err = fsh_read(vp, uiop, ioflag, cr, ct);
3229 3230          VOPSTATS_UPDATE_IO(vp, read,
3230 3231              read_bytes, (resid_start - uiop->uio_resid));
3231 3232          return (err);
3232 3233  }
3233 3234  
3234 3235  int
3235 3236  fop_write(
3236 3237          vnode_t *vp,
3237 3238          uio_t *uiop,
3238 3239          int ioflag,
3239 3240          cred_t *cr,
3240 3241          caller_context_t *ct)
3241 3242  {
3242 3243          int     err;
3243 3244          ssize_t resid_start = uiop->uio_resid;
3244 3245  
3245 3246          VOPXID_MAP_CR(vp, cr);
3246 3247  
3247      -        err = (*(vp)->v_op->vop_write)(vp, uiop, ioflag, cr, ct);
     3248 +        err = fsh_write(vp, uiop, ioflag, cr, ct);
3248 3249          VOPSTATS_UPDATE_IO(vp, write,
3249 3250              write_bytes, (resid_start - uiop->uio_resid));
3250 3251          return (err);
3251 3252  }
3252 3253  
3253 3254  int
3254 3255  fop_ioctl(
3255 3256          vnode_t *vp,
3256 3257          int cmd,
3257 3258          intptr_t arg,
↓ open down ↓ 1279 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX