vfs_extattr.c (d3a7b5e70e4f8338bc2b3556df238e6ffb79a2ae) | vfs_extattr.c (fa288043e2c7d1d75b1bdae82704af2eace72de7) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 1013 unchanged lines hidden (view full) --- 1022 vrele(vp); 1023 return (error); 1024 } 1025 NDINIT(&nd, CREATE, LOCKPARENT | NOOBJ | SAVENAME, segflg, link, td); 1026 if ((error = namei(&nd)) == 0) { 1027 if (nd.ni_vp != NULL) { 1028 vrele(nd.ni_vp); 1029 error = EEXIST; | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 1013 unchanged lines hidden (view full) --- 1022 vrele(vp); 1023 return (error); 1024 } 1025 NDINIT(&nd, CREATE, LOCKPARENT | NOOBJ | SAVENAME, segflg, link, td); 1026 if ((error = namei(&nd)) == 0) { 1027 if (nd.ni_vp != NULL) { 1028 vrele(nd.ni_vp); 1029 error = EEXIST; |
1030 } else { | 1030 } else if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td)) 1031 == 0) { |
1031 VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); 1032 VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); 1033 error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); | 1032 VOP_LEASE(nd.ni_dvp, td, td->td_ucred, LEASE_WRITE); 1033 VOP_LEASE(vp, td, td->td_ucred, LEASE_WRITE); 1034 error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); |
1035 VOP_UNLOCK(vp, 0, td); |
|
1034 } 1035 NDFREE(&nd, NDF_ONLY_PNBUF); 1036 vput(nd.ni_dvp); 1037 } 1038 vrele(vp); 1039 vn_finished_write(mp); 1040 ASSERT_VOP_UNLOCKED(nd.ni_dvp, "link"); 1041 ASSERT_VOP_UNLOCKED(nd.ni_vp, "link"); --- 3061 unchanged lines hidden --- | 1036 } 1037 NDFREE(&nd, NDF_ONLY_PNBUF); 1038 vput(nd.ni_dvp); 1039 } 1040 vrele(vp); 1041 vn_finished_write(mp); 1042 ASSERT_VOP_UNLOCKED(nd.ni_dvp, "link"); 1043 ASSERT_VOP_UNLOCKED(nd.ni_vp, "link"); --- 3061 unchanged lines hidden --- |