patch-2.4.4 linux/fs/coda/inode.c
Next file: linux/fs/coda/psdev.c
Previous file: linux/fs/coda/file.c
Back to the patch index
Back to the overall index
- Lines: 104
- Date:
Fri Apr 27 14:09:37 2001
- Orig file:
v2.4.3/linux/fs/coda/inode.c
- Orig date:
Fri Mar 2 11:12:11 2001
diff -u --recursive --new-file v2.4.3/linux/fs/coda/inode.c linux/fs/coda/inode.c
@@ -97,7 +97,6 @@
struct coda_sb_info *sbi = NULL;
struct venus_comm *vc = NULL;
ViceFid fid;
- kdev_t dev = sb->s_dev;
int error;
int idx;
ENTRY;
@@ -139,9 +138,7 @@
sb->s_blocksize = 1024; /* XXXXX what do we put here?? */
sb->s_blocksize_bits = 10;
sb->s_magic = CODA_SUPER_MAGIC;
- sb->s_dev = dev;
sb->s_op = &coda_super_operations;
- sb->s_maxbytes = MAX_NON_LFS;
/* get root fid from Venus: this needs the root inode */
error = venus_rootfid(sb, &fid);
@@ -172,9 +169,9 @@
if(vc)
vc->vc_sb = NULL;
}
- if (root) {
+ if (root)
iput(root);
- }
+
return NULL;
}
@@ -203,47 +200,51 @@
if (!sbi) BUG();
+#if 0
+ /* check if the inode is already initialized */
+ if (inode->u.generic_ip) {
+ printk("coda_read_inode: initialized inode");
+ return;
+ }
+
+ inode->u.generic_ip = cii_alloc();
+ if (!inode->u.generic_ip) {
+ CDEBUG(D_CNODE, "coda_read_inode: failed to allocate inode info\n");
+ make_bad_inode(inode);
+ return;
+ }
+ memset(inode->u.generic_ip, 0, sizeof(struct coda_inode_info));
+#endif
+
cii = ITOC(inode);
- if (cii->c_magic == CODA_CNODE_MAGIC) {
+ if (!coda_isnullfid(&cii->c_fid)) {
printk("coda_read_inode: initialized inode");
return;
}
- memset(cii, 0, sizeof(struct coda_inode_info));
list_add(&cii->c_cilist, &sbi->sbi_cihead);
- cii->c_magic = CODA_CNODE_MAGIC;
}
static void coda_clear_inode(struct inode *inode)
{
struct coda_inode_info *cii = ITOC(inode);
- struct inode *open_inode;
ENTRY;
CDEBUG(D_SUPER, " inode->ino: %ld, count: %d\n",
inode->i_ino, atomic_read(&inode->i_count));
+ CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);
- if ( cii->c_magic != CODA_CNODE_MAGIC )
- return;
-
+ if (cii->c_container) BUG();
+
list_del_init(&cii->c_cilist);
+ inode->i_mapping = &inode->i_data;
+ coda_cache_clear_inode(inode);
- if ( inode->i_ino == CTL_INO )
- goto out;
+#if 0
+ cii_free(inode->u.generic_ip);
+ inode->u.generic_ip = NULL;
+#endif
- if ( inode->i_mapping != &inode->i_data ) {
- open_inode = inode->i_mapping->host;
- CDEBUG(D_SUPER, "DELINO cached file: ino %ld count %d.\n",
- open_inode->i_ino, atomic_read(&open_inode->i_count));
- inode->i_mapping = &inode->i_data;
- iput(open_inode);
- }
-
- CDEBUG(D_DOWNCALL, "clearing inode: %ld, %x\n", inode->i_ino, cii->c_flags);
- coda_cache_clear_inode(inode);
-out:
- inode->u.coda_i.c_magic = 0;
- memset(&inode->u.coda_i.c_fid, 0, sizeof(struct ViceFid));
EXIT;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)