[BACK]Return to ulfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / ufs / lfs

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

Diff for /src/sys/ufs/lfs/ulfs_vnops.c between version 1.55 and 1.56

version 1.55, 2021/10/20 03:08:19 version 1.56, 2022/03/27 16:24:59
Line 561  ulfs_link(void *v)
Line 561  ulfs_link(void *v)
         struct vnode *vp = ap->a_vp;          struct vnode *vp = ap->a_vp;
         struct componentname *cnp = ap->a_cnp;          struct componentname *cnp = ap->a_cnp;
         struct inode *ip;          struct inode *ip;
         int error;          int error, abrt = 1;
         struct ulfs_lookup_results *ulr;          struct ulfs_lookup_results *ulr;
   
         KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);          KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);
Line 573  ulfs_link(void *v)
Line 573  ulfs_link(void *v)
         ULFS_CHECK_CRAPCOUNTER(VTOI(dvp));          ULFS_CHECK_CRAPCOUNTER(VTOI(dvp));
   
         error = vn_lock(vp, LK_EXCLUSIVE);          error = vn_lock(vp, LK_EXCLUSIVE);
         if (error) {          if (error)
                 VOP_ABORTOP(dvp, cnp);  
                 goto out2;                  goto out2;
         }  
         if (vp->v_mount != dvp->v_mount) {          if (vp->v_mount != dvp->v_mount) {
                 error = ENOENT;                  error = ENOENT;
                 VOP_ABORTOP(dvp, cnp);  
                 goto out2;                  goto out2;
         }          }
         ip = VTOI(vp);          ip = VTOI(vp);
         if ((nlink_t)ip->i_nlink >= LINK_MAX) {          if ((nlink_t)ip->i_nlink >= LINK_MAX) {
                 VOP_ABORTOP(dvp, cnp);  
                 error = EMLINK;                  error = EMLINK;
                 goto out1;                  goto out1;
         }          }
         if (ip->i_flags & (IMMUTABLE | APPEND)) {          if (ip->i_flags & (IMMUTABLE | APPEND)) {
                 VOP_ABORTOP(dvp, cnp);  
                 error = EPERM;                  error = EPERM;
                 goto out1;                  goto out1;
         }          }
           error = kauth_authorize_vnode(cnp->cn_cred, KAUTH_VNODE_ADD_LINK, vp,
               dvp, 0);
           if (error)
                   goto out1;
           abrt = 0;
         ip->i_nlink++;          ip->i_nlink++;
         DIP_ASSIGN(ip, nlink, ip->i_nlink);          DIP_ASSIGN(ip, nlink, ip->i_nlink);
         ip->i_state |= IN_CHANGE;          ip->i_state |= IN_CHANGE;
Line 608  ulfs_link(void *v)
Line 608  ulfs_link(void *v)
         }          }
  out1:   out1:
         VOP_UNLOCK(vp);          VOP_UNLOCK(vp);
           if (abrt)
                   VOP_ABORTOP(dvp, cnp);
  out2:   out2:
         return (error);          return (error);
 }  }

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

CVSweb <webmaster@jp.NetBSD.org>