aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu
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/gnu
parentcbf549638241c7c2a8bf7b13bf9f789b948934eb (diff)
Notes
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c15
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vnops.c15
2 files changed, 8 insertions, 22 deletions
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index dd24a9d7c31c8..c1fba78110286 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -827,7 +827,6 @@ ext2_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;
int error;
@@ -837,19 +836,16 @@ ext2_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_nlink++;
ip->i_flag |= IN_CHANGE;
@@ -860,10 +856,7 @@ ext2_link(ap)
ip->i_nlink--;
ip->i_flag |= IN_CHANGE;
}
-out1:
- if (tdvp != vp)
- VOP_UNLOCK(vp, 0, td);
-out2:
+out:
return (error);
}
diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c
index dd24a9d7c31c8..c1fba78110286 100644
--- a/sys/gnu/fs/ext2fs/ext2_vnops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vnops.c
@@ -827,7 +827,6 @@ ext2_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;
int error;
@@ -837,19 +836,16 @@ ext2_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_nlink++;
ip->i_flag |= IN_CHANGE;
@@ -860,10 +856,7 @@ ext2_link(ap)
ip->i_nlink--;
ip->i_flag |= IN_CHANGE;
}
-out1:
- if (tdvp != vp)
- VOP_UNLOCK(vp, 0, td);
-out2:
+out:
return (error);
}