coda_vnops.c (176238) | coda_vnops.c (176263) |
---|---|
1/*- 2 * Coda: an Experimental Distributed File System 3 * Release 3.1 4 * 5 * Copyright (c) 1987-1998 Carnegie Mellon University 6 * All Rights Reserved 7 * 8 * Permission to use, copy, modify and distribute this software and its --- 28 unchanged lines hidden (view full) --- 37 38/* 39 * This code was written for the Coda filesystem at Carnegie Mellon 40 * University. Contributers include David Steere, James Kistler, and 41 * M. Satyanarayanan. 42 */ 43 44#include <sys/cdefs.h> | 1/*- 2 * Coda: an Experimental Distributed File System 3 * Release 3.1 4 * 5 * Copyright (c) 1987-1998 Carnegie Mellon University 6 * All Rights Reserved 7 * 8 * Permission to use, copy, modify and distribute this software and its --- 28 unchanged lines hidden (view full) --- 37 38/* 39 * This code was written for the Coda filesystem at Carnegie Mellon 40 * University. Contributers include David Steere, James Kistler, and 41 * M. Satyanarayanan. 42 */ 43 44#include <sys/cdefs.h> |
45__FBSDID("$FreeBSD: head/sys/fs/coda/coda_vnops.c 176238 2008-02-13 15:45:12Z rwatson $"); | 45__FBSDID("$FreeBSD: head/sys/fs/coda/coda_vnops.c 176263 2008-02-14 00:55:03Z rwatson $"); |
46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/acct.h> 50#include <sys/errno.h> 51#include <sys/fcntl.h> 52#include <sys/kernel.h> 53#include <sys/lock.h> --- 782 unchanged lines hidden (view full) --- 836 if (IS_UNMOUNTING(cp)) { 837#ifdef DEBUG 838 printf("coda_inactive: IS_UNMOUNTING use %d: vp %p, cp %p\n", 839 vrefcnt(vp), vp, cp); 840 if (cp->c_ovp != NULL) 841 printf("coda_inactive: cp->ovp != NULL use %d: vp " 842 "%p, cp %p\n", vrefcnt(vp), vp, cp); 843#endif | 46 47#include <sys/param.h> 48#include <sys/systm.h> 49#include <sys/acct.h> 50#include <sys/errno.h> 51#include <sys/fcntl.h> 52#include <sys/kernel.h> 53#include <sys/lock.h> --- 782 unchanged lines hidden (view full) --- 836 if (IS_UNMOUNTING(cp)) { 837#ifdef DEBUG 838 printf("coda_inactive: IS_UNMOUNTING use %d: vp %p, cp %p\n", 839 vrefcnt(vp), vp, cp); 840 if (cp->c_ovp != NULL) 841 printf("coda_inactive: cp->ovp != NULL use %d: vp " 842 "%p, cp %p\n", vrefcnt(vp), vp, cp); 843#endif |
844 } else { 845#ifdef OLD_DIAGNOSTIC 846 if (vrefcnt(CTOV(cp))) 847 panic("coda_inactive: nonzero reference count"); 848 if (cp->c_ovp != NULL) 849 panic("coda_inactive: cp->ovp != NULL"); 850#endif | 844 } else |
851 vgone(vp); | 845 vgone(vp); |
852 } | |
853 MARK_INT_SAT(CODA_INACTIVE_STATS); 854 return (0); 855} 856 857/* 858 * Remote filesystem operations having to do with directory manipulation. 859 */ 860 --- 214 unchanged lines hidden (view full) --- 1075 CODADEBUG(CODA_CREATE, myprintf(("create error %d\n", 1076 error));); 1077 } 1078 if (!error) { 1079 if (cnp->cn_flags & MAKEENTRY) 1080 cache_enter(dvp, *vpp, cnp); 1081 if (cnp->cn_flags & LOCKLEAF) 1082 vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY); | 846 MARK_INT_SAT(CODA_INACTIVE_STATS); 847 return (0); 848} 849 850/* 851 * Remote filesystem operations having to do with directory manipulation. 852 */ 853 --- 214 unchanged lines hidden (view full) --- 1068 CODADEBUG(CODA_CREATE, myprintf(("create error %d\n", 1069 error));); 1070 } 1071 if (!error) { 1072 if (cnp->cn_flags & MAKEENTRY) 1073 cache_enter(dvp, *vpp, cnp); 1074 if (cnp->cn_flags & LOCKLEAF) 1075 vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY); |
1083#ifdef OLD_DIAGNOSTIC 1084 else 1085 printf("coda_create: LOCKLEAF not set!\n"); 1086#endif | |
1087 } else if (error == ENOENT) { 1088 /* 1089 * XXXRW: We only enter a negative entry if ENOENT is 1090 * returned, not other errors. But will Venus invalidate dvp 1091 * properly in all cases when new files appear via the 1092 * network rather than a local operation? 1093 */ 1094 if (cnp->cn_flags & MAKEENTRY) --- 114 unchanged lines hidden (view full) --- 1209 const char *fnm = fcnp->cn_nameptr; 1210 int flen = fcnp->cn_namelen; 1211 const char *tnm = tcnp->cn_nameptr; 1212 int tlen = tcnp->cn_namelen; 1213 1214 MARK_ENTRY(CODA_RENAME_STATS); 1215 1216 /* | 1076 } else if (error == ENOENT) { 1077 /* 1078 * XXXRW: We only enter a negative entry if ENOENT is 1079 * returned, not other errors. But will Venus invalidate dvp 1080 * properly in all cases when new files appear via the 1081 * network rather than a local operation? 1082 */ 1083 if (cnp->cn_flags & MAKEENTRY) --- 114 unchanged lines hidden (view full) --- 1198 const char *fnm = fcnp->cn_nameptr; 1199 int flen = fcnp->cn_namelen; 1200 const char *tnm = tcnp->cn_nameptr; 1201 int tlen = tcnp->cn_namelen; 1202 1203 MARK_ENTRY(CODA_RENAME_STATS); 1204 1205 /* |
1217 * Hmmm. The vnodes are already looked up. Perhaps they are locked? 1218 * This could be Bad. XXX 1219 */ 1220#ifdef OLD_DIAGNOSTIC 1221 if ((fcnp->cn_cred != tcnp->cn_cred) || 1222 (fcnp->cn_thread != tcnp->cn_thread)) 1223 panic("coda_rename: component names don't agree"); 1224#endif 1225 1226 /* | |
1227 * Check for rename involving control object. 1228 */ 1229 if (IS_CTL_NAME(odvp, fnm, flen) || IS_CTL_NAME(ndvp, tnm, tlen)) { 1230 MARK_INT_FAIL(CODA_RENAME_STATS); 1231 return (EACCES); 1232 } 1233 1234 /* --- 332 unchanged lines hidden (view full) --- 1567#ifdef DEBUG 1568 if (VTOC(vp)->c_ovp) { 1569 if (IS_UNMOUNTING(cp)) 1570 printf("coda_reclaim: c_ovp not void: vp " 1571 "%p, cp %p\n", vp, cp); 1572 } 1573#endif 1574 } else { | 1206 * Check for rename involving control object. 1207 */ 1208 if (IS_CTL_NAME(odvp, fnm, flen) || IS_CTL_NAME(ndvp, tnm, tlen)) { 1209 MARK_INT_FAIL(CODA_RENAME_STATS); 1210 return (EACCES); 1211 } 1212 1213 /* --- 332 unchanged lines hidden (view full) --- 1546#ifdef DEBUG 1547 if (VTOC(vp)->c_ovp) { 1548 if (IS_UNMOUNTING(cp)) 1549 printf("coda_reclaim: c_ovp not void: vp " 1550 "%p, cp %p\n", vp, cp); 1551 } 1552#endif 1553 } else { |
1575#ifdef OLD_DIAGNOSTIC 1576 if (vrefcnt(vp) != 0) 1577 print("coda_reclaim: pushing active %p\n", vp); 1578 if (VTOC(vp)->c_ovp) 1579 panic("coda_reclaim: c_ovp not void"); 1580#endif | 1554 if (prtactive && vp->v_usecount != 0) 1555 vprint("coda_reclaim: pushing active", vp); |
1581 } 1582 cache_purge(vp); 1583 coda_free(VTOC(vp)); 1584 vp->v_data = NULL; 1585 vp->v_object = NULL; 1586 return (0); 1587} 1588 --- 174 unchanged lines hidden --- | 1556 } 1557 cache_purge(vp); 1558 coda_free(VTOC(vp)); 1559 vp->v_data = NULL; 1560 vp->v_object = NULL; 1561 return (0); 1562} 1563 --- 174 unchanged lines hidden --- |