patch-2.3.10 linux/fs/coda/cnode.c
Next file: linux/fs/coda/coda_linux.c
Previous file: linux/fs/coda/cache.c
Back to the patch index
Back to the overall index
- Lines: 50
- Date:
Tue Jul 6 19:08:33 1999
- Orig file:
v2.3.9/linux/fs/coda/cnode.c
- Orig date:
Tue Jun 1 23:25:47 1999
diff -u --recursive --new-file v2.3.9/linux/fs/coda/cnode.c linux/fs/coda/cnode.c
@@ -14,6 +14,17 @@
extern int coda_debug;
extern int coda_print_entry;
+inline int coda_fideq(ViceFid *fid1, ViceFid *fid2)
+{
+ if (fid1->Vnode != fid2->Vnode)
+ return 0;
+ if (fid1->Volume != fid2->Volume)
+ return 0;
+ if (fid1->Unique != fid2->Unique)
+ return 0;
+ return 1;
+}
+
/* cnode.c */
static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr)
{
@@ -71,8 +82,14 @@
}
cnp = ITOC(*inode);
- if ( cnp->c_magic != 0 ) {
- printk("coda_cnode make on initialized inode %ld, old %s new
+ /* see if we've got it already */
+ if ( cnp->c_magic != 0 && coda_fideq(fid, &cnp->c_fid)) {
+ return 0;
+ }
+
+ /* not fresh: collision */
+ if ( cnp->c_magic != 0 ) {
+ printk("coda_cnode_make on initialized inode %ld, old %s new
%s!\n",
(*inode)->i_ino, coda_f2s(&cnp->c_fid), coda_f2s2(fid));
iput(*inode);
@@ -106,14 +123,6 @@
return 0;
}
-inline int coda_fideq(ViceFid *fid1, ViceFid *fid2)
-{
- int eq;
- eq = ( (fid1->Vnode == fid2->Vnode) &&
- (fid1->Volume == fid2->Volume) &&
- (fid1->Unique == fid2->Unique) );
- return eq;
-}
void coda_replace_fid(struct inode *inode, struct ViceFid *oldfid,
struct ViceFid *newfid)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)