[BACK]Return to filecore_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / fs / filecorefs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/fs/filecorefs/filecore_vnops.c between version 1.34 and 1.34.2.4

version 1.34, 2012/03/13 18:40:37 version 1.34.2.4, 2017/12/03 11:38:41
Line 126  filecore_check_permitted(struct vnode *v
Line 126  filecore_check_permitted(struct vnode *v
 {  {
         struct filecore_mnt *fcmp = ip->i_mnt;          struct filecore_mnt *fcmp = ip->i_mnt;
   
         return kauth_authorize_vnode(cred, kauth_access_action(mode,          return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(mode,
             vp->v_type, filecore_mode(ip)), vp, NULL,              vp->v_type, filecore_mode(ip)), vp, NULL,
             genfs_can_access(vp->v_type, filecore_mode(ip), fcmp->fc_uid,              genfs_can_access(vp->v_type, filecore_mode(ip), fcmp->fc_uid,
             fcmp->fc_gid, mode, cred));              fcmp->fc_gid, mode, cred));
Line 204  filecore_read(void *v)
Line 204  filecore_read(void *v)
         struct filecore_node *ip = VTOI(vp);          struct filecore_node *ip = VTOI(vp);
         struct filecore_mnt *fcmp;          struct filecore_mnt *fcmp;
         struct buf *bp;          struct buf *bp;
         daddr_t lbn, rablock;          daddr_t lbn;
         off_t diff;          off_t diff;
         int error = 0;          int error = 0;
         long size, n, on;          long size, n, on;
Line 239  filecore_read(void *v)
Line 239  filecore_read(void *v)
         }          }
   
         do {          do {
                 lbn = lblkno(fcmp, uio->uio_offset);                  lbn = filecore_lblkno(fcmp, uio->uio_offset);
                 on = blkoff(fcmp, uio->uio_offset);                  on = filecore_blkoff(fcmp, uio->uio_offset);
                 n = MIN(blksize(fcmp, ip, lbn) - on, uio->uio_resid);                  n = MIN(filecore_blksize(fcmp, ip, lbn) - on, uio->uio_resid);
                 diff = (off_t)ip->i_size - uio->uio_offset;                  diff = (off_t)ip->i_size - uio->uio_offset;
                 if (diff <= 0)                  if (diff <= 0)
                         return (0);                          return (0);
                 if (diff < n)                  if (diff < n)
                         n = diff;                          n = diff;
                 size = blksize(fcmp, ip, lbn);                  size = filecore_blksize(fcmp, ip, lbn);
                 rablock = lbn + 1;  
                 if (ip->i_dirent.attr & FILECORE_ATTR_DIR) {                  if (ip->i_dirent.attr & FILECORE_ATTR_DIR) {
                         error = filecore_dbread(ip, &bp);                          error = filecore_dbread(ip, &bp);
                         on = uio->uio_offset;                          on = uio->uio_offset;
                         n = MIN(FILECORE_DIR_SIZE - on, uio->uio_resid);                          n = MIN(FILECORE_DIR_SIZE - on, uio->uio_resid);
                         size = FILECORE_DIR_SIZE;                          size = FILECORE_DIR_SIZE;
                 } else {                  } else {
                         error = bread(vp, lbn, size, NOCRED, 0, &bp);                          error = bread(vp, lbn, size, 0, &bp);
 #ifdef FILECORE_DEBUG_BR  #ifdef FILECORE_DEBUG_BR
                         printf("bread(%p, %llx, %ld, CRED, %p)=%d\n",                          printf("bread(%p, %llx, %ld, CRED, %p)=%d\n",
                             vp, (long long)lbn, size, bp, error);                              vp, (long long)lbn, size, bp, error);
 #endif  #endif
                 }                  }
                 n = MIN(n, size - bp->b_resid);  
                 if (error) {                  if (error) {
 #ifdef FILECORE_DEBUG_BR  
                         printf("brelse(%p) vn1\n", bp);  
 #endif  
                         brelse(bp, 0);  
                         return (error);                          return (error);
                 }                  }
                   n = MIN(n, size - bp->b_resid);
   
                 error = uiomove((char *)(bp->b_data) + on, (int)n, uio);                  error = uiomove((char *)(bp->b_data) + on, (int)n, uio);
 #ifdef FILECORE_DEBUG_BR  #ifdef FILECORE_DEBUG_BR
Line 298  filecore_readdir(void *v)
Line 293  filecore_readdir(void *v)
         struct uio *uio = ap->a_uio;          struct uio *uio = ap->a_uio;
         struct vnode *vdp = ap->a_vp;          struct vnode *vdp = ap->a_vp;
         struct filecore_node *dp;          struct filecore_node *dp;
         struct filecore_mnt *fcmp;  
         struct buf *bp = NULL;          struct buf *bp = NULL;
         struct dirent *de;          struct dirent *de;
         struct filecore_direntry *dep = NULL;          struct filecore_direntry *dep = NULL;
Line 319  filecore_readdir(void *v)
Line 313  filecore_readdir(void *v)
         uiooff = uio->uio_offset;          uiooff = uio->uio_offset;
   
         *ap->a_eofflag = 0;          *ap->a_eofflag = 0;
         fcmp = dp->i_mnt;  
   
         error = filecore_dbread(dp, &bp);          error = filecore_dbread(dp, &bp);
         if (error) {          if (error) {
                 brelse(bp, 0);  
                 return error;                  return error;
         }          }
   
Line 427  filecore_readlink(void *v)
Line 419  filecore_readlink(void *v)
 int  int
 filecore_link(void *v)  filecore_link(void *v)
 {  {
         struct vop_link_args /* {          struct vop_link_v2_args /* {
                 struct vnode *a_dvp;                  struct vnode *a_dvp;
                 struct vnode *a_vp;                  struct vnode *a_vp;
                 struct componentname *a_cnp;                  struct componentname *a_cnp;
         } */ *ap = v;          } */ *ap = v;
   
         VOP_ABORTOP(ap->a_dvp, ap->a_cnp);          VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
         vput(ap->a_dvp);  
         return (EROFS);          return (EROFS);
 }  }
   
 int  int
 filecore_symlink(void *v)  filecore_symlink(void *v)
 {  {
         struct vop_symlink_args /* {          struct vop_symlink_v3_args /* {
                 struct vnode *a_dvp;                  struct vnode *a_dvp;
                 struct vnode **a_vpp;                  struct vnode **a_vpp;
                 struct componentname *a_cnp;                  struct componentname *a_cnp;
Line 450  filecore_symlink(void *v)
Line 441  filecore_symlink(void *v)
         } */ *ap = v;          } */ *ap = v;
   
         VOP_ABORTOP(ap->a_dvp, ap->a_cnp);          VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
         vput(ap->a_dvp);  
         return (EROFS);          return (EROFS);
 }  }
   
Line 574  const struct vnodeopv_entry_desc filecor
Line 564  const struct vnodeopv_entry_desc filecor
         { &vop_setattr_desc, filecore_setattr },        /* setattr */          { &vop_setattr_desc, filecore_setattr },        /* setattr */
         { &vop_read_desc, filecore_read },              /* read */          { &vop_read_desc, filecore_read },              /* read */
         { &vop_write_desc, filecore_write },            /* write */          { &vop_write_desc, filecore_write },            /* write */
           { &vop_fallocate_desc, genfs_eopnotsupp },      /* fallocate */
           { &vop_fdiscard_desc, genfs_eopnotsupp },       /* fdiscard */
         { &vop_fcntl_desc, filecore_fcntl },            /* fcntl */          { &vop_fcntl_desc, filecore_fcntl },            /* fcntl */
         { &vop_ioctl_desc, filecore_ioctl },            /* ioctl */          { &vop_ioctl_desc, filecore_ioctl },            /* ioctl */
         { &vop_poll_desc, filecore_poll },              /* poll */          { &vop_poll_desc, filecore_poll },              /* poll */

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.34.2.4

CVSweb <webmaster@jp.NetBSD.org>