aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorDon Lewis <truckman@FreeBSD.org>2002-09-19 13:32:45 +0000
committerDon Lewis <truckman@FreeBSD.org>2002-09-19 13:32:45 +0000
commitfa288043e2c7d1d75b1bdae82704af2eace72de7 (patch)
treefed75b0fd3d3243127e21c52a13f663281ff50f1 /sys/ufs
parentcbf549638241c7c2a8bf7b13bf9f789b948934eb (diff)
Notes
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index b7d6425c762f0..5ec4b6e6e89b7 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -814,7 +814,6 @@ ufs_link(ap)
struct vnode *vp = ap->a_vp;
struct vnode *tdvp = ap->a_tdvp;
struct componentname *cnp = ap->a_cnp;
- struct thread *td = cnp->cn_thread;
struct inode *ip;
struct direct newdir;
int error;
@@ -825,19 +824,16 @@ ufs_link(ap)
#endif
if (tdvp->v_mount != vp->v_mount) {
error = EXDEV;
- goto out2;
- }
- if (tdvp != vp && (error = vn_lock(vp, LK_EXCLUSIVE, td))) {
- goto out2;
+ goto out;
}
ip = VTOI(vp);
if ((nlink_t)ip->i_nlink >= LINK_MAX) {
error = EMLINK;
- goto out1;
+ goto out;
}
if (ip->i_flags & (IMMUTABLE | APPEND)) {
error = EPERM;
- goto out1;
+ goto out;
}
ip->i_effnlink++;
ip->i_nlink++;
@@ -859,10 +855,7 @@ ufs_link(ap)
if (DOINGSOFTDEP(vp))
softdep_change_linkcnt(ip);
}
-out1:
- if (tdvp != vp)
- VOP_UNLOCK(vp, 0, td);
-out2:
+out:
VN_KNOTE(vp, NOTE_LINK);
VN_KNOTE(tdvp, NOTE_WRITE);
return (error);